ocean

Ocean()

The collection of all test case for the MPAS-Ocean core

Tasks

baroclinic_channel

add_baroclinic_channel_tasks(component)

Add tasks for different baroclinic channel tests to the ocean component

forward.Forward(component, resolution[, ...])

A step for performing forward ocean component runs as part of baroclinic channel tasks.

forward.Forward.compute_cell_count()

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

forward.Forward.dynamic_model_config(at_setup)

Add model config options, namelist, streams and yaml files using config options or template replacements that need to be set both during step setup and at runtime

init.Init(component, resolution, indir)

A step for creating a mesh and initial condition for baroclinic channel tasks

init.Init.setup()

Set up the task in the work directory, including downloading any dependencies.

init.Init.run()

Run this step of the task

validate.Validate(component, step_subdirs, indir)

A step for comparing outputs between steps in a baroclinic channel run

validate.Validate.run()

Compare temperature, salinity, layerThickness and normalVelocity in the outputs of two previous steps with each other

viz.Viz(component, indir)

A step for plotting the results of a series of baroclinic channel RPE runs

viz.Viz.run()

Run this step of the task

default.Default(component, resolution, ...)

The default baroclinic channel test case simply creates the mesh and initial condition, then performs a short forward run on 4 cores.

decomp.Decomp(component, resolution, indir, init)

A baroclinic channel decomposition task, which makes sure the model produces identical results on 1 and 4 cores.

restart.Restart(component, resolution, ...)

A baroclinic channel restart test case, which makes sure the model produces identical results with one longer run and two shorter runs with a restart in between.

restart.restart_step.RestartStep(component, ...)

A forward model step in the restart test case

restart.restart_step.RestartStep.dynamic_model_config(...)

Add model config options, namelist, streams and yaml files using config options or template replacements that need to be set both during step setup and at runtime

threads.Threads(component, resolution, ...)

A baroclinic channel thread test case, which makes sure the model produces identical results with 1 and 2 threads.

rpe.Rpe(component, resolution, indir, init, ...)

The baroclinic channel reference potential energy (RPE) test case performs a 20-day integration of the model forward in time at 5 different values of the viscosity at the given resolution.

rpe.Rpe.configure()

Modify the configuration options for this test case.

rpe.analysis.Analysis(component, indir, ...)

A step for plotting the results of a series of baroclinic channel RPE runs

rpe.analysis.Analysis.setup()

Set up the task in the work directory, including downloading any dependencies.

rpe.analysis.Analysis.run()

Run this step of the test case

barotropic_gyre

add_barotropic_gyre_tasks(component)

Add a task that defines a convergence test for inertial gravity waves

BarotropicGyre(component, test_name)

The convergence test case for inertial gravity waves

analysis.Analysis(component, indir[, ...])

A step for analysing the output from the barotropic gyre test case

analysis.Analysis.compute_error(ds_mesh, ...)

Compute the error for a given resolution

analysis.Analysis.exact_solution(ds_mesh, config)

Exact solution to the sea surface height for the linearized Munk layer experiments.

analysis.Analysis.run()

Run the step.

forward.compute_max_time_step(config)

Compute the approximate maximum time step for stability

forward.Forward(component[, name, subdir, ...])

A step for performing forward ocean component runs as part of barotropic gyre tasks.

forward.Forward.compute_cell_count()

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

forward.Forward.dynamic_model_config(at_setup)

Add model config options, namelist, streams and yaml files using config options or template replacements that need to be set both during step setup and at runtime

init.Init(component, subdir)

A step for creating a mesh and initial condition for baroclinic channel tasks

init.Init.setup()

Set up the task in the work directory, including downloading any dependencies.

init.Init.run()

Create the at rest inital condition for the barotropic gyre testcase

cosine_bell

add_cosine_bell_tasks(component)

Add tasks that define variants of the cosine bell test case

CosineBell(component, config, icosahedral, ...)

A convergence test for the advection of a cosine-bell tracer

CosineBell.configure()

Set config options for the test case

init.Init(component, name, subdir, base_mesh)

