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
dsalready contains apressurefield (as p-star initial conditions do), it is returned unchanged. Otherwise, the pressure is computed fromlayerThickness, the tracers and the surface pressure (SurfacePressureif 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:
ds (xarray.Dataset) – A dataset with either
pressureorlayerThickness,temperatureandsalinity.config (polaris.config.PolarisConfigParser) – Configuration options with parameters defining the equation of state.
logger (logging.Logger, optional) – A logger for logging EOS iteration information.
- Returns:
xarray.DataArray – The gauge pressure at layer midpoints (Pa).