Subroutine that loads KORC parameters that control the time stepping in main.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(inout) | :: | params | Core KORC simulation parameters. |
subroutine load_time_stepping_params(params)
!! @note Subroutine that loads KORC parameters that control the time
!! stepping in [[main]].
TYPE(KORC_PARAMS), INTENT(INOUT) :: params
!! Core KORC simulation parameters.
CHARACTER(MAX_STRING_LENGTH) :: filename
!! String containing the name of the HDF5 file.
CHARACTER(MAX_STRING_LENGTH) :: dset
!! Name of data set to be read from file.
INTEGER(HID_T) :: h5file_id
!! HDF5 file identifier.
REAL(KIND=8) :: real_number
!! A temporary real number.
CHARACTER(19) :: tmp_str
!! Temporary string used to manipulate various strings.
INTEGER :: h5error
!! HDF5 error status.
INTEGER :: mpierr
!! MPI error status.
INTEGER :: ss
!! Electron species iterator.
if (params%mpi_params%rank.EQ.0_idef) then
filename = TRIM(params%path_to_outputs) // "restart_file.h5"
call h5fopen_f(filename, H5F_ACC_RDONLY_F, h5file_id, h5error)
if (h5error .EQ. -1) then
write(output_unit_write,'("KORC ERROR: Something went wrong in: &
&load_particles_ic --> h5fopen_f")')
call KORC_ABORT(14)
end if
dset = "/it"
call load_from_hdf5(h5file_id,dset,real_number)
params%ito = INT(real_number,ip) + 1_ip
dset = "/dt"
call load_from_hdf5(h5file_id,dset,params%dt)
dset = "/t_steps"
call load_from_hdf5(h5file_id,dset,real_number)
params%t_steps = INT(real_number,ip)
dset = "/simulation_time"
call load_from_hdf5(h5file_id,dset,params%simulation_time)
dset = "/snapshot_frequency"
call load_from_hdf5(h5file_id,dset,params%snapshot_frequency)
dset = "/output_cadence"
call load_from_hdf5(h5file_id,dset,real_number)
params%output_cadence = INT(real_number,ip)
dset = "/restart_output_cadence"
call load_from_hdf5(h5file_id,dset,real_number)
params%restart_output_cadence = INT(real_number,ip)
dset = "/num_snapshots"
call load_from_hdf5(h5file_id,dset,real_number)
params%num_snapshots = INT(real_number,ip)
call h5fclose_f(h5file_id, h5error)
end if
CALL MPI_BCAST(params%ito,1,MPI_INTEGER8,0,MPI_COMM_WORLD,mpierr)
CALL MPI_BCAST(params%dt,1,MPI_REAL8,0,MPI_COMM_WORLD,mpierr)
CALL MPI_BCAST(params%t_steps,1,MPI_INTEGER8,0,MPI_COMM_WORLD,mpierr)
CALL MPI_BCAST(params%simulation_time,1,MPI_REAL8,0,MPI_COMM_WORLD,mpierr)
CALL MPI_BCAST(params%snapshot_frequency,1,MPI_REAL8,0,MPI_COMM_WORLD, &
mpierr)
CALL MPI_BCAST(params%output_cadence,1,MPI_INTEGER8,0,MPI_COMM_WORLD,mpierr)
CALL MPI_BCAST(params%restart_output_cadence,1,MPI_INTEGER8,0, &
MPI_COMM_WORLD,mpierr)
CALL MPI_BCAST(params%num_snapshots,1,MPI_INTEGER8,0,MPI_COMM_WORLD,mpierr)
end subroutine load_time_stepping_params