Saturation vapor pressure es is calculated from a given temperature T (in K) by using the Clausius-Clapeyron relation. where es(T0) = 6.11hPa is the saturation vapor pressure at a reference temperature T0 = 273.15K, L = 2.5 × 106J/kg is the latent heat of evaporation for water, and $R_w = \frac{1000R}{M_w} = 461.52 J/(kg K)$ is the specific gas constant for water vapor (where R = 8.3144621J/(molK) is the molar gas constant and Mw = 18.01528g/mol is the molar mass of water vapor). More details refer to Shaman and Kohn (2009).
An alternative way to calculate saturation vapor pressure es is per the equation proposed by Murray (1967). where $\begin{cases} a = 21.8745584 \\ b = 7.66 \end{cases}$ over ice; $\begin{cases} a = 17.2693882 \\ b = 35.86 \end{cases}$ over water.
The resulting es is in hectopascal (hPa) or millibar (mb).
When given dew point Td (in K), the actual vapor pressure e can be computed by plugging Td in place of T into equation @ref(eq:1). The resulting e is in millibar (mb).
Relative humidity ψ is defined as the ratio of the partial water vapor pressure e to the saturation vapor pressure es at a given temperature T, which is usually expressed in % as follows
Therefore, when given the saturation vapor pressure es and relative humidity ψ, the partial water vapor pressure e can also be easily calculated per equation @ref(eq:2). e = ψes The resulting e is in Pa.
Absolute humidity ρw is the total amount of water vapor mw present in a given volume of air V. The definition of absolute humidity can be described as follows $$ \rho_w = \frac{m_w}{V} $$
Water vapor can be regarded as ideal gas in the normal atmospheric temperature and atmospheric pressure. Its equation of state is
Absolute humidity ρw is derived by solving equation @ref(eq:3). $$ \rho_w = \frac{e}{R_w T} $$ The resulting ρw is in kg/m3.
Mixing ratio ω is the ratio of water vapor mass mw to dry air mass md, expressed in equation as follows $$ \omega = \frac{m_w}{m_d} $$
The resulting ω is in kg/kg.
Specific humidity q is the ratio of water vapor mass mw to the total (i.e., including dry) air mass m (namely, m = mw + md). The definition is described as $$ q = \frac{m_w}{m} = \frac{m_w}{m_w + m_d} = \frac{\omega}{\omega + 1} $$
Specific humidity can also be expressed in following way. $$ \begin{equation} q = \frac{\frac{M_w}{M_d}e}{p - (1 - \frac{M_w}{M_d})e} (\#eq:4) \end{equation} $$ where Md = 28.9634g/mol is the molar mass of dry air; p represents atmospheric pressure and the standard atmospheric pressure is equal to 101, 325Pa. The details of formula derivation refer to Wikipedia.
Substitute $\frac{M_w}{M_d} \approx 0.622$ into equation @ref(eq:4) and simplify the formula. $$ q \approx \frac{0.622e}{p - 0.378e} (\#eq:5) $$ The resulting q is in kg/kg.
Hence, by solving equation @ref(eq:5) we can obtain the equation for calculating the partial water vapor pressure e given the specific humidity q and atmospheric pressure p.
$$ e \approx \frac{qp}{0.622 + 0.378q} (\#eq:6) $$ Substituting equations @ref(eq:1) and @ref(eq:6) into equation @ref(eq:2), we can get the equation for converting specific humidity q into relative humidity ψ at a given temperature T and under atmospheric pressure p.