polaris.tasks.ocean.seamount.init_utils.compute_tracers
- polaris.tasks.ocean.seamount.init_utils.compute_tracers(config: PolarisConfigParser, z_mid: DataArray, layer_thickness: DataArray | None = None, surf_pressure: DataArray | float | None = None, logger: Logger | None = None) tuple[DataArray, DataArray][source]
Compute the temperature and salinity for the configured stratification under the configured equation of state.
Salinity is constant, so all of the stratification is carried by temperature.
The
linearandexponentialstratifications prescribe a Beckmann and Haidvogel potential density, which has to be inverted for the tracers. Foreos_type = linearthe linear equation of state is inverted algebraically; foreos_type = teos-10the tracers are conservative temperature and absolute salinity, and the inversion is throughpolaris.ocean.eos.ct_from_potential_density(). Both branches reproduce the same potential density, so the two equations of state give the same buoyancy stratification and differ only in how density depends on pressure.The
linear_pressurestratification prescribes temperature as a function of pressure instead and is handled bycompute_tracers_linear_in_pressure(), which needs the column geometry rather than the layer midpoints.- Parameters:
config (polaris.config.PolarisConfigParser) – Configuration with the
[seamount]and[ocean]equation of state options.z_mid (xarray.DataArray) – The geometric height (m, negative down) of the layer midpoints. Unused by the
linear_pressurestratification.layer_thickness (xarray.DataArray, optional) – The geometric thickness (m) of each layer. Required by the
linear_pressurestratification and unused by the others.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
linear_pressurefixed-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.