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. |
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 |
Detailed Description
The MOM6 facility for reading and writing restart files, and querying what has been read.
Type Documentation
- type mom_restart/p4d
A type for making arrays of pointers to 4-d arrays.
- Type fields:
% p ::
real, dimension(:,:,:,:), pointer, privateA pointer to a 4d array in arbitrary rescaled units [A ~> a].
- type mom_restart/p3d
A type for making arrays of pointers to 3-d arrays.
- Type fields:
% p ::
real, dimension(:,:,:), pointer, privateA pointer to a 3d array in arbitrary rescaled units [A ~> a].
- type mom_restart/p2d
A type for making arrays of pointers to 2-d arrays.
- Type fields:
% p ::
real, dimension(:,:), pointer, privateA pointer to a 2d array in arbitrary rescaled units [A ~> a].
- type mom_restart/p1d
A type for making arrays of pointers to 1-d arrays.
- Type fields:
% p ::
real, dimension(:), pointer, privateA pointer to a 1d array in arbitrary rescaled units [A ~> a].
- type mom_restart/p0d
A type for making arrays of pointers to scalars.
- Type fields:
% p ::
real, pointer, privateA pointer to a scalar in arbitrary rescaled units [A ~> a].
- type mom_restart/field_restart
A structure with information about a single restart field.
- Type fields:
% vars ::
type(vardesc), privateDescription of a field that is to be read from or written to the restart file.% mand_var ::
logical, privateIf .true. the run will abort if this field is not successfully read from the restart file.% initialized ::
logical, private.true. if this field has been read from the restart file.% var_name ::
character(len=32), privateA name by which a variable may be queried.% conv ::
real, privateA 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 mom_restart/obsolete_restart
A structure to store information about restart fields that are no longer used.
- Type fields:
% field_name ::
character(len=32), privateName of restart field that is no longer in use.% replacement_name ::
character(len=32), privateName of replacement restart field, if applicable.
- type mom_restart/mom_restart_cs
A restart registry and the control structure for restarts.
- Type fields:
% var_ptr0d ::
type(p0d), dimension(:), pointerPointers to the fields that have been registered for restarts.% var_ptr1d ::
type(p1d), dimension(:), pointerPointers to the fields that have been registered for restarts.% var_ptr2d ::
type(p2d), dimension(:), pointerPointers to the fields that have been registered for restarts.% var_ptr3d ::
type(p3d), dimension(:), pointerPointers to the fields that have been registered for restarts.% var_ptr4d ::
type(p4d), dimension(:), pointerPointers to the fields that have been registered for restarts.% initialized ::
logicalTrue if this control structure has been initialized.% restart ::
logicalrestart is set to .true. if the run has been started from a full restart file. Otherwise some fields must be initialized approximately.% novars ::
integerThe number of restart fields that have been registered.% num_obsolete_vars ::
integerThe number of obsolete restart fields that have been registered.% parallel_restartfiles ::
logicalIf 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 ::
logicalIf true, the input filenames and restart file existence will result in a new run that is not initialized from restart files.% new_run_set ::
logicalIf true, new_run has been determined for this restart_CS.% checksum_required ::
logicalIf 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 ::
logicalIf 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 ::
logicalIf 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 ::
logicalIf true, the domain is reentrant in the x-direction. This is only used here to determine the extent of the restart checksums.% reentrant_y ::
logicalIf true, the domain is reentrant in the y-direction. This is only used here to determine the extent of the restart checksums.% restartfile ::
character(len=240)The name or name root for MOM restart files.% turns ::
integerNumber of quarter turns from input to model domain.% locked ::
logicalIf true this registry has been locked and no further restart fields can be added without explicitly unlocking the registry.% restart_field ::
type(field_restart), dimension(:), pointerAn array of descriptions of the registered fields.% restart_obsolete ::
type(obsolete_restart), dimension(:), pointerAn array of obsolete restart fields.% max_fields ::
integerThe maximum number of restart fields.
Function/Subroutine Documentation
- subroutine mom_restart/register_restart_field_as_obsolete(field_name, replacement_name, CS)
Register a restart field as obsolete.
- Parameters:
field_name ::
field_name[in] Name of restart field that is no longer in usereplacement_name ::
replacement_name[in] Name of replacement restart field, if applicablecs :: [inout] MOM restart control struct
- Called from:
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or writtenvar_desc ::
var_desc[in] A structure with metadata about this variablemandatory ::
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 ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
- Called from:
mom_restart::register_restart_field::register_restart_field_3d
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or writtenvar_desc ::
var_desc[in] A structure with metadata about this variablemandatory ::
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 ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
- Called from:
mom_restart::register_restart_field::register_restart_field_4d
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or writtenvar_desc ::
var_desc[in] A structure with metadata about this variablemandatory ::
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 ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
- Called from:
mom_restart::register_restart_field::register_restart_field_2d
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]var_desc ::
var_desc[in] A structure with metadata about this variablemandatory ::
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 ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
- Called from:
mom_restart::register_restart_field::register_restart_field_1d
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]var_desc ::
var_desc[in] A structure with metadata about this variablemandatory ::
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 ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.
- Called from:
mom_restart::register_restart_field::register_restart_field_0d
- subroutine mom_restart/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 ::
a_ptr[in] First field pointer in arbitrary rescaled units [A ~> a]b_ptr ::
b_ptr[in] Second field pointer in arbitrary rescaled units [A ~> a]a_desc ::
a_desc[in] First field descriptorb_desc ::
b_desc[in] Second field descriptormandatory ::
mandatory[in] If true, abort if field is missingcs :: [inout] MOM restart control structure
conversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.scalar_pair ::
scalar_pair[in] If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- subroutine mom_restart/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 ::
a_ptr[in] First field pointer in arbitrary rescaled units [A ~> a]b_ptr ::
b_ptr[in] Second field pointer in arbitrary rescaled units [A ~> a]a_desc ::
a_desc[in] First field descriptorb_desc ::
b_desc[in] Second field descriptormandatory ::
mandatory[in] If true, abort if field is missingcs :: [inout] MOM restart control structure
conversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.scalar_pair ::
scalar_pair[in] If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- subroutine mom_restart/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 ::
a_ptr[in] First field pointer in arbitrary rescaled units [A ~> a]b_ptr ::
b_ptr[in] Second field pointer in arbitrary rescaled units [A ~> a]a_desc ::
a_desc[in] First field descriptorb_desc ::
b_desc[in] Second field descriptormandatory ::
mandatory[in] If true, abort if field is missingcs :: [inout] MOM restart control structure
conversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.scalar_pair ::
scalar_pair[in] If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- subroutine mom_restart/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 ::
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 ::
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 ::
turns[in] Number of quarter turns from input to model domainconversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.scalar_pair ::
scalar_pair[in] If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- Called from:
mom_restart::register_restart_pair::register_restart_pair_ptr2dmom_restart::register_restart_pair::register_restart_pair_ptr3dmom_restart::register_restart_pair::register_restart_pair_ptr4d
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or writtenname ::
name[in] variable name to be used in the restart filemandatory ::
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 ::
longname[in] variable long nameunits ::
units[in] variable unitsconversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.hor_grid ::
hor_grid[in] variable horizontal staggering, ‘h’ if absentz_grid ::
z_grid[in] variable vertical staggering, ‘L’ if absentt_grid ::
t_grid[in] time description: s, p, or 1, ‘s’ if absentextra_axes ::
extra_axes[in] dimensions other than space-time
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or writtenname ::
name[in] variable name to be used in the restart filemandatory ::
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 ::
longname[in] variable long nameunits ::
units[in] variable unitsconversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.hor_grid ::
hor_grid[in] variable horizontal staggering, ‘h’ if absentz_grid ::
z_grid[in] variable vertical staggering, ‘L’ if absentt_grid ::
t_grid[in] time description: s, p, or 1, ‘s’ if absentextra_axes ::
extra_axes[in] dimensions other than space-time
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or writtenname ::
name[in] variable name to be used in the restart filemandatory ::
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 ::
longname[in] variable long nameunits ::
units[in] variable unitsconversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.hor_grid ::
hor_grid[in] variable horizontal staggering, ‘h’ if absentz_grid ::
z_grid[in] variable vertical staggering, ‘1’ if absentt_grid ::
t_grid[in] time description: s, p, or 1, ‘s’ if absent
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]name ::
name[in] variable name to be used in the restart filemandatory ::
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 ::
longname[in] variable long nameunits ::
units[in] variable unitsconversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.hor_grid ::
hor_grid[in] variable horizontal staggering, ‘1’ if absentz_grid ::
z_grid[in] variable vertical staggering, ‘L’ if absentt_grid ::
t_grid[in] time description: s, p, or 1, ‘s’ if absent
- subroutine mom_restart/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 ::
f_ptr[in] A pointer to the field to be read or written in arbitrary rescaled units [A ~> a]name ::
name[in] variable name to be used in the restart filemandatory ::
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 ::
longname[in] variable long nameunits ::
units[in] variable unitsconversion ::
conversion[in] A factor to multiply a restart field by before it is written [a A-1 ~> 1], 1 by default.t_grid ::
t_grid[in] time description: s, p, or 1, ‘s’ if absent
- function mom_restart/query_initialized_name(name, CS)
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 ::
name[in] The name of the field that is being queriedcs :: [in] MOM restart control struct
- Called from:
mom_restart::query_initialized::query_initialized_0d_namemom_restart::query_initialized::query_initialized_1d_namemom_restart::query_initialized::query_initialized_2d_namemom_restart::query_initialized::query_initialized_3d_namemom_restart::query_initialized::query_initialized_4d_name
- function mom_restart/query_initialized_0d(f_ptr, CS)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] A pointer to the field that is being queried [arbitrary]cs :: [in] MOM restart control struct
- function mom_restart/query_initialized_1d(f_ptr, CS)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] A pointer to the field that is being queried [arbitrary]cs :: [in] MOM restart control struct
- function mom_restart/query_initialized_2d(f_ptr, CS)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] A pointer to the field that is being queried [arbitrary]cs :: [in] MOM restart control struct
- function mom_restart/query_initialized_3d(f_ptr, CS)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] A pointer to the field that is being queried [arbitrary]cs :: [in] MOM restart control struct
- function mom_restart/query_initialized_4d(f_ptr, CS)
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] A pointer to the field that is being queried [arbitrary]cs :: [in] MOM restart control struct
- function mom_restart/query_initialized_0d_name(f_ptr, name, CS)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] The field that is being queried [arbitrary]name ::
name[in] The name of the field that is being queriedcs :: [in] MOM restart control struct
- function mom_restart/query_initialized_1d_name(f_ptr, name, CS)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] The field that is being queried [arbitrary]name ::
name[in] The name of the field that is being queriedcs :: [in] MOM restart control struct
- function mom_restart/query_initialized_2d_name(f_ptr, name, CS)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] The field that is being queried [arbitrary]name ::
name[in] The name of the field that is being queriedcs :: [in] MOM restart control struct
- function mom_restart/query_initialized_3d_name(f_ptr, name, CS)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] The field that is being queried [arbitrary]name ::
name[in] The name of the field that is being queriedcs :: [in] MOM restart control struct
- function mom_restart/query_initialized_4d_name(f_ptr, name, CS)
Indicate whether the field stored in f_ptr or with the specified variable name has been initialized from a restart file.
- Parameters:
f_ptr ::
f_ptr[in] The field that is being queried [arbitrary]name ::
name[in] The name of the field that is being queriedcs :: [in] MOM restart control struct
- subroutine mom_restart/set_initialized_name(name, CS)
set_initialized_name records that a named field has been initialized.
- Parameters:
name ::
name[in] The name of the field that is being setcs :: [inout] MOM restart control struct
- Called from:
mom_restart::set_initialized::set_initialized_0d_namemom_restart::set_initialized::set_initialized_1d_namemom_restart::set_initialized::set_initialized_2d_namemom_restart::set_initialized::set_initialized_3d_namemom_restart::set_initialized::set_initialized_4d_name
- subroutine mom_restart/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 ::
f_ptr[in] The variable that has been initialized [arbitrary]name ::
name[in] The name of the field that has been initializedcs :: [inout] MOM restart control struct
- subroutine mom_restart/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 ::
f_ptr[in] The array that has been initialized [arbitrary]name ::
name[in] The name of the field that has been initializedcs :: [inout] MOM restart control struct
- subroutine mom_restart/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 ::
f_ptr[in] The array that has been initialized [arbitrary]name ::
name[in] The name of the field that has been initializedcs :: [inout] MOM restart control struct
- subroutine mom_restart/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 ::
f_ptr[in] The array that has been initialized [arbitrary]name ::
name[in] The name of the field that has been initializedcs :: [inout] MOM restart control struct
- subroutine mom_restart/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 ::
f_ptr[in] The array that has been initialized [arbitrary]name ::
name[in] The name of the field that has been initializedcs :: [inout] MOM restart control struct
- subroutine mom_restart/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 ::
varname[in] The variable name to be used in the restart filef_ptr ::
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 ::
position[in] A coded integer indicating the horizontal position of this variablefilename ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to seek restart files.success ::
success[out] True if the field was read successfullyscale ::
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 mom_restart/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 ::
varname[in] The variable name to be used in the restart filef_ptr ::
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 ::
position[in] A coded integer indicating the horizontal position of this variablefilename ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to seek restart files.success ::
success[out] True if the field was read successfullyscale ::
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 mom_restart/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 ::
varname[in] The variable name to be used in the restart filef_ptr ::
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 ::
position[in] A coded integer indicating the horizontal position of this variablefilename ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to seek restart files.success ::
success[out] True if the field was read successfullyscale ::
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 mom_restart/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 ::
a_ptr[inout] The array for the first field to be read in arbitrary rescaled units [A ~> a]b_ptr ::
b_ptr[inout] The array for the second field to be read in arbitrary rescaled units [A ~> a]a_name ::
a_name[in] The first variable name to be used in the restart fileb_name ::
b_name[in] The second variable name to be used in the restart fileg :: [in] The ocean’s grid structure
cs :: [in] MOM restart control struct
stagger ::
stagger[in] A coded integer indicating the horizontal position of this pair of variablesfilename ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to seek restart files.success ::
success[out] True if the field was read successfullyscale ::
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 mom_restart/find_var_in_restart_files(varname, G, CS, file_path, filename, directory, is_global)
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 ::
varname[in] The variable name to be used in the restart fileg :: [in] The ocean’s grid structure
cs :: [in] MOM restart control struct
file_path ::
file_path[out] The full path to the file in which the variable is foundfilename ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to seek restart files.is_global ::
is_global[out] True if the file is global.
- Return:
undefined :: True if the named variable was found in the restart files.
- Call to:
- Called from:
mom_restart::only_read_from_restarts::only_read_restart_field_2dmom_restart::only_read_from_restarts::only_read_restart_field_3dmom_restart::only_read_from_restarts::only_read_restart_field_4dmom_restart::only_read_from_restarts::only_read_restart_pair_3d
- subroutine mom_restart/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 ::
var[inout] The field that is being copied [arbitrary]name ::
name[in] The name of the field that is being copiedcs :: [in] MOM restart control struct
unrotate ::
unrotate[in] If present and true, the output is on an unrotated grid.
- subroutine mom_restart/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 ::
u_var[inout] The u-component of the field that is being copied [arbitrary]v_var ::
v_var[inout] The u-component of the field that is being copied [arbitrary]u_name ::
u_name[in] The name of the u-component of the field that is being copiedv_name ::
v_name[in] The name of the v-component of the field that is being copiedcs :: [in] MOM restart control struct
unrotate ::
unrotate[in] If present and true, the output is on an unrotated grid.scalar_pair ::
scalar_pair[in] If true, the arrays describe a pair of scalars, instead of vector components whose signs change when rotated
- function mom_restart/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 ::
var_a[in] The first field being comparedvar_b ::
var_b[in] The second field being comparedturns ::
turns[in] Number of quarter turns from input to model domainsize_msg ::
size_msg[out] The array sizes
- Called from:
mom_restart::copy_restart_var::copy_restart_var_3dmom_restart::copy_restart_vector::copy_restart_vector_3d
- subroutine mom_restart/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 ::
directory[in] The directory where the restart files are to be writtentime ::
time[in] The current model timeg :: [inout] The ocean’s grid structure as seen from the driver.
cs :: [inout] MOM restart control struct
time_stamped ::
time_stamped[in] If present and true, add time-stamp to the restart file namesfilename ::
filename[in] A filename that overrides the name in CSrestartfilegv :: [in] The ocean’s vertical grid structure
num_rest_files ::
num_rest_files[out] number of restart files writtenwrite_ic :: [in] If present and true, initial conditions are being written
- Call to:
get_checksum_loop_rangesget_variable_byte_sizemom_error_handler::mom_errormom_error_handler::mom_get_verbositymom_error_handler::mom_mesgrestart_error- Called from:
mom_surface_forcing_gfdl::forcing_save_restartmom_surface_forcing::forcing_save_restartmom_oda_incupd::output_oda_incupd_inc
- subroutine mom_restart/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 ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to find restart filesday ::
day[out] The time of the restarted rung :: [in] The ocean’s grid structure
cs :: [inout] MOM restart control struct
- Call to:
get_checksum_loop_rangesmom_string_functions::lowercasemom_error_handler::mom_erroropen_restart_unitsrestart_error- Called from:
mom_ice_shelf::initialize_ice_shelfmom_surface_forcing::surface_forcing_initmom_surface_forcing_gfdl::surface_forcing_init
- function mom_restart/restart_files_exist(filename, directory, G, CS)
restart_files_exist determines whether any restart files exist.
- Parameters:
filename ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to find restart filesg :: [in] The ocean’s grid structure
cs :: [in] MOM restart control struct
- Return:
undefined :: The function result, which indicates whether any of the explicitly or automatically named restart files exist in directory
- Call to:
- function mom_restart/determine_is_new_run(filename, directory, G, CS)
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 ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to find restart filesg :: [in] The ocean’s grid structure
cs :: [inout] MOM restart control struct
- Return:
undefined :: The function result, which indicates whether this is a new run, based on the value of filename and whether restart files exist
- Call to:
get_num_restart_filesis_new_runmom_error_handler::mom_error- Called from:
- function mom_restart/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
- Return:
undefined :: The function result, which had been stored in CS during a previous call to determine_is_new_run
- Call to:
- Called from:
determine_is_new_runmom_dynamics_split_rk2::initialize_dyn_split_rk2mom_dynamics_split_rk2b::initialize_dyn_split_rk2bmom::initialize_mommom_stoch_eos::mom_stoch_eos_initmom_self_attr_load::sal_init
- function mom_restart/open_restart_units(filename, directory, G, CS, IO_handles, file_paths, global_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 ::
filename[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to find restart filesg :: [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 ::
file_paths[out] The full paths to open filesglobal_files ::
global_files[out] True if a file is global
- Return:
undefined :: The number of files (both automatically named restart files and others explicitly in filename) that have been opened.
- Call to:
- Called from:
find_var_in_restart_filesget_num_restart_filesrestore_state
- function mom_restart/get_num_restart_files(filenames, directory, G, CS, file_paths)
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 ::
filenames[in] The list of restart file names or a single character ‘r’ to read automatically named filesdirectory ::
directory[in] The directory in which to find restart filesg :: [in] The ocean’s grid structure
cs :: [in] MOM restart control struct
file_paths ::
file_paths[out] The full paths to the restart files.
- Return:
undefined :: The function result, the number of files (both automatically named restart files and others explicitly in filename) that have been opened
- Call to:
- Called from:
determine_is_new_runfind_var_in_restart_filesrestart_files_exist
- subroutine mom_restart/restart_init(param_file, CS, restart_root)
Initialize this module and set up a restart control structure.
- Parameters:
param_file ::
param_file[in] A structure to parse for run-time parameterscs :: A pointer to a MOM_restart_CS object that is allocated here
restart_root ::
restart_root[in] A filename root that overrides the value
- Call to:
- Called from:
mom_ice_shelf::initialize_ice_shelfmom::initialize_mommom_oda_incupd::output_oda_incupd_inc
- subroutine mom_restart/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 ::
var_desc[in] A structure with metadata about this variablename ::
name[in] variable name to be used in the restart file
- Call to:
- Called from:
mom_restart::register_restart_field::register_restart_field_0dmom_restart::register_restart_field::register_restart_field_1dmom_restart::register_restart_field::register_restart_field_2dmom_restart::register_restart_field::register_restart_field_3dmom_restart::register_restart_field::register_restart_field_4dmom_restart::register_restart_field::register_restart_field_ptr0dmom_restart::register_restart_field::register_restart_field_ptr1dmom_restart::register_restart_field::register_restart_field_ptr2dmom_restart::register_restart_field::register_restart_field_ptr3dmom_restart::register_restart_field::register_restart_field_ptr4dmom_restart::register_restart_pair::register_restart_pair_ptr2dmom_restart::register_restart_pair::register_restart_pair_ptr3dmom_restart::register_restart_pair::register_restart_pair_ptr4d
- subroutine mom_restart/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 ::
unlocked[in] If present and true, unlock the registry
- Called from:
- subroutine mom_restart/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
- Call to:
- Called from:
mom_surface_forcing::surface_forcing_initmom_surface_forcing_gfdl::surface_forcing_init
- subroutine mom_restart/restart_end(CS)
Deallocate memory associated with a MOM_restart_CS variable.
- Parameters:
cs :: A pointer to a MOM_restart_CS object
- Called from:
- subroutine mom_restart/restart_error(CS)
- Parameters:
cs :: [in] MOM restart control struct
- Call to:
- Called from:
mom_restart::copy_restart_var::copy_restart_var_3dmom_restart::copy_restart_vector::copy_restart_vector_3dmom_restart::query_initialized::query_initialized_0dmom_restart::query_initialized::query_initialized_0d_namemom_restart::query_initialized::query_initialized_1dmom_restart::query_initialized::query_initialized_1d_namemom_restart::query_initialized::query_initialized_2dmom_restart::query_initialized::query_initialized_2d_namemom_restart::query_initialized::query_initialized_3dmom_restart::query_initialized::query_initialized_3d_namemom_restart::query_initialized::query_initialized_4dmom_restart::query_initialized::query_initialized_4d_namemom_restart::query_initialized::query_initialized_namerestore_statesave_restart
- subroutine mom_restart/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 ::
pos[in] A coded integer indicating the horizontal staggering of a variableisl :: [out] i-start for checksum
iel :: [out] i-end for checksum
jsl :: [out] j-start for checksum
jel :: [out] j-end for checksum
- Call to:
- Called from:
- function mom_restart/get_variable_byte_size(pos, z_grid, t_grid, G, num_z)
get the size of a variable in bytes
- Parameters:
pos ::
pos[in] An integer indicating the horizontal staggering positionz_grid ::
z_grid[in] The vertical grid string to interprett_grid ::
t_grid[in] A time string to interpretg :: [in] The ocean’s grid structure
num_z ::
num_z[in] The number of vertical layers in the grid
- Return:
undefined :: The function result, the size in bytes of a variable
- Called from: