polaris.ocean.init_state.pressure_for_tracer_conversion

polaris.ocean.init_state.pressure_for_tracer_conversion(ds: Dataset, config: PolarisConfigParser, logger: Logger | None = None) DataArray[source]

Get the sea (gauge) pressure at layer midpoints used to convert tracers between the TEOS-10 and MPAS-Ocean conventions.

If ds already contains a pressure field (as p-star initial conditions do), it is returned unchanged. Otherwise, the pressure is computed from layerThickness, the tracers and the surface pressure (SurfacePressure if present and zero if not).

Since the pressure only enters the conversion through the absolute- to-practical salinity correction, it does not need to be particularly accurate; see polaris.ocean.eos.convert_tracers().

Parameters:
Returns:

xarray.DataArray – The gauge pressure at layer midpoints (Pa).