A step for an initial condition for for the cosine bell test case

init.Init.run()

Run this step of the task

init.cosine_bell(max_value, ri, r)

Compute values according to cosine bell function

forward.Forward(component, name, subdir, ...)

A step for performing forward ocean component runs as part of the cosine bell test case

forward.Forward.compute_cell_count()

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

forward.Forward.dynamic_model_config(at_setup)

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

analysis.Analysis(component, subdir, ...[, ...])

A step for analyzing the output from the cosine bell test case

analysis.Analysis.exact_solution(...[, zidx])

Get the exact solution

viz.Viz(component, name, subdir, base_mesh, ...)

A step for plotting fields from the cosine bell output

viz.Viz.run()

Run this step of the test case

geostrophic

add_geostrophic_tasks(component)

Add tasks that define variants of the geostrophic test

Geostrophic(component, config, icosahedral, ...)

A convergence test for a configuration in geostrophic balance

Geostrophic.configure()

Set config options for the test case

init.Init(component, name, subdir, base_mesh)

A step for an initial condition for for the geostrophic test case

init.Init.run()

Run this step of the testcase

forward.Forward(component, name, subdir, ...)

A step for performing forward ocean component runs as part of the cosine bell test case

analysis.Analysis(component, subdir, ...[, ...])

A step for analyzing the output from the geostrophic test case

analysis.Analysis.exact_solution(...[, zidx])

Get the exact solution

analysis.Analysis.get_output_field(...[, zidx])

Get the model output field at the given time and z index

viz.Viz(component, name, subdir, base_mesh, ...)

A step for plotting fields from the cosine bell output

viz.Viz.run()

Run this step of the test case

ice_shelf_2d

add_ice_shelf_2d_tasks(component)

Add tasks for different ice shelf 2-d tests to the ocean component

default.Default(component, resolution, ...)

The default ice shelf 2d test case simply creates the mesh and initial condition, then performs a short forward run.

forward.Forward(component, resolution, mesh, ...)

A step for performing forward ocean component runs as part of baroclinic channel tasks.

forward.Forward.compute_cell_count()

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

forward.Forward.dynamic_model_config(at_setup)

Add model config options, namelist, streams and yaml files using config options or template replacements that need to be set both during step setup and at runtime

init.Init(component, resolution, indir)

A step for creating a mesh and initial condition for ice shelf 2-d tasks

init.Init.run()

Run this step of the task

validate.Validate(component, step_subdirs, indir)

A step for comparing outputs between steps in a ice shelf 2d run

validate.Validate.run()

Compare temperature, salinity, layerThickness and normalVelocity in the outputs of two previous steps with each other

viz.Viz(component, indir, mesh, init)

A step for visualizing a cross-section and horizontal planes through the ice shelf

viz.Viz.run()

Run this step of the test case

inertial_gravity_wave

add_inertial_gravity_wave_tasks(component)

Add a task that defines a convergence test for inertial gravity waves

InertialGravityWave(component, config[, ...])

The convergence test case for inertial gravity waves

analysis.Analysis(component, subdir, ...[, ...])

A step for analysing the output from the inertial gravity wave test case

analysis.Analysis.exact_solution(...[, zidx])

Get the exact solution

exact_solution.ExactSolution(ds, config)

Class to compute the exact solution for the inertial gravity wave test case

exact_solution.ExactSolution.ssh(t)

Exact solution for sea surface height

exact_solution.ExactSolution.normal_velocity(t)

Exact solution for normal velocity

forward.Forward(component, name, ...[, ...])

A step for performing forward ocean component runs as part of inertial gravity wave test cases.

forward.Forward.compute_cell_count()

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

init.Init(component, resolution, subdir)

A step for creating a mesh and initial condition for the inertial gravity wave test cases

init.Init.run()

Run this step of the test case

viz.Viz(component, resolutions, taskdir)

A step for visualizing the output from the inertial gravity wave test case

viz.Viz.run()

Run this step of the test case

internal_wave

add_internal_wave_tasks(component)

Add tasks for different internal wave tests to the ocean component

