Skip to contents

Wet-bulb potential temperature

Usage

theta_wp(hus, pa, ta, nthreads = 1)

Arguments

hus

specific humidity (kg/kg).

pa

air pressure (hPa).

ta

air temperate (K).

nthreads

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

Value

the computed wet-bulb potential temperature (K).

Note

air pressure variable should match the specific humidity correctly. If hus 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_pl")
hus <- ERA5_pl$hus
hus_d <- dim(hus)
ta <- ERA5_pl$ta
pa <- ERA5_pl$plev / 100 # convert to hPa
pa <- convert_plev_to_array(pa, hus_d)
res <- theta_wp(hus, pa, ta, nthreads = 1)