MOM_restart module reference
The MOM6 facility for reading and writing restart files, and querying what has been read.
Data Types
A type for making arrays of pointers to 4-d arrays |
|
A type for making arrays of pointers to 3-d arrays |
|
A type for making arrays of pointers to 2-d arrays |
|
A type for making arrays of pointers to 1-d arrays |
|
A type for making arrays of pointers to scalars |
|
A structure with information about a single restart field |
|
A structure to store information about restart fields that are no longer used |
|
A restart registry and the control structure for restarts |
Generic Interfaces
Register fields for restarts |
|
Register a pair of restart fields whose rotations map onto each other |
|
Indicate whether a field has been read from a restart file |
|
Specify that a field has been initialized, even if it was not read from a restart file |
|
Copy the restart variable with the specified name into an array, perhaps after rotation |
|
Copy the restart vector component variables with the specified names into a pair of arrays, perhaps after rotation |
|
Read optional variables from restart files. |
Functions/Subroutines
Register a restart field as obsolete |
|
Register a 3-d field for restarts, providing the metadata in a structure |
|
Register a 4-d field for restarts, providing the metadata in a structure |
|
Register a 2-d field for restarts, providing the metadata in a structure |
|
Register a 1-d field for restarts, providing the metadata in a structure |
|
Register a 0-d field for restarts, providing the metadata in a structure |
|
Register a pair of rotationally equivalent 2d restart fields |
|
Register a pair of rotationally equivalent 3d restart fields |
|
Register a pair of rotationally equivalent 2d restart fields |
|
Set a pair of factors to multiply by the components of a vector when writing that include any sign changes needed to account for grid rotation. |
|
Register a 4-d field for restarts, providing the metadata as individual arguments |
|
Register a 3-d field for restarts, providing the metadata as individual arguments |
|
Register a 2-d field for restarts, providing the metadata as individual arguments |
|
Register a 1-d field for restarts, providing the metadata as individual arguments |
|
Register a 0-d field for restarts, providing the metadata as individual arguments |
|
query_initialized_name determines whether a named field has been successfully read from a restart file or has otherwise been recorded as being initialized. |
|
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. |
|
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. |
|
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. |
|
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. |
|
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. |
|
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file. |
|
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file. |
|
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file. |
|
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file. |
|
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file. |
|
set_initialized_name records that a named field has been initialized. |
|
Record that the array in f_ptr with the given name has been initialized. |
|
Record that the array in f_ptr with the given name has been initialized. |
|
Record that the array in f_ptr with the given name has been initialized. |
|
Record that the array in f_ptr with the given name has been initialized. |
|
Record that the array in f_ptr with the given name has been initialized. |
|
Try to read a named 4-d field from the restart files |
|
Try to read a named 3-d field from the restart files |
|
Try to read a named 2-d field from the restart files |
|
Try to read a named 3-d field from the restart files |
|
Return an indication of whether the named variable is in the restart files, and provide the full path to the restart file in which a variable is found. |
|
Copy the restart variable with the specified name into a 3-d array, perhaps after rotation |
|
Copy the restart vector component variables with the specified names into a pair of 3-d arrays, perhaps after rotation |
|
Indicate if two 3-d arrays are not of the same size after rotation is considered. |
|
save_restart saves all registered variables to restart files. |
|
restore_state reads the model state from previously generated files. All restart variables are read from the first file in the input filename list in which they are found. |
|
restart_files_exist determines whether any restart files exist. |
|
determine_is_new_run determines from the value of filename and the existence automatically named restart files in directory whether this would be a new, and as a side effect stores this information in CS. |
|
is_new_run returns whether this is going to be a new run based on the information stored in CS by a previous call to determine_is_new_run. |
|
open_restart_units determines the number of existing restart files and optionally opens them and returns unit ids, paths and whether the files are global or spatially decomposed. |
|
get_num_restart_files returns the number of existing restart files that match the provided directory structure and other information stored in the control structure and optionally also provides the full paths to these files. |
|
Initialize this module and set up a restart control structure. |
|
Issue an error message if the restart_registry is locked. |
|
Lock the restart registry so that an error is issued if any further restart variables are registered. |
|
Indicate that all variables have now been registered and lock the registry. |
|
Deallocate memory associated with a MOM_restart_CS variable. |
|
Return bounds for computing checksums to store in restart files |
|
get the size of a variable in bytes |
Type Documentation
- type p4d
A type for making arrays of pointers to 4-d arrays
- Parameters
p
A pointer to a 4d array in arbitrary rescaled units [A ~> a]
- type p3d
A type for making arrays of pointers to 3-d arrays
- Parameters
p
A pointer to a 3d array in arbitrary rescaled units [A ~> a]
- type p2d
A type for making arrays of pointers to 2-d arrays
- Parameters
p
A pointer to a 2d array in arbitrary rescaled units [A ~> a]
- type p1d
A type for making arrays of pointers to 1-d arrays
- Parameters
p
A pointer to a 1d array in arbitrary rescaled units [A ~> a]
- type p0d
A type for making arrays of pointers to scalars
- Parameters
p
A pointer to a scalar in arbitrary rescaled units [A ~> a]
- type field_restart
A structure with information about a single restart field
- Parameters
vars
Description of a field that is to be read from or written to the restart file.
mand_var
If .true. the run will abort if this field is not successfully read from the restart file.
initialized
.true. if this field has been read from the restart file.
var_name
A name by which a variable may be queried.
conv
A factor by which a restart field should be multiplied before it is written to a restart file, usually to convert it to MKS or other standard units [a A-1 ~> 1]. When read, the restart field is multiplied by the reciprocal of this factor.
- type obsolete_restart
A structure to store information about restart fields that are no longer used
- Parameters
field_name
Name of restart field that is no longer in use
replacement_name
Name of replacement restart field, if applicable
- type, public :: MOM_restart_CS
A restart registry and the control structure for restarts
- Parameters
initialized
True if this control structure has been initialized.
restart
restart is set to .true. if the run has been started from a full restart file. Otherwise some fields must be initialized approximately.
novars
The number of restart fields that have been registered.
num_obsolete_vars
The number of obsolete restart fields that have been registered.
parallel_restartfiles
If true, the IO layout is used to group processors that write to the same restart file or each processor writes its own (numbered) restart file. If false, a single restart file is generated after internally combining output from all PEs.
new_run
If true, the input filenames and restart file existence will result in a new run that is not initialized from restart files.
new_run_set
If true, new_run has been determined for this restart_CS.
checksum_required
If true, require the restart checksums to match and error out otherwise. Users may want to avoid this comparison if for example the restarts are made from a run with a different mask_table than the current run, in which case the checksums will not match and cause crash.
symmetric_checksums
If true, do the restart checksums on all the edge points for a non-reentrant grid. Setting this to true requires that SYMMETRIC_MEMORY_ is defined at compile time.
unsigned_zeros
If true, convert any negative zeros that would be written to the restart file into ordinary unsigned zeros. This does not change answers, but it can be helpful in comparing restart files after grid rotation, for example.
reentrant_x
If true, the domain is reentrant in the x-direction. This is only used here to determine the extent of the restart checksums.
reentrant_y
If true, the domain is reentrant in the y-direction. This is only used here to determine the extent of the restart checksums.
restartfile
The name or name root for MOM restart files.
turns
Number of quarter turns from input to model domain
locked
If true this registry has been locked and no further restart fields can be added without explicitly unlocking the registry.
An array of descriptions of the registered fields
restart_field
An array of obsolete restart fields
var_ptr0d
Pointers to the fields that have been registered for restarts
var_ptr1d
Pointers to the fields that have been registered for restarts
var_ptr2d
Pointers to the fields that have been registered for restarts
var_ptr3d
Pointers to the fields that have been registered for restarts
var_ptr4d
Pointers to the fields that have been registered for restarts
max_fields
The maximum number of restart fields
ensemble_appendix_prefix
The prefix after which the ensemble id appendix is added in output file names.
Generic Interface Documentation
- interface register_restart_field
Register fields for restarts
Callers call graph
Text view
boundary_impulse_tracer::register_boundary_impulse_tracer → mom_restart::interface::register_restart_field
marbl_tracers::register_marbl_tracers → mom_restart::interface::register_restart_field
marbl_tracers::setup_saved_state → mom_restart::interface::register_restart_field
mom::finish_mom_initialization → mom_restart::interface::register_restart_field
mom::set_restart_fields → mom_restart::interface::register_restart_field
mom_barotropic::register_barotropic_restarts → mom_restart::interface::register_restart_field
mom_controlled_forcing::register_ctrl_forcing_restarts → mom_restart::interface::register_restart_field
mom_cvmix_kpp::register_kpp_restarts → mom_restart::interface::register_restart_field
mom_dynamics_split_rk2::register_restarts_dyn_split_rk2 → mom_restart::interface::register_restart_field
mom_dynamics_split_rk2b::register_restarts_dyn_split_rk2b → mom_restart::interface::register_restart_field
mom_ice_shelf::initialize_ice_shelf → mom_restart::interface::register_restart_field
mom_ice_shelf_dynamics::register_ice_shelf_dyn_restarts → mom_restart::interface::register_restart_field
mom_internal_tides::register_int_tide_restarts → mom_restart::interface::register_restart_field
mom_meke::meke_alloc_register_restart → mom_restart::interface::register_restart_field
mom_mixed_layer_restrat::mixedlayer_restrat_register_restarts → mom_restart::interface::register_restart_field
mom_oda_incupd::initialize_oda_incupd_fixed → mom_restart::interface::register_restart_field
mom_oda_incupd::output_oda_incupd_inc → mom_restart::interface::register_restart_field
mom_open_boundary::open_boundary_register_restarts → mom_restart::interface::register_restart_field
mom_restart::register_restart_pair_ptr2d → mom_restart::interface::register_restart_field
mom_restart::register_restart_pair_ptr3d → mom_restart::interface::register_restart_field
mom_restart::register_restart_pair_ptr4d → mom_restart::interface::register_restart_field
mom_set_visc::set_visc_register_restarts → mom_restart::interface::register_restart_field
mom_stoch_eos::stoch_eos_register_restarts → mom_restart::interface::register_restart_field
mom_streaming_filter::filt_register → mom_restart::interface::register_restart_field
mom_tracer_registry::register_tracer → mom_restart::interface::register_restart_field
- interface register_restart_pair
Register a pair of restart fields whose rotations map onto each other
Callers call graph
Text view
mom::set_restart_fields → mom_restart::interface::register_restart_pair
mom_barotropic::register_barotropic_restarts → mom_restart::interface::register_restart_pair
mom_dynamics_split_rk2::register_restarts_dyn_split_rk2 → mom_restart::interface::register_restart_pair
mom_dynamics_split_rk2b::register_restarts_dyn_split_rk2b → mom_restart::interface::register_restart_pair
mom_ice_shelf::initialize_ice_shelf → mom_restart::interface::register_restart_pair
mom_oda_incupd::output_oda_incupd_inc → mom_restart::interface::register_restart_pair
mom_open_boundary::open_boundary_register_restarts → mom_restart::interface::register_restart_pair
mom_set_visc::set_visc_register_restarts → mom_restart::interface::register_restart_pair
mom_wave_interface::waves_register_restarts → mom_restart::interface::register_restart_pair
- interface query_initialized
Indicate whether a field has been read from a restart file
Callers call graph
Text view
advection_test_tracer::initialize_advection_test_tracer → mom_restart::interface::query_initialized
boundary_impulse_tracer::initialize_boundary_impulse_tracer → mom_restart::interface::query_initialized
dyed_obc_tracer::initialize_dyed_obc_tracer → mom_restart::interface::query_initialized
ideal_age_example::initialize_ideal_age_tracer → mom_restart::interface::query_initialized
marbl_tracers::initialize_marbl_tracers → mom_restart::interface::query_initialized
mom::initialize_mom → mom_restart::interface::query_initialized
mom_barotropic::barotropic_init → mom_restart::interface::query_initialized
mom_cfc_cap::initialize_cfc_cap → mom_restart::interface::query_initialized
mom_dynamics_split_rk2::initialize_dyn_split_rk2 → mom_restart::interface::query_initialized
mom_dynamics_split_rk2b::initialize_dyn_split_rk2b → mom_restart::interface::query_initialized
mom_meke::meke_init → mom_restart::interface::query_initialized
mom_ocmip2_cfc::initialize_ocmip2_cfc → mom_restart::interface::query_initialized
mom_oda_incupd::initialize_oda_incupd → mom_restart::interface::query_initialized
mom_open_boundary::setup_obc_thickness_reservoirs → mom_restart::interface::query_initialized
mom_open_boundary::setup_obc_tracer_reservoirs → mom_restart::interface::query_initialized
mom_stoch_eos::mom_stoch_eos_init → mom_restart::interface::query_initialized
mom_streaming_filter::filt_init → mom_restart::interface::query_initialized
nw2_tracers::initialize_nw2_tracers → mom_restart::interface::query_initialized
oil_tracer::initialize_oil_tracer → mom_restart::interface::query_initialized
pseudo_salt_tracer::initialize_pseudo_salt_tracer → mom_restart::interface::query_initialized
- interface set_initialized
Specify that a field has been initialized, even if it was not read from a restart file
Callers call graph
Text view
advection_test_tracer::initialize_advection_test_tracer → mom_restart::interface::set_initialized
boundary_impulse_tracer::initialize_boundary_impulse_tracer → mom_restart::interface::set_initialized
dyed_obc_tracer::initialize_dyed_obc_tracer → mom_restart::interface::set_initialized
ideal_age_example::initialize_ideal_age_tracer → mom_restart::interface::set_initialized
mom::initialize_mom → mom_restart::interface::set_initialized
mom_cfc_cap::initialize_cfc_cap → mom_restart::interface::set_initialized
mom_dynamics_split_rk2::initialize_dyn_split_rk2 → mom_restart::interface::set_initialized
mom_dynamics_split_rk2b::initialize_dyn_split_rk2b → mom_restart::interface::set_initialized
mom_ocmip2_cfc::initialize_ocmip2_cfc → mom_restart::interface::set_initialized
mom_open_boundary::set_initialized_obc_tracer_reservoirs → mom_restart::interface::set_initialized
nw2_tracers::initialize_nw2_tracers → mom_restart::interface::set_initialized
oil_tracer::initialize_oil_tracer → mom_restart::interface::set_initialized
pseudo_salt_tracer::initialize_pseudo_salt_tracer → mom_restart::interface::set_initialized
- interface copy_restart_var
Copy the restart variable with the specified name into an array, perhaps after rotation
Callers call graph
- interface copy_restart_vector
Copy the restart vector component variables with the specified names into a pair of arrays, perhaps after rotation
Callers call graph
- interface only_read_from_restarts
Read optional variables from restart files.
Callers call graph
Functions/Subroutine Documentation
- subroutine register_restart_field_as_obsolete(field_name, replacement_name, CS)
Register a restart field as obsolete
- Parameters
field_name [in]
Name of restart field that is no longer in use
replacement_name [in]
Name of replacement restart field, if applicable
CS [inout]
MOM restart control struct
Callers call graph
- subroutine register_restart_field_ptr3d(f_ptr, var_desc, mandatory, CS, conversion)
Register a 3-d field for restarts, providing the metadata in a structure
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
var_desc [in]
A structure with metadata about this variable
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
Callees call graph
Callers call graph
- subroutine register_restart_field_ptr4d(f_ptr, var_desc, mandatory, CS, conversion)
Register a 4-d field for restarts, providing the metadata in a structure
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
var_desc [in]
A structure with metadata about this variable
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
Callees call graph
Callers call graph
- subroutine register_restart_field_ptr2d(f_ptr, var_desc, mandatory, CS, conversion)
Register a 2-d field for restarts, providing the metadata in a structure
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
var_desc [in]
A structure with metadata about this variable
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
Callees call graph
Callers call graph
- subroutine register_restart_field_ptr1d(f_ptr, var_desc, mandatory, CS, conversion)
Register a 1-d field for restarts, providing the metadata in a structure
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
var_desc [in]
A structure with metadata about this variable
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
Callees call graph
Callers call graph
- subroutine register_restart_field_ptr0d(f_ptr, var_desc, mandatory, CS, conversion)
Register a 0-d field for restarts, providing the metadata in a structure
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
var_desc [in]
A structure with metadata about this variable
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
Callees call graph
Callers call graph
- subroutine register_restart_pair_ptr2d(a_ptr, b_ptr, a_desc, b_desc, mandatory, CS, conversion, scalar_pair)
Register a pair of rotationally equivalent 2d restart fields
- Parameters
a_ptr [in]
First field pointer in arbitrary rescaled units [A ~> a]
b_ptr [in]
Second field pointer in arbitrary rescaled units [A ~> a]
a_desc [in]
First field descriptor
b_desc [in]
Second field descriptor
mandatory [in]
If true, abort if field is missing
CS [inout]
MOM restart control structure
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
scalar_pair [in]
If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- subroutine register_restart_pair_ptr3d(a_ptr, b_ptr, a_desc, b_desc, mandatory, CS, conversion, scalar_pair)
Register a pair of rotationally equivalent 3d restart fields
- Parameters
a_ptr [in]
First field pointer in arbitrary rescaled units [A ~> a]
b_ptr [in]
Second field pointer in arbitrary rescaled units [A ~> a]
a_desc [in]
First field descriptor
b_desc [in]
Second field descriptor
mandatory [in]
If true, abort if field is missing
CS [inout]
MOM restart control structure
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
scalar_pair [in]
If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- subroutine register_restart_pair_ptr4d(a_ptr, b_ptr, a_desc, b_desc, mandatory, CS, conversion, scalar_pair)
Register a pair of rotationally equivalent 2d restart fields
- Parameters
a_ptr [in]
First field pointer in arbitrary rescaled units [A ~> a]
b_ptr [in]
Second field pointer in arbitrary rescaled units [A ~> a]
a_desc [in]
First field descriptor
b_desc [in]
Second field descriptor
mandatory [in]
If true, abort if field is missing
CS [inout]
MOM restart control structure
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
scalar_pair [in]
If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- subroutine set_conversion_pair(u_conv, v_conv, turns, conversion, scalar_pair)
Set a pair of factors to multiply by the components of a vector when writing that include any sign changes needed to account for grid rotation.
- Parameters
u_conv [out]
A factor to multiply the u-component of a vector by before it is written, including sign changes due to grid rotation [a A-1 ~> 1]
v_conv [out]
A factor to multiply the u-component of a vector by before it is written, including sign changes due to grid rotation [a A-1 ~> 1]
turns [in]
Number of quarter turns from input to model domain
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
scalar_pair [in]
If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- subroutine register_restart_field_4d(f_ptr, name, mandatory, CS, longname, units, conversion, hor_grid, z_grid, t_grid, extra_axes)
Register a 4-d field for restarts, providing the metadata as individual arguments
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
name [in]
variable name to be used in the restart file
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
longname [in]
variable long name
units [in]
variable units
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
hor_grid [in]
variable horizontal staggering, 'h' if absent
z_grid [in]
variable vertical staggering, 'L' if absent
t_grid [in]
time description: s, p, or 1, 's' if absent
extra_axes [in]
dimensions other than space-time
Callees call graph
- subroutine register_restart_field_3d(f_ptr, name, mandatory, CS, longname, units, conversion, hor_grid, z_grid, t_grid, extra_axes)
Register a 3-d field for restarts, providing the metadata as individual arguments
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
name [in]
variable name to be used in the restart file
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
longname [in]
variable long name
units [in]
variable units
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
hor_grid [in]
variable horizontal staggering, 'h' if absent
z_grid [in]
variable vertical staggering, 'L' if absent
t_grid [in]
time description: s, p, or 1, 's' if absent
extra_axes [in]
dimensions other than space-time
Callees call graph
- subroutine register_restart_field_2d(f_ptr, name, mandatory, CS, longname, units, conversion, hor_grid, z_grid, t_grid)
Register a 2-d field for restarts, providing the metadata as individual arguments
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
name [in]
variable name to be used in the restart file
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
longname [in]
variable long name
units [in]
variable units
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
hor_grid [in]
variable horizontal staggering, 'h' if absent
z_grid [in]
variable vertical staggering, '1' if absent
t_grid [in]
time description: s, p, or 1, 's' if absent
Callees call graph
- subroutine register_restart_field_1d(f_ptr, name, mandatory, CS, longname, units, conversion, hor_grid, z_grid, t_grid)
Register a 1-d field for restarts, providing the metadata as individual arguments
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
name [in]
variable name to be used in the restart file
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
longname [in]
variable long name
units [in]
variable units
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
hor_grid [in]
variable horizontal staggering, '1' if absent
z_grid [in]
variable vertical staggering, 'L' if absent
t_grid [in]
time description: s, p, or 1, 's' if absent
Callees call graph
- subroutine register_restart_field_0d(f_ptr, name, mandatory, CS, longname, units, conversion, t_grid)
Register a 0-d field for restarts, providing the metadata as individual arguments
- Parameters
f_ptr [in]
A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]
name [in]
variable name to be used in the restart file
mandatory [in]
If true, the run will abort if this field is not successfully read from the restart file.
CS [inout]
MOM restart control struct
longname [in]
variable long name
units [in]
variable units
conversion [in]
A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
t_grid [in]
time description: s, p, or 1, 's' if absent
Callees call graph
- function query_initialized_name(name, CS) result(query_initialized)
query_initialized_name determines whether a named field has been successfully read from a restart file or has otherwise been recorded as being initialized.
- Parameters
name [in]
The name of the field that is being queried
CS [in]
MOM restart control struct
Callees call graph
Callers call graph
Text view
mom_restart::query_initialized_0d_name → mom_restart::query_initialized_name
mom_restart::query_initialized_1d_name → mom_restart::query_initialized_name
mom_restart::query_initialized_2d_name → mom_restart::query_initialized_name
mom_restart::query_initialized_3d_name → mom_restart::query_initialized_name
mom_restart::query_initialized_4d_name → mom_restart::query_initialized_name
- function query_initialized_0d(f_ptr, CS) result(query_initialized)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters
f_ptr [in]
A pointer to the field that is being queried [arbitrary]
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_1d(f_ptr, CS) result(query_initialized)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters
f_ptr [in]
A pointer to the field that is being queried [arbitrary]
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_2d(f_ptr, CS) result(query_initialized)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters
f_ptr [in]
A pointer to the field that is being queried [arbitrary]
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_3d(f_ptr, CS) result(query_initialized)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters
f_ptr [in]
A pointer to the field that is being queried [arbitrary]
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_4d(f_ptr, CS) result(query_initialized)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters
f_ptr [in]
A pointer to the field that is being queried [arbitrary]
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_0d_name(f_ptr, name, CS) result(query_initialized)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters
f_ptr [in]
The field that is being queried [arbitrary]
name [in]
The name of the field that is being queried
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_1d_name(f_ptr, name, CS) result(query_initialized)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters
f_ptr [in]
The field that is being queried [arbitrary]
name [in]
The name of the field that is being queried
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_2d_name(f_ptr, name, CS) result(query_initialized)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters
f_ptr [in]
The field that is being queried [arbitrary]
name [in]
The name of the field that is being queried
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_3d_name(f_ptr, name, CS) result(query_initialized)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters
f_ptr [in]
The field that is being queried [arbitrary]
name [in]
The name of the field that is being queried
CS [in]
MOM restart control struct
Callees call graph
- function query_initialized_4d_name(f_ptr, name, CS) result(query_initialized)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters
f_ptr [in]
The field that is being queried [arbitrary]
name [in]
The name of the field that is being queried
CS [in]
MOM restart control struct
Callees call graph
- subroutine set_initialized_name(name, CS)
set_initialized_name records that a named field has been initialized.
- Parameters
name [in]
The name of the field that is being set
CS [inout]
MOM restart control struct
Callees call graph
Callers call graph
Text view
mom_restart::set_initialized_0d_name → mom_restart::set_initialized_name
mom_restart::set_initialized_1d_name → mom_restart::set_initialized_name
mom_restart::set_initialized_2d_name → mom_restart::set_initialized_name
mom_restart::set_initialized_3d_name → mom_restart::set_initialized_name
mom_restart::set_initialized_4d_name → mom_restart::set_initialized_name
- subroutine set_initialized_0d_name(f_ptr, name, CS)
Record that the array in f_ptr with the given name has been initialized.
- Parameters
f_ptr [in]
The variable that has been initialized [arbitrary]
name [in]
The name of the field that has been initialized
CS [inout]
MOM restart control struct
- subroutine set_initialized_1d_name(f_ptr, name, CS)
Record that the array in f_ptr with the given name has been initialized.
- Parameters
f_ptr [in]
The array that has been initialized [arbitrary]
name [in]
The name of the field that has been initialized
CS [inout]
MOM restart control struct
- subroutine set_initialized_2d_name(f_ptr, name, CS)
Record that the array in f_ptr with the given name has been initialized.
- Parameters
f_ptr [in]
The array that has been initialized [arbitrary]
name [in]
The name of the field that has been initialized
CS [inout]
MOM restart control struct
- subroutine set_initialized_3d_name(f_ptr, name, CS)
Record that the array in f_ptr with the given name has been initialized.
- Parameters
f_ptr [in]
The array that has been initialized [arbitrary]
name [in]
The name of the field that has been initialized
CS [inout]
MOM restart control struct
- subroutine set_initialized_4d_name(f_ptr, name, CS)
Record that the array in f_ptr with the given name has been initialized.
- Parameters
f_ptr [in]
The array that has been initialized [arbitrary]
name [in]
The name of the field that has been initialized
CS [inout]
MOM restart control struct
- subroutine only_read_restart_field_4d(varname, f_ptr, G, CS, position, filename, directory, success, scale)
Try to read a named 4-d field from the restart files
- Parameters
varname [in]
The variable name to be used in the restart file
f_ptr [inout]
The array for the field to be read in arbitrary rescaled units [A ~> a]
G [in]
The ocean's grid structure
CS [in]
MOM restart control struct
position [in]
A coded integer indicating the horizontal position of this variable
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to seek restart files.
success [out]
True if the field was read successfully
scale [in]
A factor by which the field will be scaled [A a-1 ~> 1] to convert from the units in the file to the internal units of this field
- subroutine only_read_restart_field_3d(varname, f_ptr, G, CS, position, filename, directory, success, scale)
Try to read a named 3-d field from the restart files
- Parameters
varname [in]
The variable name to be used in the restart file
f_ptr [inout]
The array for the field to be read in arbitrary rescaled units [A ~> a]
G [in]
The ocean's grid structure
CS [in]
MOM restart control struct
position [in]
A coded integer indicating the horizontal position of this variable
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to seek restart files.
success [out]
True if the field was read successfully
scale [in]
A factor by which the field will be scaled [A a-1 ~> 1] to convert from the units in the file to the internal units of this field
- subroutine only_read_restart_field_2d(varname, f_ptr, G, CS, position, filename, directory, success, scale)
Try to read a named 2-d field from the restart files
- Parameters
varname [in]
The variable name to be used in the restart file
f_ptr [inout]
The array for the field to be read in arbitrary rescaled units [A ~> a]
G [in]
The ocean's grid structure
CS [in]
MOM restart control struct
position [in]
A coded integer indicating the horizontal position of this variable
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to seek restart files.
success [out]
True if the field was read successfully
scale [in]
A factor by which the field will be scaled [A a-1 ~> 1] to convert from the units in the file to the internal units of this field
- subroutine only_read_restart_pair_3d(a_ptr, b_ptr, a_name, b_name, G, CS, stagger, filename, directory, success, scale)
Try to read a named 3-d field from the restart files
- Parameters
a_ptr [inout]
The array for the first field to be read in arbitrary rescaled units [A ~> a]
b_ptr [inout]
The array for the second field to be read in arbitrary rescaled units [A ~> a]
a_name [in]
The first variable name to be used in the restart file
b_name [in]
The second variable name to be used in the restart file
G [in]
The ocean's grid structure
CS [in]
MOM restart control struct
stagger [in]
A coded integer indicating the horizontal position of this pair of variables
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to seek restart files.
success [out]
True if the field was read successfully
scale [in]
A factor by which the fields will be scaled [A a-1 ~> 1] to convert from the units in the file to the internal units of this field
- function find_var_in_restart_files(varname, G, CS, file_path, filename, directory, is_global) result(found)
Return an indication of whether the named variable is in the restart files, and provide the full path to the restart file in which a variable is found.
- Parameters
varname [in]
The variable name to be used in the restart file
G [in]
The ocean's grid structure
CS [in]
MOM restart control struct
file_path [out]
The full path to the file in which the variable is found
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to seek restart files.
is_global [out]
True if the file is global.
found
True if the named variable was found in the restart files.
Callees call graph
Callers call graph
Text view
mom_restart::only_read_restart_field_2d → mom_restart::find_var_in_restart_files
mom_restart::only_read_restart_field_3d → mom_restart::find_var_in_restart_files
mom_restart::only_read_restart_field_4d → mom_restart::find_var_in_restart_files
mom_restart::only_read_restart_pair_3d → mom_restart::find_var_in_restart_files
- subroutine copy_restart_var_3d(var, name, CS, unrotate)
Copy the restart variable with the specified name into a 3-d array, perhaps after rotation
- Parameters
var [inout]
The field that is being copied [arbitrary]
name [in]
The name of the field that is being copied
CS [in]
MOM restart control struct
unrotate [in]
If present and true, the output is on an unrotated grid.
size_msg
The array sizes
Callees call graph
Text view
mom_restart::copy_restart_var_3d → mom_array_transform::interface::rotate_array
mom_restart::copy_restart_var_3d → mom_error_handler::mom_error
mom_restart::copy_restart_var_3d → mom_error_infra::is_root_pe
mom_restart::copy_restart_var_3d → mom_restart::restart_error
mom_restart::copy_restart_var_3d → mom_restart::size_mismatch_3d
- subroutine copy_restart_vector_3d(u_var, v_var, u_name, v_name, CS, unrotate, scalar_pair)
Copy the restart vector component variables with the specified names into a pair of 3-d arrays, perhaps after rotation
- Parameters
u_var [inout]
The u-component of the field that is being copied [arbitrary]
v_var [inout]
The u-component of the field that is being copied [arbitrary]
u_name [in]
The name of the u-component of the field that is being copied
v_name [in]
The name of the v-component of the field that is being copied
CS [in]
MOM restart control struct
unrotate [in]
If present and true, the output is on an unrotated grid.
scalar_pair [in]
If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
size_msg
The array sizes
Callees call graph
Text view
mom_restart::copy_restart_vector_3d → mom_array_transform::interface::rotate_array_pair
mom_restart::copy_restart_vector_3d → mom_array_transform::interface::rotate_vector
mom_restart::copy_restart_vector_3d → mom_error_handler::mom_error
mom_restart::copy_restart_vector_3d → mom_error_infra::is_root_pe
mom_restart::copy_restart_vector_3d → mom_restart::restart_error
mom_restart::copy_restart_vector_3d → mom_restart::size_mismatch_3d
- logical function size_mismatch_3d(var_a, var_b, turns, size_msg)
Indicate if two 3-d arrays are not of the same size after rotation is considered.
- Parameters
var_a [in]
The first field being compared
var_b [in]
The second field being compared
turns [in]
Number of quarter turns from input to model domain
size_msg [out]
The array sizes
Callers call graph
- subroutine save_restart(directory, time, G, CS, time_stamped, filename, GV, num_rest_files, write_IC)
save_restart saves all registered variables to restart files.
- Parameters
directory [in]
The directory where the restart files are to be written
time [in]
The current model time
G [inout]
The ocean's grid structure as seen from the driver.
CS [inout]
MOM restart control struct
time_stamped [in]
If present and true, add time-stamp to the restart file names
filename [in]
A filename that overrides the name in CS%restartfile
GV [in]
The ocean's vertical grid structure
num_rest_files [out]
number of restart files written
write_IC [in]
If present and true, initial conditions are being written
Callees call graph
Text view
mom_restart::save_restart → mom_checksums::interface::field_checksum
mom_restart::save_restart → mom_error_handler::mom_get_verbosity
mom_restart::save_restart → mom_io::insert_ensemble_appendix
mom_restart::save_restart → mom_io::interface::mom_write_field
mom_restart::save_restart → mom_restart::get_checksum_loop_ranges
mom_restart::save_restart → mom_restart::get_variable_byte_size
Callers call graph
External calls
- time_manager_mod
days_in_month (time_manager_mod::days_in_month)
get_date (time_manager_mod::get_date)
set_date (time_manager_mod::set_date)
time_type_to_real (time_manager_mod::time_type_to_real)
- subroutine restore_state(filename, directory, day, G, CS)
restore_state reads the model state from previously generated files. All restart variables are read from the first file in the input filename list in which they are found.
- Parameters
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to find restart files
day [out]
The time of the restarted run
G [in]
The ocean's grid structure
CS [inout]
MOM restart control struct
Callees call graph
Text view
mom_restart::restore_state → mom_checksums::interface::field_checksum
mom_restart::restore_state → mom_io::interface::mom_read_data
mom_restart::restore_state → mom_restart::get_checksum_loop_ranges
mom_restart::restore_state → mom_restart::open_restart_units
mom_restart::restore_state → mom_string_functions::lowercase
- function restart_files_exist(filename, directory, G, CS)
restart_files_exist determines whether any restart files exist.
- Parameters
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to find restart files
G [in]
The ocean's grid structure
CS [in]
MOM restart control struct
restart_files_exist
The function result, which indicates whether any of the explicitly or automatically named restart files exist in directory
Callees call graph
- function determine_is_new_run(filename, directory, G, CS) result(is_new_run)
determine_is_new_run determines from the value of filename and the existence automatically named restart files in directory whether this would be a new, and as a side effect stores this information in CS.
- Parameters
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to find restart files
G [in]
The ocean's grid structure
CS [inout]
MOM restart control struct
is_new_run
The function result, which indicates whether this is a new run, based on the value of filename and whether restart files exist
Callees call graph
- function is_new_run(CS)
is_new_run returns whether this is going to be a new run based on the information stored in CS by a previous call to determine_is_new_run.
- Parameters
CS [in]
MOM restart control struct
is_new_run
The function result, which had been stored in CS during a previous call to determine_is_new_run
Callers call graph
Text view
- function open_restart_units(filename, directory, G, CS, IO_handles, file_paths, global_files) result(num_files)
open_restart_units determines the number of existing restart files and optionally opens them and returns unit ids, paths and whether the files are global or spatially decomposed.
- Parameters
filename [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to find restart files
G [in]
The ocean's grid structure
CS [in]
MOM restart control struct
IO_handles [out]
The I/O handles of all opened files
file_paths [out]
The full paths to open files
global_files [out]
True if a file is global
num_files
The number of files (both automatically named restart files and others explicitly in filename) that have been opened.
Callees call graph
- function get_num_restart_files(filenames, directory, G, CS, file_paths) result(num_files)
get_num_restart_files returns the number of existing restart files that match the provided directory structure and other information stored in the control structure and optionally also provides the full paths to these files.
- Parameters
filenames [in]
The list of restart file names or a single character 'r' to read automatically named files
directory [in]
The directory in which to find restart files
G [in]
The ocean's grid structure
CS [in]
MOM restart control struct
file_paths [out]
The full paths to the restart files.
num_files
The function result, the number of files (both automatically named restart files and others explicitly in filename) that have been opened
Callees call graph
- subroutine restart_init(param_file, CS, restart_root)
Initialize this module and set up a restart control structure.
- Parameters
param_file [in]
A structure to parse for run-time parameters
CS
A pointer to a MOM_restart_CS object that is allocated here
restart_root [in]
A filename root that overrides the value set by RESTARTFILE to enable the use of this module by other components than MOM.
Callees call graph
- subroutine lock_check(CS, var_desc, name)
Issue an error message if the restart_registry is locked.
- Parameters
CS [in]
A MOM_restart_CS object (intent in)
var_desc [in]
A structure with metadata about this variable
name [in]
variable name to be used in the restart file
Callees call graph
Callers call graph
Text view
mom_restart::register_restart_field_0d → mom_restart::lock_check
mom_restart::register_restart_field_1d → mom_restart::lock_check
mom_restart::register_restart_field_2d → mom_restart::lock_check
mom_restart::register_restart_field_3d → mom_restart::lock_check
mom_restart::register_restart_field_4d → mom_restart::lock_check
mom_restart::register_restart_field_ptr0d → mom_restart::lock_check
mom_restart::register_restart_field_ptr1d → mom_restart::lock_check
mom_restart::register_restart_field_ptr2d → mom_restart::lock_check
mom_restart::register_restart_field_ptr3d → mom_restart::lock_check
mom_restart::register_restart_field_ptr4d → mom_restart::lock_check
mom_restart::register_restart_pair_ptr2d → mom_restart::lock_check
mom_restart::register_restart_pair_ptr3d → mom_restart::lock_check
mom_restart::register_restart_pair_ptr4d → mom_restart::lock_check
- subroutine restart_registry_lock(CS, unlocked)
Lock the restart registry so that an error is issued if any further restart variables are registered.
- Parameters
CS [inout]
A MOM_restart_CS object (intent inout)
unlocked [in]
If present and true, unlock the registry
- subroutine restart_init_end(CS)
Indicate that all variables have now been registered and lock the registry.
- Parameters
CS
A pointer to a MOM_restart_CS object
Callers call graph
- subroutine restart_end(CS)
Deallocate memory associated with a MOM_restart_CS variable.
- Parameters
CS
A pointer to a MOM_restart_CS object
subroutine restart_error(CS)
- Parameters
CS [in]
MOM restart control struct
Callers call graph
Text view
mom_restart::copy_restart_var_3d → mom_restart::restart_error
mom_restart::copy_restart_vector_3d → mom_restart::restart_error
mom_restart::query_initialized_0d → mom_restart::restart_error
mom_restart::query_initialized_0d_name → mom_restart::restart_error
mom_restart::query_initialized_1d → mom_restart::restart_error
mom_restart::query_initialized_1d_name → mom_restart::restart_error
mom_restart::query_initialized_2d → mom_restart::restart_error
mom_restart::query_initialized_2d_name → mom_restart::restart_error
mom_restart::query_initialized_3d → mom_restart::restart_error
mom_restart::query_initialized_3d_name → mom_restart::restart_error
mom_restart::query_initialized_4d → mom_restart::restart_error
mom_restart::query_initialized_4d_name → mom_restart::restart_error
mom_restart::query_initialized_name → mom_restart::restart_error
- subroutine get_checksum_loop_ranges(G, CS, pos, isL, ieL, jsL, jeL)
Return bounds for computing checksums to store in restart files
- Parameters
G [in]
The ocean's grid structure
CS [in]
MOM restart control structure
pos [in]
A coded integer indicating the horizontal staggering of a variable
isL [out]
i-start for checksum
ieL [out]
i-end for checksum
jsL [out]
j-start for checksum
jeL [out]
j-end for checksum
Callers call graph
- function get_variable_byte_size(pos, z_grid, t_grid, G, num_z) result(var_sz)
get the size of a variable in bytes
- Parameters
pos [in]
An integer indicating the horizontal staggering position
z_grid [in]
The vertical grid string to interpret
t_grid [in]
A time string to interpret
G [in]
The ocean's grid structure
num_z [in]
The number of vertical layers in the grid
var_sz
The function result, the size in bytes of a variable