xoa.sigma.ocean_s_coordinate_g2

xoa.sigma.ocean_s_coordinate_g2#

xoa.sigma.ocean_s_coordinate_g2(sig, ssh, bathy, hc, thetas=None, thetab=None, cs=None, cs_type=None, cache=None, dask='parallelized', ref='datum')[source]#

Convert from s [-1, 0] generic form 2 to z heights (positive up) in an ocean model

Note

This function is dask-aware since it delegates the core computation to xarray.apply_ufunc().

Source:

Ocean s-coordinate, generic form 2

Formula:
\[ \begin{align}\begin{aligned}z & = \eta + (\eta + h) * S\\S & = \frac{h_c s + h C}{h_c + h}\\C & = (1-b)*\frac{\sinh(a*s)}{\sinh(a)} + b*\left[\frac{\tanh(a*(s+0.5))}{2*\tanh(0.5*a)} - 0.5\right]\end{aligned}\end{align} \]
Sigma standard name:

ocean_s_coordinate_g2

Formula terms:

s: var1 C: var2 eta: var3 depth: var4 depth_c: var5

Parameters:
  • sig (xarray.DataArray) – Sigma coordinates ranging from -1 to 0 (\(s\) | s)

  • ssh (xarray.DataArray) – Sea surface height (\(\eta\) | eta)

  • bathy (xarray.DataArray) – Positive sea floor depth (\(h\) | depth)

  • hc (xarray.DataArray, float) – Positive critical depth (\(h_c\) | depth_c)

  • thetas (xarray.DataArray, None) – Surface control parameter (\(a\) | a). Optional if cs is provided.

  • thetab (xarray.DataArray, None) – Bottom control parameter (\(b\) | b). Optional if cs is provided.

  • cs (xarray.DataArray, None) – Stretching curve, which defaults to the formula above computed by get_cs() (\(C\) | C)

  • cs_type (str, None) – Stretching type (see get_cs())

  • ref ({"datum", "surface"}) – Reference of the heights: the fixed datum of the formula, where the sea surface height is zero so that the free surface is at ssh, or the free surface, where the heights are zero (ssh is subtracted).

  • cache (dict) – Deprecated, currently unused.

Returns:

xarray.DataArray – Height relative to the surface in m, negative in the ocean and positive up (\(z\))