mod_restart Module

Rank-independent restart file support.

Restart files store global-cell-indexed arrays in canonical mesh order. The file is therefore independent of the MPI rank count used to write it: a later run with a different contiguous cell decomposition can read the same global arrays and continue from the stored step/time.



Variables

Type Visibility Attributes Name Initial
character(len=32), private, parameter :: restart_magic = 'LMRH_RESTART_V2'
integer, private, parameter :: restart_version = 2

Subroutines

public subroutine read_restart_file(mesh, flow, params, fields, species, energy, transport, step, time, chemistry_accum_dt)

Read a restart file if restart_from_file is enabled. All ranks read the same global file; because arrays are global, this naturally supports a new MPI rank count without scatter logic.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(flow_mpi_t), intent(inout) :: flow
type(case_params_t), intent(inout) :: params
type(flow_fields_t), intent(inout) :: fields
type(species_fields_t), intent(inout) :: species
type(energy_fields_t), intent(inout) :: energy
type(transport_properties_t), intent(inout) :: transport
integer, intent(inout) :: step
real(kind=rk), intent(inout) :: time
real(kind=rk), intent(inout), optional :: chemistry_accum_dt

public subroutine write_restart_file(mesh, flow, params, fields, species, energy, transport, step, time, chemistry_accum_dt)

Write a restart file if enabled in &restart_input.

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(in) :: mesh
type(flow_mpi_t), intent(inout) :: flow
type(case_params_t), intent(in) :: params
type(flow_fields_t), intent(in) :: fields
type(species_fields_t), intent(in) :: species
type(energy_fields_t), intent(in) :: energy
type(transport_properties_t), intent(in) :: transport
integer, intent(in) :: step
real(kind=rk), intent(in) :: time
real(kind=rk), intent(in), optional :: chemistry_accum_dt

private subroutine gather_owned_face_scalar(flow, nfaces, face_field, global_field)

Arguments

Type IntentOptional Attributes Name
type(flow_mpi_t), intent(in) :: flow
integer, intent(in) :: nfaces
real(kind=rk), intent(in) :: face_field(:)
real(kind=rk), intent(out) :: global_field(:)

private subroutine pack_energy_diagnostics(energy, diag)

Arguments

Type IntentOptional Attributes Name
type(energy_fields_t), intent(in) :: energy
real(kind=rk), intent(out) :: diag(12)

private subroutine prune_restart_files(params, restart_dir)

Arguments

Type IntentOptional Attributes Name
type(case_params_t), intent(in) :: params
character(len=*), intent(in) :: restart_dir

private subroutine restart_directory(params, restart_dir)

Arguments

Type IntentOptional Attributes Name
type(case_params_t), intent(in) :: params
character(len=path_len), intent(out) :: restart_dir

private subroutine restore_energy_diagnostics(energy, diag)

Arguments

Type IntentOptional Attributes Name
type(energy_fields_t), intent(inout) :: energy
real(kind=rk), intent(in) :: diag(12)

private subroutine write_restart_to_path(filename, mesh, flow, params, fields, species, energy, transport, step, time, chemistry_accum_dt)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: filename
type(mesh_t), intent(in) :: mesh
type(flow_mpi_t), intent(inout) :: flow
type(case_params_t), intent(in) :: params
type(flow_fields_t), intent(in) :: fields
type(species_fields_t), intent(in) :: species
type(energy_fields_t), intent(in) :: energy
type(transport_properties_t), intent(in) :: transport
integer, intent(in) :: step
real(kind=rk), intent(in) :: time
real(kind=rk), intent(in) :: chemistry_accum_dt