earthkit.meteo.thermo.virtual_temperature

earthkit.meteo.thermo.virtual_temperature(t: ArrayLike, q: ArrayLike) ArrayLike
earthkit.meteo.thermo.virtual_temperature(t: xarray.DataArray, q: xarray.DataArray) xarray.DataArray
earthkit.meteo.thermo.virtual_temperature(t: earthkit.data.FieldList, q: earthkit.data.FieldList) earthkit.data.FieldList

Compute the virtual temperature from temperature and specific humidity.

Parameters:
  • t (number or array-like) – Temperature (K)s

  • q (number or array-like) – Specific humidity (kg/kg)

Returns:

Virtual temperature (K)

Return type:

number or array-like

The computation is based on the following formula [Wallace2006]:

\[t_{v} = t (1 + \frac{1 - \epsilon}{\epsilon} q)\]

with \(\epsilon = R_{d}/R_{v}\) (see earthkit.meteo.constants.epsilon).

Implementations

virtual_temperature() calls one of the following implementations depending on the type of the input arguments:

The function returns an object of the same type as the input arguments.