polaris.ocean.convergence.forward.ConvergenceForward

class polaris.ocean.convergence.forward.ConvergenceForward(component, name, subdir, refinement_factor, mesh, init, package, yaml_filename='forward.yaml', options=None, graph_target=None, output_filename='output.nc', validate_vars=None, refinement='both')[source]

A step for performing forward ocean component runs as part of a spherical convergence test

Variables:
  • package (Package) – The package name or module object that contains the YAML file

  • yaml_filename (str) – A YAML file that is a Jinja2 template with model config options

  • refinement (str) – Refinement type. One of ‘space’, ‘time’ or ‘both’ indicating both space and time

  • refinement_factor (float) – Refinement factor use to scale space, time or both depending on refinement option

__init__(component, name, subdir, refinement_factor, mesh, init, package, yaml_filename='forward.yaml', options=None, graph_target=None, output_filename='output.nc', validate_vars=None, refinement='both')[source]

Create a new step

Parameters:
  • component (polaris.Component) – The component the step belongs to

  • name (str) – The name of the step

  • subdir (str) – The subdirectory for the step

  • refinement_factor (float) – Refinement factor use to scale space, time or both depending on refinement option

  • package (Package) – The package name or module object that contains the YAML file

  • yaml_filename (str, optional) – A YAML file that is a Jinja2 template with model config options

  • options (dict, optional) – A nested dictionary of options and value for each config_model to replace model config options with new values

  • graph_target (str, optional) – The graph file name (relative to the base work directory). If none, it will be created.

  • output_filename (str, optional) – The output file that will be written out at the end of the forward run

  • validate_vars (list of str, optional) – A list of variables to validate against a baseline if requested

  • refinement (str, optional) – Refinement type. One of ‘space’, ‘time’ or ‘both’ indicating both space and time

Methods

__init__(component, name, subdir, ...[, ...])

Create a new step

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_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 the output file that must be produced by this step and may be made available as an input to steps, perhaps in other tasks.

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_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.

compute_cell_count()

Compute the approximate number of cells in the mesh, used to constrain resources

constrain_resources(available_cores)

Update the number of MPI tasks to use based on the estimated mesh size

dynamic_model_config(at_setup)

Set the model time step from config options at setup and runtime

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.

partition([graph_file])

Partition the domain for the requested number of tasks

process_inputs_and_outputs()

Process the model as an input, then call the parent class' version

run()

Run the step.

runtime_setup()

Update PIO namelist options, make graph file, and partition graph file (if any of these are requested)

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()

Determine if we will make yaml files or namelists and streams files, then, determine the number of MPI tasks to use based on the estimated mesh size

update_namelist_pio()

Modify the namelist so the number of PIO tasks and the stride between them consistent with the number of nodes and cores (one PIO task per node).

validate_baselines()

Compare variables between output files in this step and in the same step from a baseline run if one was provided.