geocat.comp.interpolation._temp_extrapolate

geocat.comp.interpolation._temp_extrapolate#

geocat.comp.interpolation._temp_extrapolate(data, lev_dim, lev, p_sfc, ps, phi_sfc)#

This helper function extrapolates temperature below ground using the ECMWF formulation described in Vertical Interpolation and Truncation of Model-Coordinate Data by Trenberth, Berry, & Buja [NCAR/TN-396, 1993]. Specifically equation 16 is used:

\[T = T_* \left( 1 + \alpha ln \frac{p}{p_s} + \frac{1}{2}\left( \alpha ln \frac{p}{p_s} \right)^2 + \frac{1}{6} \left( \alpha ln \frac{p}{p_s} \right)^3 \right)\]
Parameters:
  • data (xarray.DataArray) – The temperature at the lowest level of the model.

  • lev_dim (str) – The name of the vertical dimension.

  • lev (int) – The pressure levels of interest. Must be in the same units as ps and p_sfc

  • p_sfc (xarray.DataArray) – The pressure at the lowest level of the model. Must be in the same units as lev and ps

  • ps (xarray.DataArray) – An array of surface pressures. Must be in the same units as lev and p_sfc

  • phi_sfc (xarray.DataArray) – The geopotential at the lowest level of the model.

Returns:

result (xarray.DataArray) – The extrapolated temperatures at the provided pressure levels.