forward.Forward(component, init[, name, ...])

A step for performing forward MPAS-Ocean runs as part of internal wave test cases.

forward.Forward.compute_cell_count()

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

forward.Forward.dynamic_model_config(at_setup)

Add model config options, namelist, streams and yaml files using config options or template replacements that need to be set both during step setup and at runtime

init.Init(component, indir)

A step for creating a mesh and initial condition for internal wave test cases

init.Init.run()

Run this step of the test case

viz.Viz(component, indir)

A step for visualizing a cross-section through the internal wave

viz.Viz.run()

Run this step of the test case

default.Default(component, indir, init[, ...])

The default test case for the internal wave test

rpe.Rpe(component, indir, init, config[, ...])

The internal wave reference potential energy (RPE) test case performs a 20-day integration of the model forward in time at 5 different values of the viscosity at the given resolution.

rpe.Rpe.configure()

Modify the configuration options for this test case.

rpe.analysis.Analysis(component, indir, nus)

A step for plotting the results of a series of internal wave RPE runs

rpe.analysis.Analysis.run()

Run this step of the test case

manufactured_solution

add_manufactured_solution_tasks(component)

Add a task that defines a convergence test that uses the method of manufactured solutions

ManufacturedSolution(component, config[, ...])

The convergence test case using the method of manufactured solutions

analysis.Analysis(component, subdir, ...[, ...])

A step for analysing the output from the manufactured solution test case

analysis.Analysis.exact_solution(...[, zidx])

Get the exact solution

exact_solution.ExactSolution(config[, ds])

Class to compute the exact solution for the manufactured solution test case

exact_solution.ExactSolution.ssh(t)

Exact solution for sea surface height

exact_solution.ExactSolution.normal_velocity(t)

Exact solution for normal velocity

forward.Forward(component, name, ...[, ...])

A step for performing forward ocean component runs as part of manufactured solution test cases.

forward.Forward.compute_cell_count()

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

init.Init(component, resolution, subdir)

A step for creating a mesh and initial condition for the manufactured solution test cases

init.Init.run()

Run this step of the test case

init.Init.setup()

If the ocean model is Omega, set up maps between Omega and MPAS-Ocean variable names

viz.Viz(component, dependencies, taskdir[, ...])

A step for visualizing the output from the manufactured solution test case

viz.Viz.run()

Run this step of the test case

single_column

add_single_column_tasks(component)

Add tasks for various single-column tests

forward.Forward(component[, name, subdir, ...])

A step for performing forward ocean component runs as part of baroclinic channel test cases.

init.Init(component, indir[, ideal_age])

A step for creating a mesh and initial condition for single column test cases

init.Init.run()

Run this step of the test case

viz.Viz(component, indir[, ideal_age])

A step for plotting the results of a single-column test

viz.Viz.run()

Run this step of the test case

cvmix.CVMix(component)

The CVMix single-column test case creates the mesh and initial condition, then performs a short forward run testing vertical mixing on 1 core.

ideal_age.IdealAge(component[, ideal_age])

The ideal-age single-column test case creates the mesh and initial condition, then performs a short forward run evolving the ideal-age tracer on 1 core.

sphere_transport

add_sphere_transport_tasks(component)

Add tasks that define variants of sphere transport test cases: nondivergent_2d, divergent_2d, correlated_tracers_2d, rotation_2d

SphereTransport(component, config, ...[, ...])

A test case for testing properties of tracer advection

SphereTransport.configure()

Set config options for the test case

init.Init(component, name, subdir, ...)

A step for an initial condition for for the cosine bell test case

init.Init.run()

Run this step of the task

forward.Forward(component, name, subdir, ...)

A step for performing forward ocean component runs as part of the sphere transport test case

analysis.Analysis(component, subdir, ...[, ...])

A step for analyzing the output from sphere transport test cases

analysis.Analysis.convergence_parameters([...])

Get convergence parameters

mixing_analysis.MixingAnalysis(component, ...)

A step for analyzing the output from sphere transport test cases

mixing_analysis.MixingAnalysis.run()

