polaris.tasks.ocean.realistic_global.restart.restart_step.RestartStep
- class polaris.tasks.ocean.realistic_global.restart.restart_step.RestartStep(component, name: str, subdir: str, init_condition: InitialCondition, run_duration: str, output_interval: str, restart_time: str, restart_from: RestartStep | None = None)[source]
One forward run of the realistic global restart task, shaped like CIME’s ERS test: the full run, or the restart run that continues from it.
The full run covers the whole period and writes a restart at
restart_time, along with its history up to that time in a file of its own. The restart run continues from that restart to the end of the period, appending its history to a copy of that file. Each step writes its restarts into a directory of its own under arestartsdirectory shared by the whole task.The run itself is a realistic_global forward run like any other, built from the
[realistic_global_forward]config options. Only the run duration, the output interval and the restart are the task’s own, and this task’sfull_run.yamlorrestart_run.yamladds Omega’s start type, start time and restart and history streams on top.- Variables:
run_duration (str) – How long this step runs, as an MPAS-style duration string
output_interval (str) – The interval between history frames
restart_time (str) – How far into the period the full run writes the restart the restart run continues from, as an MPAS-style duration string
restart_from (RestartStep or None) – The full run this step continues from, or
Nonefor the full run
- __init__(component, name: str, subdir: str, init_condition: InitialCondition, run_duration: str, output_interval: str, restart_time: str, restart_from: RestartStep | None = None)[source]
Create the step
- Parameters:
component (polaris.tasks.ocean.Ocean) – The ocean component that this step belongs to
name (str) – The name of the step
subdir (str) – The subdirectory for the step
init_condition (polaris.tasks.ocean.realistic_global.forward.InitialCondition) – The source of the model input files
run_duration (str) – How long this step runs, as an MPAS-style duration string
output_interval (str) – The interval between history frames
restart_time (str) – How far into the period the full run writes the restart the restart run continues from
restart_from (RestartStep, optional) – The full run this step continues from. When given, this step reads that run’s restart at
restart_timeand appends to its history up to that time.
Methods
__init__(component, name, subdir, ...[, ...])Create the step
add_cf_check([filename])Check an output file for CF compliance after the step runs.
add_dependency(step[, name])Add step as a dependency of this step (i.e. this step can't run until the dependency has finished).
add_forcing_input_file(**kwargs)Add the surface-forcing input file using a placeholder that is resolved to the configured filename at
process_inputs_and_outputs()time.add_horiz_mesh_input_file(**kwargs)Add the horizontal-mesh input file using a placeholder that is resolved to the configured filename at
process_inputs_and_outputs()time.add_init_input_file(**kwargs)Add the initial-condition input file using a placeholder that is resolved to the configured filename at
process_inputs_and_outputs()time.add_input_file([filename, target, database, ...])Add an input file to the step (but not necessarily to the MPAS model).
add_model_config_options(options[, config_model])Add the replacement model config options to be parsed when generating a namelist or yaml file if and when the step gets set up.
add_namelist_file(package, namelist)Add a file with updates to namelist options to the step to be parsed when generating a complete namelist file if and when the step gets set up.
add_output_file(filename[, validate_vars, ...])Add an output file, optionally resolving
validate_classto a pre-defined list of variables from the Ocean component.add_property_check(filename, check_properties)Add a single conservation comparison for an output file
add_streams_file(package, streams[, ...])Add a streams file to the step to be parsed when generating a complete streams file if and when the step gets set up.
add_vert_coord_input_file([filename])Add the vertical-coordinate input file.
add_yaml_file(package, yaml[, ...])Add a file with updates to yaml config options to the step to be parsed when generating a complete yaml file if and when the step gets set up.
check_cf()Check every file Omega wrote for CF compliance: the first file of each write stream in the step's
omega.yml, since the files of a stream share their metadata.check_properties()Check conservation properties of the output files of this step
compute_cell_count()Compute the number of cells used to size resources.
constrain_resources(available_cores)Update the number of MPI tasks to use based on the estimated mesh size
dynamic_model_config(at_setup)Build this step's stage from config with the task's run duration and output interval, then add this task's overrides for the full run or the restart run on top of the shared forward yaml, which
Forward.dynamic_model_config()adds firstget_forcing_filename()Get the configured local filename for the surface forcing file.
get_horiz_mesh_filename()Get the configured local filename for the horizontal mesh file.
get_init_filename()Get the configured local filename for the initial-condition file.
The stage from config with the task's run duration and output interval, rebuilt every time, as
Forwarddoes when it has no stage, so that a user's config changes after setup still take effectget_stats_filename()The global-statistics file this run writes, relative to the step's work directory.
get_vert_coord_filename()Get the configured local filename for the vertical coordinate file.
map_yaml_configs(configs, config_model)A mapping between model sections and config options from MPAS-Ocean to Omega
map_yaml_options(options, config_model)A mapping between model config options from MPAS-Ocean to Omega
map_yaml_streams(streams, config_model)A mapping between model streams from different models.
map_yaml_to_namelist(options)A mapping from yaml model config options to namelist options.
open_model_dataset(filename[, config, ...])Open the given dataset, mapping variable and dimension names from Omega to MPAS-Ocean names if appropriate
partition([graph_file])Partition the domain for the requested number of tasks
process_inputs_and_outputs()Process the model and any configured model-input placeholders.
restart_file()The full run's restart at the restart time, relative to this step's work directory, named the way Omega names it
restart_target(step_name)The path, relative to this step's work directory, of the directory the step
step_namewrites its restarts into.run()Run the step.
Make this step's restart directory, and seed the restart run's history file with the full run's history up to the restart
set_model_resources([ntasks, min_tasks, ...])Update the resources for the step.
set_resources([cpus_per_task, ...])Update the resources for the subtask.
set_shared_config(config[, link])Replace the step's config parser with the shared config parser
setup()Reject any model but Omega, declare the restart, then set up the forward run
update_io_tasks_config([config_model])Modify model config options so the number of IO tasks and the stride between them are consistent with how MPI tasks are distributed across nodes (one IO task per node).
update_namelist_eos()Modify the namelist to make it consistent with eos config options
update_namelist_pio([config_model])Deprecated alias for
update_io_tasks_config().validate_baselines()Compare variables between output files in this step and in the same step from a baseline run if one was provided.
work_path(*filenames)Get the absolute path to a file or directory in the step's work directory
Attributes
coresthe number of cores this step needs, in total
gpusthe number of GPUs this step needs, in total
may_span_nodeswhether this step's cores and GPUs may come from several nodes
min_coresthe number of cores this step needs in order to run at all
min_gpusthe number of GPUs this step requires, in total
componentconfiginput_datalogger