NASA - National Aeronautics and Space Administration
  
Humidity

Absolute humidity
From the ideal gas law, the density of water, rhow is given by
rhow= ( <mw>w fw e)/(R* T)
where <mw>w is the molecular weight of water (18.016 gm/mole), fw is a correction factor for non-ideal behavior which can be taken as fw = 1, e is the partial pressure of water, R* is the universal gas constant, and T is the local temperature.
Specific humidity
The total density, rho, is given by the sum of dry and moist densities ( i.e., assumes all other species are included in ``dry'').
rho = rhod + rhow = [ <mw>d · (P - fw e)]/(R* T) + (<mw>w fw e)/(R* T) = [<mw>d · (P - 0.37803 fw e)]/(R* T)
where <mw>d is the molecular weight of dry air (28.966), <mw>w/<mw>d = 0.62197, and (<mw>d - <mw>w)/<mw>d = 0.37803. The specific humidity is the ratio of the moist to total density and is dimensionless, but is usually expressed in gm/Kg units.
q = rhow/rho = (0.62197 fw e) / (P - 0.37803 fw e) appeq 0.622 e/P
Note that
rhow = q · rho
and the volumetric mixing ratio, f, (i.e., ratio of water number density, Nw, to the total number density Nt) is given by
fw ident Nw/Nt = <mw>/<mw>w · q
where the average molecular weight, <mw>, is given by
<mw> = <mw>d · (1 - fw) + <mw>w · fw
Mass Mixing Ratio
r = rhow/rhod = 0.62197 · [(fw e)/(P - fw e)] appeq 0.62197 · e/(P - e) approx q

from US Standard Atmosphere 1976, Table 20, pg. 44, r(z) ppm by mass
Alt
(km)
P
(mB)
record
low
1%
low
midlat.
mean
1%
high
record
high
sfc1013.250.15.04,68630,00035,000
189024.027.03,70029,00031,000
279021.031.02,84324,00028,000
461016.024.01,26818,00022,000
64706.212.05547,7008,900
83506.16.12164,3004,700
102655.343.21,300
121951.211.3230
141401.53.348
161001.03.338

% Relative Humidity
U ident 100 · r/rs appeq 100 q/qs appeq 100 e/es
where rs ident r(e = es) and qs ident q(e = es).
The saturated vapor pressure is approximately given by
es appeq 6.11 · 10[(a T)/(b + T)] mBar
rs appeq 0.62197 · es/(P - es)   for es > P
rs appeq 0.62197   for es geq P
where T is given in °C and a and b are constants.

ab
above water7.5237.3
above ice9.5265.5

Dew Point Temperature
The Dew point is the temperature at which the partial pressure of water reaches the saturation value, that is
e = (rhow R* T)/(<mw>w fw) = es(Tdp)
The empirical expression for es can be used or a table lookup can be utilized after e is calculated.