Run this step of the test case

filament_analysis.FilamentAnalysis(...[, ...])

A step for analyzing the output from sphere transport test cases

filament_analysis.FilamentAnalysis.run()

Run this step of the test case

viz.Viz(component, name, subdir, base_mesh, ...)

A step for plotting fields from the cosine bell output

viz.Viz.run()

Run this step of the test case

Ocean Framework

Convergence Tests

forward.ConvergenceForward(component, name, ...)

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

forward.ConvergenceForward.compute_cell_count()

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

forward.ConvergenceForward.dynamic_model_config(...)

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

analysis.ConvergenceAnalysis(component, ...)

A step for analyzing the output from convergence tests

analysis.ConvergenceAnalysis.compute_error(...)

Compute the error for a given resolution

analysis.ConvergenceAnalysis.convergence_parameters([...])

Get convergence parameters

analysis.ConvergenceAnalysis.exact_solution(...)

Get the exact solution

analysis.ConvergenceAnalysis.get_output_field(...)

Get the model output field at the given time and z index

analysis.ConvergenceAnalysis.plot_convergence(...)

Compute the error norm for each resolution and produce a convergence plot

analysis.ConvergenceAnalysis.run()

Run this step of the test case

analysis.ConvergenceAnalysis.setup()

Add input files based on resolutions, which may have been changed by user config options

Spherical Convergence Tests

SphericalConvergenceForward(component, name, ...)

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

SphericalConvergenceForward.compute_cell_count()

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

Ice Shelf

IceShelfTask(component, min_resolution, ...)

A class for tasks with domains containing ice shelves

IceShelfTask.setup_ssh_adjustment_steps(...)

Setup ssh_forward and ssh_adjustment steps for all iterations

SshAdjustment(component, mesh_filename, forward)

A step for iteratively adjusting the pressure from the weight of the ice shelf to match the sea-surface height as part of ice-shelf 2D test cases

SshAdjustment.run()

Adjust the sea surface height or land-ice pressure to be dynamically consistent with one another.

SshForward(component, min_resolution, ...[, ...])

A step for performing forward ocean component runs as part of ssh adjustment.

SshForward.compute_cell_count()

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

SshForward.dynamic_model_config(at_setup)

Add model config options, namelist, streams and yaml files using config options or template replacements that need to be set both during step setup and at runtime

Ocean Model

OceanIOStep(component, name, **kwargs)

A step that writes input and/or output files for Omega or MPAS-Ocean

OceanIOStep.setup()

If the ocean model is Omega, set up maps between Omega and MPAS-Ocean variable names

OceanIOStep.map_to_native_model_vars(ds)

If the model is Omega, rename dimensions and variables in a dataset from their MPAS-Ocean names to the Omega equivalent (appropriate for input datasets like an initial condition)

OceanIOStep.write_model_dataset(ds, filename)

Write out the given dataset, mapping dimension and variable names from MPAS-Ocean to Omega names if appropriate

OceanIOStep.map_from_native_model_vars(ds)

If the model is Omega, rename dimensions and variables in a dataset from their Omega names to the MPAS-Ocean equivalent (appropriate for datasets that are output from the model)

OceanIOStep.open_model_dataset(filename, ...)

Open the given dataset, mapping variable and dimension names from Omega to MPAS-Ocean names if appropriate

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

An Omega or MPAS-Ocean step

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

OceanModelStep.constrain_resources(...)

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

OceanModelStep.compute_cell_count()

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

OceanModelStep.map_yaml_options(options, ...)

A mapping between model config options from MPAS-Ocean to Omega

OceanModelStep.map_yaml_configs(configs, ...)

A mapping between model sections and config options from MPAS-Ocean to Omega

get_time_interval_string([days, seconds])

Convert a time interval in days and/or seconds to a string for use in a model config option.

Spherical Base Mesh Step

add_spherical_base_mesh_step(component, ...)

Add a shared step for creating spherical base mesh with the given resolution to the ocean component (if one has not already been added)

Reference Potential Energy (RPE)

