load_time_stepping_params Subroutine

public subroutine load_time_stepping_params(params)

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(inout) :: params

Core KORC simulation parameters.


Calls

proc~~load_time_stepping_params~~CallsGraph proc~load_time_stepping_params load_time_stepping_params mpi_bcast mpi_bcast proc~load_time_stepping_params->mpi_bcast h5fclose_f h5fclose_f proc~load_time_stepping_params->h5fclose_f proc~korc_abort korc_abort proc~load_time_stepping_params->proc~korc_abort h5fopen_f h5fopen_f proc~load_time_stepping_params->h5fopen_f interface~load_from_hdf5 load_from_hdf5 proc~load_time_stepping_params->interface~load_from_hdf5 mpi_abort mpi_abort proc~korc_abort->mpi_abort proc~rload_from_hdf5 rload_from_hdf5 interface~load_from_hdf5->proc~rload_from_hdf5 proc~iload_from_hdf5 iload_from_hdf5 interface~load_from_hdf5->proc~iload_from_hdf5 proc~rload_from_hdf5->proc~korc_abort h5dclose_f h5dclose_f proc~rload_from_hdf5->h5dclose_f h5dread_f h5dread_f proc~rload_from_hdf5->h5dread_f proc~iload_from_hdf5->proc~korc_abort proc~iload_from_hdf5->h5dclose_f proc~iload_from_hdf5->h5dread_f

Called by

proc~~load_time_stepping_params~~CalledByGraph proc~load_time_stepping_params load_time_stepping_params proc~define_time_step define_time_step proc~define_time_step->proc~load_time_stepping_params program~main main program~main->proc~define_time_step

Contents


Source Code

  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