polaris.tasks.ocean.seamount.init_utils.compute_tracers_linear_in_pressure
- polaris.tasks.ocean.seamount.init_utils.compute_tracers_linear_in_pressure(config: PolarisConfigParser, layer_thickness: DataArray, surf_pressure: DataArray | float | None = None, logger: Logger | None = None) tuple[DataArray, DataArray][source]
Compute exact layer means of a temperature profile that is linear in pressure, with constant salinity.
The finite-volume horizontal pressure gradient reconstructs the tracers as polynomials in pressure and is exact when the continuous profile is linear in pressure, so this is the stratification on which its error vanishes. Two properties make that exactness usable:
The layer values are exact layer means rather than point samples. Both models carry a layer-mean tracer, and the mean is taken over the mass of the layer, which is the same as over its pressure range. For a profile linear in pressure that mean is the value at the arithmetic mid-pressure of the layer, which is exactly what
polaris.ocean.vertical.ztilde.pressure_from_geom_thickness()returns asp_mid, so no quadrature is needed.The profile is a fixed point, not a formula. Temperature is prescribed as a function of pressure, pressure follows from the geometric layer thicknesses through the specific volume, and the specific volume follows from the temperature. Iterating to round-off is what makes the profile linear in the pressure the model itself carries rather than in an approximation to it; a profile that is merely close would leave a residual pressure-gradient error and defeat the purpose of the configuration.
The prescribed temperature is the model’s own tracer under either equation of state – potential temperature for the linear one, conservative temperature for TEOS-10 – so unlike the Beckmann and Haidvogel stratifications there is nothing to invert. The two equations of state therefore span the same temperature range here but not the same density range.
- Parameters:
config (polaris.config.PolarisConfigParser) – Configuration with the
[seamount]and[ocean]equation of state options.layer_thickness (xarray.DataArray) – The geometric thickness (m) of each layer.
surf_pressure (xarray.DataArray or float, optional) – The sea-surface gauge pressure (Pa), zero if not given.
logger (logging.Logger, optional) – A logger for the fixed-point iteration.
- Returns:
temperature (xarray.DataArray) – Potential temperature for a linear equation of state, conservative temperature for TEOS-10 (degC).
salinity (xarray.DataArray) – Practical salinity for a linear equation of state, absolute salinity for TEOS-10.