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
PseudoThicknesswhen it is present, which needs no iteration. Otherwise, it is found iteratively from the geometriclayerThickness.The tracers must be in the convention of the equation of state, so open the dataset without a
tracer_conventionif it came from Omega.- Parameters:
ds (xarray.Dataset) – An ocean dataset with MPAS-Ocean names, containing
temperature,salinity,SurfacePressureand eitherPseudoThicknessorlayerThicknessconfig (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