thermo¶
A collection of function definitions to handle common thermodynamic calculations for the atmosphere.

climlab.utils.thermo.
EIS
(T0, T700)[source]¶ Convenience method, identical to thermo.estimated_inversion_strength(T0,T700)

climlab.utils.thermo.
Planck_frequency
(nu, T)[source]¶ The Planck function B(nu,T): the flux density for blackbody radiation in frequency space nu is frequency in 1/s T is temperature in Kelvin
Formula (3.1) from Raymond Pierrehumbert, “Principles of Planetary Climate”

climlab.utils.thermo.
Planck_wavelength
(l, T)[source]¶ The Planck function (flux density for blackbody radiation) in wavelength space l is wavelength in meters T is temperature in Kelvin
Formula (3.3) from Raymond Pierrehumbert, “Principles of Planetary Climate”

climlab.utils.thermo.
Planck_wavenumber
(n, T)[source]¶ The Planck function (flux density for blackbody radition) in wavenumber space n is wavenumber in 1/cm T is temperature in Kelvin
Formula from Raymond Pierrehumbert, “Principles of Planetary Climate”, page 140.

climlab.utils.thermo.
T
(theta, p)[source]¶ Convenience method, identical to thermo.temperature_from_potential(theta,p).

climlab.utils.thermo.
blackbody_emission
(T)[source]¶ Blackbody radiation following the StefanBoltzmann law.

climlab.utils.thermo.
clausius_clapeyron
(T)[source]¶ Compute saturation vapor pressure as function of temperature T.
Input: T is temperature in Kelvin Output: saturation vapor pressure in mb or hPa
Formula from Rogers and Yau “A Short Course in Cloud Physics” (Pergammon Press), p. 16 claimed to be accurate to within 0.1% between 30degC and 35 degC Based on the paper by Bolton (1980, Monthly Weather Review).

climlab.utils.thermo.
estimated_inversion_strength
(T0, T700)[source]¶ Compute the Estimated Inversion Strength or EIS, following Wood and Bretherton (2006, J. Climate)
 Inputs: T0 is surface temp in Kelvin
 T700 is air temperature at 700 hPa in Kelvin
Output: EIS in Kelvin
EIS is a normalized measure of lower tropospheric stability acccounting for temperaturedependence of the moist adiabat.

climlab.utils.thermo.
lifting_condensation_level
(T, RH)[source]¶ Compute the Lifiting Condensation Level (LCL) for a given temperature and relative humidity
 Inputs: T is temperature in Kelvin
 RH is relative humidity (dimensionless)
Output: LCL in meters
This is height (relative to parcel height) at which the parcel would become saturated during adiabatic ascent.
Based on approximate formula from Bolton (1980 MWR) as given by Romps (2017 JAS)
For an exact formula see Romps (2017 JAS), doi:10.1175/JASD170102.1

climlab.utils.thermo.
mixing_ratio_from_vapor_pressure
(p, e)[source]¶ Water vapor mixing ratio p is air pressure e is vapor pressure p and e must be in same units (e.g. hPa)

climlab.utils.thermo.
mmr_to_vmr
(mmr, gas)[source]¶ Convert mass mixing ratio to volume mixing ratio for named gas. ( molecular weights are specific in climlab.utils.constants.py )

climlab.utils.thermo.
potential_temperature
(T, p)[source]¶ Compute potential temperature for an air parcel.
 Input: T is temperature in Kelvin
 p is pressure in mb or hPa
Output: potential temperature in Kelvin.

climlab.utils.thermo.
pseudoadiabat
(T, p)[source]¶ Compute the local slope of the pseudoadiabat at given temperature and pressure
 Inputs: p is pressure in hPa or mb
 T is local temperature in Kelvin
 Output: dT/dp, the rate of temperature change for pseudoadiabatic ascent
 in units of K / hPa
The pseudoadiabat describes changes in temperature and pressure for an air parcel at saturation assuming instantaneous rainout of the supersaturated water
Formula consistent with eq. (2.33) from Raymond Pierrehumbert, “Principles of Planetary Climate” which nominally accounts for nondilute effects, but computes the derivative dT/dpa, where pa is the partial pressure of the noncondensible gas.
Integrating the result dT/dp treating p as total pressure effectively makes the dilute assumption.

climlab.utils.thermo.
qsat
(T, p)[source]¶ Compute saturation specific humidity as function of temperature and pressure.
 Input: T is temperature in Kelvin
 p is pressure in hPa or mb
Output: saturation specific humidity (dimensionless).

climlab.utils.thermo.
rho_moist
(T, p, q)[source]¶ Density of moist air. T is air temperature (K) p is air pressure (hPa) q is specific humidity (hPa)
returns density in kg/m3

climlab.utils.thermo.
temperature_from_potential
(theta, p)[source]¶ Convert potential temperature to insitu temperature.
 Input: theta is potential temperature in Kelvin
 p is pressure in mb or hPa
Output: absolute temperature in Kelvin.

climlab.utils.thermo.
theta
(T, p)[source]¶ Convenience method, identical to thermo.potential_temperature(T,p).

climlab.utils.thermo.
vapor_pressure_from_specific_humidity
(p, q)[source]¶ Vapor pressure (same units as input p) p is total air pressure q is specific humidity (dimensionless) – mass of vapor per unit mass moist air