rpe.compute_rpe(mesh_filename, ...)

Computes the reference (resting) potential energy for the whole domain

Vertical coordinates

vertical.init_vertical_coord(config, ds)

Create a vertical coordinate based on the config options in the vertical_grid section and the bottomDepth and ssh variables of the mesh data set.

vertical.grid_1d.generate_1d_grid(config)

Generate a vertical grid for a test case, using the config options in the vertical_grid section

vertical.grid_1d.write_1d_grid(interfaces, ...)

write the vertical grid to a file

vertical.partial_cells.alter_bottom_depth(...)

Alter bottomDepth and maxLevelCell for full or partial top cells, if requested

vertical.partial_cells.alter_ssh(config, ...)

Alter ssh and maxLevelCell for full or partial top cells, if requested

vertical.sigma.init_sigma_vertical_coord(...)

Create a sigma (terrain-following) vertical coordinate based on the config options in the vertical_grid` section and the bottomDepth and ssh variables of the mesh data set.

vertical.sigma.update_sigma_layer_thickness(...)

Update the sigma vertical coordinate layer thicknesses based on the bottomDepth and ssh variables of the mesh data set.

vertical.update_layer_thickness(config, ds)

Update the layer thicknesses in ds after the vertical coordinate has already been initialized based on the bottomDepth and ssh variables of the mesh data set.

vertical.zlevel.init_z_level_vertical_coord(...)

Create a z-level vertical coordinate based on the config options in the vertical_grid section and the bottomDepth and ssh variables of the mesh data set.

vertical.zlevel.update_z_level_layer_thickness(...)

Update the z-level vertical coordinate layer thicknesses based on the bottomDepth and ssh variables of the mesh data set.

vertical.zlevel.compute_min_max_level_cell(...)

Compute minLevelCell and maxLevelCell indices as well as a cell mask for the given reference grid and top and bottom topography.

vertical.zlevel.compute_z_level_layer_thickness(...)

Compute z-level layer thickness from ssh and bottomDepth

vertical.zlevel.compute_z_level_resting_thickness(...)

Compute z-level resting thickness by "unstretching" layerThickness based on ssh and bottomDepth

vertical.zstar.init_z_star_vertical_coord(...)

Create a z-star vertical coordinate based on the config options in the vertical_grid section and the bottomDepth and ssh variables of the mesh data set.

vertical.zstar.update_z_star_layer_thickness(...)

Update the z-star vertical coordinate layer thicknesses based on the bottomDepth and ssh variables of the mesh data set.

Visualization

compute_transect(x, y, ds_horiz_mesh, ...[, ...])

build a sequence of quads showing the transect intersecting mpas cells.

plot_transect(ds_transect[, mpas_field, ...])

plot a transect showing the field on the MPAS-Ocean mesh and save to a file

transect.horiz.find_spherical_transect_cells_and_weights(...)

Find "nodes" where the transect intersects the edges of the triangles that make up MPAS cells.

transect.horiz.find_planar_transect_cells_and_weights(...)

Find "nodes" where the transect intersects the edges of the triangles that make up MPAS cells.

transect.horiz.make_triangle_tree(ds_tris)

Make a KD-Tree for finding triangle edges that are near enough to transect segments that they might intersect

transect.horiz.mesh_to_triangles(ds_mesh)

Construct a dataset in which each MPAS cell is divided into the triangles connecting pairs of adjacent vertices to cell centers.

transect.vert.find_transect_levels_and_weights(...)

Construct a vertical coordinate for a transect produced by polaris.ocean.viz.transect.horiz.find_spherical_transect_cells_and_weights() or polaris.ocean.viz.transect.horiz.find_planar_transect_cells_and_weights().

transect.vert.interp_mpas_to_transect_cells(...)

Interpolate an MPAS-Ocean DataArray with dimensions nCells by nVertLevels to transect cells

transect.vert.interp_mpas_to_transect_nodes(...)

Interpolate an MPAS-Ocean DataArray with dimensions nCells by nVertLevels to transect nodes, linearly interpolating fields between the closest neighboring cells