polaris.ocean.vertical.pstar.init_pstar_vertical_coord
- polaris.ocean.vertical.pstar.init_pstar_vertical_coord(config, ds)[source]
Create a p-star vertical coordinate based on the config options in the
vertical_gridsection and theBottomPressureandSurfacePressurevariables of the mesh dataset.RefPseudoThicknessis the pseudo-thickness each layer would have at zeroSurfacePressure; it is set by clipping the reference 1-D grid at the snappedBottomPressure / (rho0 * g).PseudoThicknessis then scaled fromRefPseudoThicknessby(BottomPressure - SurfacePressure) / BottomPressure, the p-star analogue of z-star’slayerThickness = restingThickness * (ssh + bottomDepth) / bottomDepth.The following new variables are added to
ds:minLevelCell— index of the topmost valid layer (1-based; always 1, since non-zero top levels are not supported)maxLevelCell— index of the bottommost valid layer (1-based)cellMask— boolean mask of valid layersRefPseudoThickness— reference pseudo-thickness (no Time dim)PseudoThickness— pseudo-thickness scaled by surface pressureZTildeInterface— pseudo-height at layer interfacesZTildeMid— pseudo-height at layer midpointsvertCoordMovementWeights— weights for coordinate movement (all 1)
BottomPressureindsis updated to the post-snap value.- Parameters:
config (polaris.config.PolarisConfigParser) – Configuration options with parameters used to construct the vertical grid.
ds (xarray.Dataset) – Dataset containing
BottomPressureandSurfacePressurevariables (both in Pa with dimensionnCells) used to construct the vertical coordinate. Also requiresnVertLevelsto be a dimension ofds.