27
$\begingroup$

How do I convert specific humidity to relative humidity? What variables are needed (e.g. air temperature, pressure, etc.)?

$\endgroup$

3 Answers 3

30
$\begingroup$

Relative humidity is just $e/e_s$, the ratio of the vapor pressure to saturation vapor pressure or $w/w_s$, the ratio of mass mixing ratios of water vapor at actual and saturation values. If you have specific humidity, which is the mass mixing ratio of water vapor in air, defined as:

$$ q \equiv \dfrac{m_v}{m_v + m_d} = \dfrac{w}{w+1} \approx w$$

Relative humidity can be expressed as the ratio of water vapor mixing ratio to saturation water vapor mixing ratio, $w/w_s$, where:

$$ w_s \equiv \dfrac{m_{vs}}{m_d} = \dfrac{e_s R_d}{R_v(p-e_s)} \approx 0.622\dfrac{e_s}{p}$$

and from Clausius-Clapeyron:

$$ e_s(T) = e_{s0}\exp\left[\left(\dfrac{L_v(T)}{R_v}\right)\left(\dfrac{1}{T_0} -\dfrac{1}{T} \right)\right] \approx 611\exp\left(\dfrac{17.67(T-T_0)}{T-29.65}\right)$$

Once you have calculated $w$ and $w_s$ you can obtain the relative humidity as:

$$ RH = 100\dfrac{w}{w_s} \approx 0.263pq\left[\exp\left(\dfrac{17.67(T-T_0)}{T-29.65}\right)\right]^{-1} $$

You could also calculate $RH = 100(e/e_s)$, but I think since you are starting with $q$ it isn't as straightforward as doing it this way.


Variables used:
$q$ specific humidity or the mass mixing ratio of water vapor to total air (dimensionless)
$m_v$ specific mass of water vapor (kg)
$m_{vs}$ specific mass of water vapor at equilibrium (kg)
$m_d$ specific mass of dry air (kg)
$w$ mass mixing ratio of water vapor to dry air (dimensionless)
$w_s$ mass mixing ratio of water vapor to dry air at equilibrium (dimensionless)
$e_s(T)$ saturation vapor pressure (Pa)
$e_{s0}$ saturation vapor pressure at $T_0$ (Pa)
$R_d$ specific gas constant for dry air (J kg$^{-1}$ K$^{-1}$)
$R_v$ specific gas constant for water vapor (J kg$^{-1}$ K$^{-1}$)
$p$ pressure (Pa)
$L_v(T)$ specific enthalpy of vaporization (J kg$^{-1}$)
$T$ temperature (K)
$T_0$ reference temperature (typically 273.16 K) (K)

$\endgroup$
10
  • $\begingroup$ I think there maybe an error here. $$ e_s(T) \approx 611\exp\left(\dfrac{17.67(T-T_0)}{T-29.65}\right).$$ Shouldn't the 611 be 6.11? In a number of papers I've seen ~6 used here, for eg: uib.cat/depart/dfs/meteorologia/ROMU/formal/relative_humidity/…. (eq 2). I don't know where your source is from but using this equation I'm getting results out by an order of 100. I think it should be: $$ RH = 100\dfrac{w}{w_s} \approx 26.3pq\left[\exp\left(\dfrac{17.67(T-T_0)}{T-29.65}\right)\right]^{-1}. $$ $\endgroup$
    – user2687
    Commented Dec 3, 2015 at 14:28
  • 2
    $\begingroup$ @stacey the 611 value in the equation is in units of Pascals, if you are using 6.11 then you are using hPa or mbar units. Either is correct but you need to be aware of units. 611 Pa = 6.11 hPa = 6.11 mbar. Likewise in the second equation you are giving p in hPa if you are off by a factor of 100. I specified in the post that p was in Pa, so if you use hPa you need to adjust by factor of 100. $\endgroup$
    – casey
    Commented Dec 3, 2015 at 14:31
  • 1
    $\begingroup$ @stacey do dimensional analysis on the units in the equation noting that 611 is Pa and 6.11 is hPa and then you'll see the scaling factor of 100 is just a Pa to hPa conversion factor, not some arbitrary number. Note that the exponential is dimensionless so the units of $e_s(T)$ are the units of $e_{s0}$. If you want $e_s(T)$ in hPa, use $e_{s0} $ = 6.11 hPa. $\endgroup$
    – casey
    Commented Dec 3, 2015 at 15:21
  • 2
    $\begingroup$ @user4050 it's a result of substituting the approximations for w and ws in the final equation. You end up with 100(1/(.622*611)) as constant factors after the substitution which is just 0.263. The p and q are likewise from the approximations substitutions. $\endgroup$
    – casey
    Commented Aug 16, 2016 at 11:26
  • 1
    $\begingroup$ @user4050 as soon as you venture past the approximation sign $\approx$ you lose accuracy. Most accurate would be to determine $w$ and $w_s$ exactly and calculate the left hand side. The right hand side is less accurate since it uses approximations but can be easier to use because it is in terms of temperature, pressure and specific humidity rather than mass mixing ratios of air and water vapor. $\endgroup$
    – casey
    Commented Aug 16, 2016 at 13:43
19
$\begingroup$

Here is an implementation that I wrote in R (with documentation in the header). In addition to laboriously working through a few textbooks and online references, I have compared the results to a psychrometric chart.

As you have likely noticed, it is a challenge to keep these terms and units straight - I wish I had @casey`s answer then!

##' Convert specific humidity to relative humidity
##'
##' converting specific humidity into relative humidity
##' NCEP surface flux data does not have RH
##' from Bolton 1980 The computation of Equivalent Potential Temperature 
##' \url{http://www.eol.ucar.edu/projects/ceop/dm/documents/refdata_report/eqns.html}
##' @title qair2rh
##' @param qair specific humidity, dimensionless (e.g. kg/kg) ratio of water mass / total air mass
##' @param temp degrees C
##' @param press pressure in mb
##' @return rh relative humidity, ratio of actual water mixing ratio to saturation mixing ratio
##' @export
##' @author David LeBauer
qair2rh <- function(qair, temp, press = 1013.25){
    es <-  6.112 * exp((17.67 * temp)/(temp + 243.5))
    e <- qair * press / (0.378 * qair + 0.622)
    rh <- e / es
    rh[rh > 1] <- 1
    rh[rh < 0] <- 0
    return(rh)
}

Similar variable conversion functions can be found in the metutils.R file in the PEcAn data.atmosphere library.

$\endgroup$
4
  • $\begingroup$ is this formula the same as the one by @casey? Because I get slightly different results. $\endgroup$ Commented Aug 16, 2016 at 12:36
  • 1
    $\begingroup$ @user4050 rounding error: coefficient here is 6.112 vs 6.11 above $\endgroup$ Commented Aug 16, 2016 at 19:07
  • $\begingroup$ Thanks! And how exactly did you get e from 6.112*exp((17.67*Td)/(Td + 243.5)) that it's in the page you linked? $\endgroup$ Commented Aug 18, 2016 at 15:45
  • $\begingroup$ @user4050 I didn't; e = qair * press / (0.378 * qair + 0.622) $\endgroup$ Commented Aug 21, 2016 at 5:21
3
$\begingroup$

I can't do, or won't do the math, but here is how I get around it. Look up the saturation line at the temperature and pressure that I am concerned with on pseudo-adiabatic diagram. Then multiply the relative humidity times the saturation rate at that temperature. It's not precise, since there are many factors that vary, and you are approximating from a paper chart, but it's a good enough estimate for my work. Hope this is helpful for those of us at the simple end of the concept.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.