namespace mom_restart

Overview

The MOM6 facility for reading and writing restart files, and querying what has been read. More…

namespace mom_restart {

// interfaces

interface query_initialized;
interface register_restart_field;

// global functions

subroutine, public register_restart_field_as_obsolete(
    field_name field_name,
    replacement_name replacement_name,
    CS CS
    );

subroutine, public save_restart(
    directory directory,
    time time,
    G G,
    CS CS,
    time_stamped time_stamped,
    filename filename,
    GV GV
    );

subroutine, public restore_state(filename filename, directory directory, day day, G G, CS CS);
logical function, public restart_files_exist(filename filename, directory directory, G G, CS CS);
logical function, public determine_is_new_run(filename filename, directory directory, G G, CS CS);
logical function, public is_new_run(CS CS);
subroutine, public restart_init(param_file param_file, CS CS, restart_root restart_root);
subroutine, public restart_init_end(CS CS);
subroutine, public restart_end(CS CS);

} // namespace mom_restart

Detailed Documentation

The MOM6 facility for reading and writing restart files, and querying what has been read.

Global Functions

subroutine, public register_restart_field_as_obsolete(
    field_name field_name,
    replacement_name replacement_name,
    CS CS
    )

Parameters:

field_name

Name of restart field that is no longer in use

replacement_name

Name of replacement restart field, if applicable

cs

A pointer to a MOM_restart_CS object (intent in/out)

subroutine, public save_restart(
    directory directory,
    time time,
    G G,
    CS CS,
    time_stamped time_stamped,
    filename filename,
    GV GV
    )

save_restart saves all registered variables to restart files.

Parameters:

directory

The directory where the restart files are to be written

time

The current model time

g

The ocean’s grid structure

cs

The control structure returned by a previous call to restart_init.

time_stamped

If present and true, add time-stamp to the restart file names.

filename

A filename that overrides the name in CSrestartfile.

gv

The ocean’s vertical grid structure

subroutine, public restore_state(
    filename filename,
    directory directory,
    day day,
    G G,
    CS 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

The list of restart file names or a single character ‘r’ to read automatically named files.

directory

The directory in which to find restart files

day

The time of the restarted run

g

The ocean’s grid structure

cs

The control structure returned by a previous call to restart_init.

logical function, public restart_files_exist(
    filename filename,
    directory directory,
    G G,
    CS CS
    )

restart_files_exist determines whether any restart files exist.

Parameters:

filename

The list of restart file names or a single character ‘r’ to read automatically named files.

directory

The directory in which to find restart files

g

The ocean’s grid structure

cs

The control structure returned by a previous call to restart_init.

Returns:

The function result, which indicates whether any of the explicitly or automatically named restart files exist in directory.

logical function, public determine_is_new_run(
    filename filename,
    directory directory,
    G G,
    CS 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

The list of restart file names or a single character ‘r’ to read automatically named files.

directory

The directory in which to find restart files

g

The ocean’s grid structure

cs

The control structure returned by a previous call to restart_init.

Returns:

The function result, which indicates whether this is a new run, based on the value of filename and whether restart files exist.

logical function, public is_new_run(CS 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

The control structure returned by a previous call to restart_init.

Returns:

The function result, which indicates whether this is a new run, based on the value of filename and whether restart files exist.

subroutine, public restart_init(
    param_file param_file,
    CS CS,
    restart_root restart_root
    )

Initialize this module and set up a restart control structure.

Parameters:

param_file

A structure to parse for run-time parameters

cs

A pointer to a MOM_restart_CS object that is allocated here

restart_root

A filename root that overrides the value

subroutine, public restart_init_end(CS CS)

Indicate that all variables have now been registered.

Parameters:

cs

A pointer to a MOM_restart_CS object

subroutine, public restart_end(CS CS)

Deallocate memory associated with a MOM_restart_CS variable.

Parameters:

cs

A pointer to a MOM_restart_CS object