compass.ocean.tests.global_ocean.forward.ForwardStep¶
- class compass.ocean.tests.global_ocean.forward.ForwardStep(test_case, mesh, time_integrator, init=None, name='forward', subdir=None, ntasks=None, min_tasks=None, openmp_threads=None, get_dt_from_min_res=True, land_ice_flux_mode='pressure_only', add_metadata=True, **kwargs)[source]¶
A step for performing forward MPAS-Ocean runs as part of global ocean test cases.
- Variables:
mesh (compass.ocean.tests.global_ocean.mesh.Mesh) – The test case that produces the mesh for this run
init (compass.ocean.tests.global_ocean.init.Init) – The test case that produces the initial condition for this run
time_integrator ({'split_explicit_ab2', 'RK4'}) – The time integrator to use for the forward run
dynamic_ntasks (bool) – Whether the target and minimum number of MPI tasks (
ntasks
andmin_tasks
) are computed dynamically from the number of cells in the meshget_dt_from_min_res (bool) – Whether to automatically compute config_dt and config_btr_dt namelist options from the minimum resolution of the mesh
- __init__(test_case, mesh, time_integrator, init=None, name='forward', subdir=None, ntasks=None, min_tasks=None, openmp_threads=None, get_dt_from_min_res=True, land_ice_flux_mode='pressure_only', add_metadata=True, **kwargs)[source]¶
Create a new step
- Parameters:
test_case (compass.TestCase) – The test case this step belongs to
mesh (compass.ocean.tests.global_ocean.mesh.Mesh) – The test case that produces the mesh for this run
time_integrator ({'split_explicit_ab2', 'RK4'}) – The time integrator to use for the forward run
init (compass.ocean.tests.global_ocean.init.Init, optional) – The test case that produces the initial condition for this run
name (str, optional) – the name of the step
subdir (str, optional) – the subdirectory for the step. The default is
name
ntasks (int, optional) – the number of tasks the step would ideally use. If fewer tasks are available on the system, the step will run on all available tasks as long as this is not below
min_tasks
min_tasks (int, optional) – the number of tasks the step requires. If the system has fewer than this number of tasks, the step will fail
openmp_threads (int, optional) – the number of OpenMP threads the step will use
get_dt_from_min_res (bool, optional) – Whether to automatically compute
config_dt
andconfig_btr_dt
namelist options from the minimum resolution of the meshland_ice_flux_mode ({'pressure_only', 'standalone', 'data'}, optional) – Whether to have no ice-shelf melt fluxes (“pressure_only”), prognostic melt (“standalone”) or data melt from a satellite-derived climatology (“data”).
add_metadata (bool, optional) – Whether to add mesh and initial-condition metadata to output files (assuming the
add_metadata
config option is also set to True). This should be set toFalse
for regression tests where the metadata is unlikely to be used.
Methods
__init__
(test_case, mesh, time_integrator[, ...])Create a new step
add_input_file
([filename, target, database, ...])Add an input file to the step (but not necessarily to the MPAS model).
add_model_as_input
()make a link to the model executable and add it to the inputs
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_namelist_options
(options[, out_name, mode])Add the namelist replacements to be parsed when generating a namelist file if and when the step gets set up.
add_output_file
(filename)Add the output file that must be produced by this step and may be made available as an input to steps, perhaps in other test cases.
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.
constrain_resources
(available_resources)Update resources at runtime from config options
process_inputs_and_outputs
()Process the inputs to and outputs from a step added with
compass.Step.add_input_file()
andcompass.Step.add_output_file()
.run
()Run this step of the testcase
runtime_setup
()Update the time step based on config options that a user might have changed
set_resources
([cpus_per_task, ...])Update the resources for the subtask.
setup
()Set the number of MPI tasks and the time step based on config options
update_namelist_at_runtime
(options[, out_name])Update an existing namelist file with additional options.
update_namelist_pio
([out_name])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).
update_streams_at_runtime
(package, streams, ...)Update the streams files during the run phase of this step using the given template and replacements.