Uses the August-Roche-Magnus approximation to derive relative humidity from the 2-metre air temperature and dew-point temperature.

compute_relative_humidity(t2m, dpt2m)

Arguments

t2m

Numeric vector. Air temperature (2 m) in degrees Celsius.

dpt2m

Numeric vector. Dew-point temperature (2 m) in degrees Celsius. Must be the same length as t2m.

Value

Numeric vector of relative humidity values in percent (0-100). Returns NA where either input is NA. Values are not clamped, so rounding errors may produce results marginally outside 0-100.

Details

The August-Roche-Magnus approximation is:

$$RH = 100 \times \frac{\exp\!\bigl(\tfrac{17.625\,T_d}{243.04 + T_d}\bigr)} {\exp\!\bigl(\tfrac{17.625\,T}{243.04 + T}\bigr)}$$

where \(T\) is the air temperature and \(T_d\) is the dew-point temperature, both in degrees Celsius. The coefficients (17.625 and 243.04) follow Alduchov & Eskridge (1996).

References

Alduchov, O. A., & Eskridge, R. E. (1996). Improved Magnus form approximation of saturation vapor pressure. Journal of Applied Meteorology, 35(4), 601–609.

Examples

compute_relative_humidity(t2m = 20, dpt2m = 10)   # ~52 %
#> [1] 52.54133
compute_relative_humidity(t2m = 0,  dpt2m = 0)    # 100 %
#> [1] 100
compute_relative_humidity(t2m = c(20, 15, NA), dpt2m = c(10, 12, 8))
#> [1] 52.54133 82.26135       NA