polaris.ocean.vertical.diagnostics.spec_vol_from_ds

polaris.ocean.vertical.diagnostics.spec_vol_from_ds(ds, config, logger=None)[source]

Compute specific volume from the temperature, salinity and pressure of an ocean state, for Omega output that does not include SpecVol.

The pressure comes from PseudoThickness when it is present, which needs no iteration. Otherwise, it is found iteratively from the geometric layerThickness.

The tracers must be in the convention of the equation of state, so open the dataset without a tracer_convention if it came from Omega.

Parameters:
  • ds (xarray.Dataset) – An ocean dataset with MPAS-Ocean names, containing temperature, salinity, SurfacePressure and either PseudoThickness or layerThickness

  • 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:

spec_vol (xarray.DataArray) – The specific volume at layer midpoints

Raises:

ValueError – If the variables needed to compute the specific volume are missing