MOM6
|
The MOM6 facility for reading and writing restart files, and querying what has been read.
Data Types | |
type | field_restart |
A structure with information about a single restart field. More... | |
type | mom_restart_cs |
A restart registry and the control structure for restarts. More... | |
type | obsolete_restart |
A structure to store information about restart fields that are no longer used. More... | |
type | p0d |
A type for making arrays of pointers to scalars. More... | |
type | p1d |
A type for making arrays of pointers to 1-d arrays. More... | |
type | p2d |
A type for making arrays of pointers to 2-d arrays. More... | |
type | p3d |
A type for making arrays of pointers to 3-d arrays. More... | |
type | p4d |
A type for making arrays of pointers to 4-d arrays. More... | |
interface | query_initialized |
Indicate whether a field has been read from a restart file. More... | |
interface | register_restart_field |
Register fields for restarts. More... | |
Functions/Subroutines | |
subroutine, public | register_restart_field_as_obsolete (field_name, replacement_name, CS) |
subroutine | register_restart_field_ptr3d (f_ptr, var_desc, mandatory, CS) |
Register a 3-d field for restarts, providing the metadata in a structure. More... | |
subroutine | register_restart_field_ptr4d (f_ptr, var_desc, mandatory, CS) |
Register a 4-d field for restarts, providing the metadata in a structure. More... | |
subroutine | register_restart_field_ptr2d (f_ptr, var_desc, mandatory, CS) |
Register a 2-d field for restarts, providing the metadata in a structure. More... | |
subroutine | register_restart_field_ptr1d (f_ptr, var_desc, mandatory, CS) |
Register a 1-d field for restarts, providing the metadata in a structure. More... | |
subroutine | register_restart_field_ptr0d (f_ptr, var_desc, mandatory, CS) |
Register a 0-d field for restarts, providing the metadata in a structure. More... | |
subroutine | register_restart_field_4d (f_ptr, name, mandatory, CS, longname, units, hor_grid, z_grid, t_grid) |
Register a 4-d field for restarts, providing the metadata as individual arguments. More... | |
subroutine | register_restart_field_3d (f_ptr, name, mandatory, CS, longname, units, hor_grid, z_grid, t_grid) |
Register a 3-d field for restarts, providing the metadata as individual arguments. More... | |
subroutine | register_restart_field_2d (f_ptr, name, mandatory, CS, longname, units, hor_grid, z_grid, t_grid) |
Register a 2-d field for restarts, providing the metadata as individual arguments. More... | |
subroutine | register_restart_field_1d (f_ptr, name, mandatory, CS, longname, units, hor_grid, z_grid, t_grid) |
Register a 1-d field for restarts, providing the metadata as individual arguments. More... | |
subroutine | register_restart_field_0d (f_ptr, name, mandatory, CS, longname, units, t_grid) |
Register a 0-d field for restarts, providing the metadata as individual arguments. More... | |
logical function | query_initialized_name (name, CS) |
query_initialized_name determines whether a named field has been successfully read from a restart file yet. More... | |
logical function | query_initialized_0d (f_ptr, CS) |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More... | |
logical function | query_initialized_1d (f_ptr, CS) |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More... | |
logical function | query_initialized_2d (f_ptr, CS) |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More... | |
logical function | query_initialized_3d (f_ptr, CS) |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More... | |
logical function | query_initialized_4d (f_ptr, CS) |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file. More... | |
logical function | query_initialized_0d_name (f_ptr, name, CS) |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More... | |
logical function | query_initialized_1d_name (f_ptr, name, CS) |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More... | |
logical function | query_initialized_2d_name (f_ptr, name, CS) |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More... | |
logical function | query_initialized_3d_name (f_ptr, name, CS) |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More... | |
logical function | query_initialized_4d_name (f_ptr, name, CS) |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file. More... | |
subroutine, public | save_restart (directory, time, G, CS, time_stamped, filename, GV) |
save_restart saves all registered variables to restart files. More... | |
subroutine, public | 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. More... | |
logical function, public | restart_files_exist (filename, directory, G, CS) |
restart_files_exist determines whether any restart files exist. More... | |
logical function, public | 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. More... | |
logical function, public | 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. More... | |
integer function | open_restart_units (filename, directory, G, CS, units, 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. More... | |
subroutine, public | restart_init (param_file, CS, restart_root) |
Initialize this module and set up a restart control structure. More... | |
subroutine, public | restart_init_end (CS) |
Indicate that all variables have now been registered. More... | |
subroutine, public | restart_end (CS) |
Deallocate memory associated with a MOM_restart_CS variable. More... | |
subroutine | restart_error (CS) |
subroutine | get_checksum_loop_ranges (G, pos, isL, ieL, jsL, jeL) |
Return bounds for computing checksums to store in restart files. More... | |
logical function, public mom_restart::determine_is_new_run | ( | character(len=*), intent(in) | filename, |
character(len=*), intent(in) | directory, | ||
type(ocean_grid_type), intent(in) | G, | ||
type(mom_restart_cs), pointer | 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.
[in] | filename | The list of restart file names or a single character 'r' to read automatically named files. |
[in] | directory | The directory in which to find restart files |
[in] | g | The ocean's grid structure |
cs | The control structure returned by a previous call to restart_init. |
Definition at line 1235 of file MOM_restart.F90.
References is_new_run(), mom_error_handler::mom_error(), and open_restart_units().
Referenced by mom_state_initialization::mom_initialize_state().
|
private |
Return bounds for computing checksums to store in restart files.
[in] | g | The ocean's grid structure |
[in] | pos | An integer indicating staggering of variable |
[out] | isl | i-start for checksum |
[out] | iel | i-end for checksum |
[out] | jsl | j-start for checksum |
[out] | jel | j-end for checksum |
Definition at line 1519 of file MOM_restart.F90.
Referenced by restore_state(), and save_restart().
logical function, public mom_restart::is_new_run | ( | type(mom_restart_cs), pointer | 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.
cs | The control structure returned by a previous call to restart_init. |
Definition at line 1266 of file MOM_restart.F90.
References mom_error_handler::mom_error().
Referenced by determine_is_new_run(), mom_dynamics_split_rk2::initialize_dyn_split_rk2(), and mom::initialize_mom().
|
private |
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.
[in] | filename | The list of restart file names or a single character 'r' to read automatically named files. |
[in] | directory | The directory in which to find restart files |
[in] | g | The ocean's grid structure |
cs | The control structure returned by a previous call to restart_init. | |
[out] | units | The mpp units of all opened files. |
[out] | file_paths | The full paths to open files. |
[out] | global_files | True if a file is global. |
Definition at line 1284 of file MOM_restart.F90.
References mom_error_handler::is_root_pe(), and mom_error_handler::mom_error().
Referenced by determine_is_new_run(), restart_files_exist(), and restore_state().
|
private |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 464 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
[in] | name | The name of the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 603 of file MOM_restart.F90.
References mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), query_initialized_name(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 491 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
[in] | name | The name of the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 638 of file MOM_restart.F90.
References mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), query_initialized_name(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 518 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
[in] | name | The name of the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 674 of file MOM_restart.F90.
References mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), query_initialized_name(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 546 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
[in] | name | The name of the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 710 of file MOM_restart.F90.
References mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), query_initialized_name(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 574 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and restart_error().
|
private |
Indicate whether the field pointed to by f_ptr or with the specified variable name has been initialized from a restart file.
[in] | f_ptr | A pointer to the field that is being queried |
[in] | name | The name of the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 746 of file MOM_restart.F90.
References mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), query_initialized_name(), and restart_error().
|
private |
query_initialized_name determines whether a named field has been successfully read from a restart file yet.
[in] | name | The name of the field that is being queried |
cs | A pointer to a MOM_restart_CS object (intent in) |
Definition at line 430 of file MOM_restart.F90.
References mom_error_handler::is_root_pe(), mom_error_handler::mom_error(), and restart_error().
Referenced by query_initialized_0d_name(), query_initialized_1d_name(), query_initialized_2d_name(), query_initialized_3d_name(), and query_initialized_4d_name().
|
private |
Register a 0-d field for restarts, providing the metadata as individual arguments.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | name | variable name to be used in the restart file |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) | |
[in] | longname | variable long name |
[in] | units | variable units |
[in] | t_grid | time description: s, p, or 1, 's' if absent |
Definition at line 406 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and register_restart_field_ptr0d().
|
private |
Register a 1-d field for restarts, providing the metadata as individual arguments.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | name | variable name to be used in the restart file |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) | |
[in] | longname | variable long name |
[in] | units | variable units |
[in] | hor_grid | variable horizonal staggering, '1' if absent |
[in] | z_grid | variable vertical staggering, 'L' if absent |
[in] | t_grid | time description: s, p, or 1, 's' if absent |
Definition at line 378 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and register_restart_field_ptr1d().
|
private |
Register a 2-d field for restarts, providing the metadata as individual arguments.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | name | variable name to be used in the restart file |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) | |
[in] | longname | variable long name |
[in] | units | variable units |
[in] | hor_grid | variable horizonal staggering, 'h' if absent |
[in] | z_grid | variable vertical staggering, '1' if absent |
[in] | t_grid | time description: s, p, or 1, 's' if absent |
Definition at line 349 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and register_restart_field_ptr2d().
|
private |
Register a 3-d field for restarts, providing the metadata as individual arguments.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | name | variable name to be used in the restart file |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) | |
[in] | longname | variable long name |
[in] | units | variable units |
[in] | hor_grid | variable horizonal staggering, 'h' if absent |
[in] | z_grid | variable vertical staggering, 'L' if absent |
[in] | t_grid | time description: s, p, or 1, 's' if absent |
Definition at line 322 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and register_restart_field_ptr3d().
|
private |
Register a 4-d field for restarts, providing the metadata as individual arguments.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | name | variable name to be used in the restart file |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) | |
[in] | longname | variable long name |
[in] | units | variable units |
[in] | hor_grid | variable horizonal staggering, 'h' if absent |
[in] | z_grid | variable vertical staggering, 'L' if absent |
[in] | t_grid | time description: s, p, or 1, 's' if absent |
Definition at line 295 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and register_restart_field_ptr4d().
subroutine, public mom_restart::register_restart_field_as_obsolete | ( | character(*), intent(in) | field_name, |
character(*), intent(in) | replacement_name, | ||
type(mom_restart_cs), pointer | CS | ||
) |
[in] | field_name | Name of restart field that is no longer in use |
[in] | replacement_name | Name of replacement restart field, if applicable |
cs | A pointer to a MOM_restart_CS object (intent in/out) |
Definition at line 128 of file MOM_restart.F90.
Referenced by mom_set_visc::set_visc_init().
|
private |
Register a 0-d field for restarts, providing the metadata in a structure.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | var_desc | A structure with metadata about this variable |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) |
Definition at line 262 of file MOM_restart.F90.
References mom_error_handler::mom_error().
Referenced by register_restart_field_0d().
|
private |
Register a 1-d field for restarts, providing the metadata in a structure.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | var_desc | A structure with metadata about this variable |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) |
Definition at line 232 of file MOM_restart.F90.
References mom_error_handler::mom_error().
Referenced by register_restart_field_1d().
|
private |
Register a 2-d field for restarts, providing the metadata in a structure.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | var_desc | A structure with metadata about this variable |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) |
Definition at line 201 of file MOM_restart.F90.
References mom_error_handler::mom_error().
Referenced by register_restart_field_2d().
|
private |
Register a 3-d field for restarts, providing the metadata in a structure.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | var_desc | A structure with metadata about this variable |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) |
Definition at line 139 of file MOM_restart.F90.
References mom_error_handler::mom_error().
Referenced by register_restart_field_3d().
|
private |
Register a 4-d field for restarts, providing the metadata in a structure.
[in] | f_ptr | A pointer to the field to be read or written |
[in] | var_desc | A structure with metadata about this variable |
[in] | mandatory | If true, the run will abort if this field is not successfully read from the restart file. |
cs | A pointer to a MOM_restart_CS object (intent in/out) |
Definition at line 170 of file MOM_restart.F90.
References mom_error_handler::mom_error().
Referenced by register_restart_field_4d().
subroutine, public mom_restart::restart_end | ( | type(mom_restart_cs), pointer | CS | ) |
Deallocate memory associated with a MOM_restart_CS variable.
cs | A pointer to a MOM_restart_CS object |
Definition at line 1489 of file MOM_restart.F90.
Referenced by restart_init_end().
|
private |
cs | A pointer to a MOM_restart_CS object |
Definition at line 1503 of file MOM_restart.F90.
References mom_error_handler::mom_error().
Referenced by query_initialized_0d(), query_initialized_0d_name(), query_initialized_1d(), query_initialized_1d_name(), query_initialized_2d(), query_initialized_2d_name(), query_initialized_3d(), query_initialized_3d_name(), query_initialized_4d(), query_initialized_4d_name(), query_initialized_name(), restore_state(), and save_restart().
logical function, public mom_restart::restart_files_exist | ( | character(len=*), intent(in) | filename, |
character(len=*), intent(in) | directory, | ||
type(ocean_grid_type), intent(in) | G, | ||
type(mom_restart_cs), pointer | CS | ||
) |
restart_files_exist determines whether any restart files exist.
[in] | filename | The list of restart file names or a single character 'r' to read automatically named files. |
[in] | directory | The directory in which to find restart files |
[in] | g | The ocean's grid structure |
cs | The control structure returned by a previous call to restart_init. |
Definition at line 1208 of file MOM_restart.F90.
References mom_error_handler::mom_error(), and open_restart_units().
subroutine, public mom_restart::restart_init | ( | type(param_file_type), intent(in) | param_file, |
type(mom_restart_cs), pointer | CS, | ||
character(len=*), intent(in), optional | restart_root | ||
) |
Initialize this module and set up a restart control structure.
[in] | param_file | A structure to parse for run-time parameters |
cs | A pointer to a MOM_restart_CS object that is allocated here | |
[in] | restart_root | A filename root that overrides the value |
Definition at line 1421 of file MOM_restart.F90.
References mom_error_handler::mom_error().
Referenced by mom_ice_shelf::initialize_ice_shelf(), and mom::initialize_mom().
subroutine, public mom_restart::restart_init_end | ( | type(mom_restart_cs), pointer | CS | ) |
Indicate that all variables have now been registered.
cs | A pointer to a MOM_restart_CS object |
Definition at line 1479 of file MOM_restart.F90.
References restart_end().
Referenced by mom_surface_forcing_nuopc::surface_forcing_init(), mom_surface_forcing_mct::surface_forcing_init(), and mom_surface_forcing::surface_forcing_init().
subroutine, public mom_restart::restore_state | ( | character(len=*), intent(in) | filename, |
character(len=*), intent(in) | directory, | ||
type(time_type), intent(out) | day, | ||
type(ocean_grid_type), intent(in) | G, | ||
type(mom_restart_cs), pointer | 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.
[in] | filename | The list of restart file names or a single character 'r' to read automatically named files. |
[in] | directory | The directory in which to find restart files |
[out] | day | The time of the restarted run |
[in] | g | The ocean's grid structure |
cs | The control structure returned by a previous call to restart_init. |
Definition at line 984 of file MOM_restart.F90.
References get_checksum_loop_ranges(), mom_error_handler::is_root_pe(), mom_string_functions::lowercase(), mom_error_handler::mom_error(), open_restart_units(), and restart_error().
Referenced by mom_ice_shelf::initialize_ice_shelf(), mom_state_initialization::mom_initialize_state(), mom_surface_forcing_nuopc::surface_forcing_init(), mom_surface_forcing_mct::surface_forcing_init(), and mom_surface_forcing::surface_forcing_init().
subroutine, public mom_restart::save_restart | ( | character(len=*), intent(in) | directory, |
type(time_type), intent(in) | time, | ||
type(ocean_grid_type), intent(inout) | G, | ||
type(mom_restart_cs), pointer | CS, | ||
logical, intent(in), optional | time_stamped, | ||
character(len=*), intent(in), optional | filename, | ||
type(verticalgrid_type), intent(in), optional | GV | ||
) |
save_restart saves all registered variables to restart files.
[in] | directory | The directory where the restart files are to be written |
[in] | time | The current model time |
[in,out] | g | The ocean's grid structure |
cs | The control structure returned by a previous call to restart_init. | |
[in] | time_stamped | If present and true, add time-stamp to the restart file names. |
[in] | filename | A filename that overrides the name in CSrestartfile. |
[in] | gv | The ocean's vertical grid structure |
Definition at line 781 of file MOM_restart.F90.
References get_checksum_loop_ranges(), mom_error_handler::mom_error(), and restart_error().
Referenced by mom_surface_forcing_nuopc::forcing_save_restart(), mom_surface_forcing_mct::forcing_save_restart(), mom_surface_forcing::forcing_save_restart(), mom_main(), mom_ocean_model_nuopc::ocean_model_restart(), mom_ocean_model_mct::ocean_model_restart(), mom_ocean_model_nuopc::ocean_model_save_restart(), mom_ocean_model_mct::ocean_model_save_restart(), and ocn_comp_mct::ocn_run_mct().