Skip to contents

Specific Humidity from Dew Point Temperature

Usage

hus_from_td(td, pa, nthreads = 1)

Arguments

td

dew point temperature (K).

pa

air pressure (hPa).

nthreads

an integer specifying the number of threads to use for computation (OpenMP). Default is 1.

Value

the computed specific humidity (kg/kg).

Note

#' air pressure variable should match the td correctly. If td is a three dimensional array on pressure levels [lon, lat, plev], pa values should the same on each [lon, lat] slice. See convert_plev_to_array.

In case you are using model levels, estimate pressure array beforehand.

Examples

data("ERA5_sfc")
t2d <- ERA5_sfc$t2d
sp <- ERA5_sfc$sp
res <- hus_from_td(t2d, sp)