polaris.ocean.vertical.diagnostics.get_z_mid_and_interface
- polaris.ocean.vertical.diagnostics.get_z_mid_and_interface(ds, allow_reconstruct=False)[source]
Get the elevation of layer midpoints and of layer interfaces
What the model wrote is preferred. Reconstructing them from
layerThicknessis available but off by default, because it is not always valid: the monthly mean of geometric thickness cannot be derived from the monthly means of pseudo-thickness and specific volume, so analysis of monthly means has to read what the model wrote or refuse.- Parameters:
ds (xarray.Dataset) – A data set holding the vertical geometry, with MPAS-Ocean names
allow_reconstruct (bool, optional) – Whether to reconstruct the geometry from
layerThicknesswhen the data set does not carry it
- Returns:
z_mid (xarray.DataArray) – The elevation of layer midpoints, in m, positive up
z_interface (xarray.DataArray) – The elevation of layer interfaces, in m, positive up
- Raises:
ValueError – If the data set lacks the geometry and it may not be reconstructed