polaris.tasks.ocean.horiz_press_grad.reference.Reference
- class polaris.tasks.ocean.horiz_press_grad.reference.Reference(component, indir)[source]
A step for creating a high-fidelity reference solution for two column test cases.
The reference solution is computed by first converting from the Omega pseudo-height coordinate \(\tilde z\) (
z_tilde) to true geometric heightzby numerically integrating the hydrostatic relation:\[\frac{\partial z}{\partial \tilde z} = \rho_0\,\nu\left(S_A, \Theta, p\right)\]where \(\nu\) is the specific volume (
spec_vol) computed from the TEOS-10 equation of state, \(S_A\) is Absolute Salinity, \(\Theta\) is Conservative Temperature, \(p\) is sea pressure (positive downward), and \(\rho_0\) is a reference density used in the definition \(\tilde z = -p/(\rho_0 g)\). The conversion therefore requires an integral of the form:\[z(\tilde z) = z_b + \int_{\tilde z_b}^{\tilde z} \rho_0\,\nu\bigl(S_A(\tilde z'),\Theta(\tilde z'),p(\tilde z')\bigr)\; d\tilde z' ,\]with \(z_b = -\mathrm{bottom\_depth}\) at the pseudo-height
z_tilde_bat the seafloor, typically the minimum (most negative) value of the pseudo-height domain for a given water column.Then, the horizontal gradient is computed using a 4th-order finite-difference stencil at the center column (x=0) to obtain the high-fidelity reference solution for the hydrostatic pressure gradient error.
- __init__(component, indir)[source]
Create the step
- Parameters:
component (polaris.Component) – The component the step belongs to
indir (str) – The subdirectory that the task belongs to, that this step will go into a subdirectory of
Methods
__init__(component, indir)Create the 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_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.
check_properties()This method should be overridden to check properties of step outputs
constrain_resources(available_resources)Constrain
cpus_per_taskandntasksbased on the number of cores available to this stepmap_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)
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)
open_model_dataset(filename, **kwargs)Open the given dataset, mapping variable and dimension names from Omega to MPAS-Ocean names if appropriate
process_inputs_and_outputs()Process the inputs to and outputs from a step added with
polaris.Step.add_input_file()andpolaris.Step.add_output_file().run()Run this step of the test case
runtime_setup()Update attributes of the step at runtime before calling the
run()method.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()Set up the task in the work directory, including downloading any dependencies.
validate_baselines()Compare variables between output files in this step and in the same step from a baseline run if one was provided.
write_model_dataset(ds, filename)Write out the given dataset, mapping dimension and variable names from MPAS-Ocean to Omega names if appropriate
Attributes
component