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_prev_iter(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_prev_iter --> h5fopen_f")')
call KORC_ABORT(14)
end if
dset = "/ind_2x1t"
call load_from_hdf5(h5file_id,dset,real_number)
params%prev_iter_2x1t = INT(real_number,ip)
call h5fclose_f(h5file_id, h5error)
end if
CALL MPI_BCAST(params%prev_iter_2x1t,1,MPI_REAL8,0,MPI_COMM_WORLD,mpierr)
end subroutine load_prev_iter