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_grid section and the BottomPressure and SurfacePressure variables of the mesh dataset.

RefPseudoThickness is the pseudo-thickness each layer would have at zero SurfacePressure; it is set by clipping the reference 1-D grid at the snapped BottomPressure / (rho0 * g). PseudoThickness is then scaled from RefPseudoThickness by (BottomPressure - SurfacePressure) / BottomPressure, the p-star analogue of z-star’s layerThickness = 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 layers

  • RefPseudoThickness — reference pseudo-thickness (no Time dim)

  • PseudoThickness — pseudo-thickness scaled by surface pressure

  • ZTildeInterface — pseudo-height at layer interfaces

  • ZTildeMid — pseudo-height at layer midpoints

  • vertCoordMovementWeights — weights for coordinate movement (all 1)

BottomPressure in ds is 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 BottomPressure and SurfacePressure variables (both in Pa with dimension nCells) used to construct the vertical coordinate. Also requires nVertLevels to be a dimension of ds.