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 linear and exponential stratifications prescribe a Beckmann and Haidvogel potential density, which has to be inverted for the tracers. For eos_type = linear the linear equation of state is inverted algebraically; for eos_type = teos-10 the tracers are conservative temperature and absolute salinity, and the inversion is through polaris.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_pressure stratification prescribes temperature as a function of pressure instead and is handled by compute_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_pressure stratification.

  • layer_thickness (xarray.DataArray, optional) – The geometric thickness (m) of each layer. Required by the linear_pressure stratification 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_pressure 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.