Skip to contents

This function computes the natural logarithm of pressure (ln p) weighted average of potential temperature (theta) in the lowest 200 hPa of the atmosphere.

Usage

theta_averaging(ta_s, pa_s, ta_pl, pa_pl, dp = 200, nthreads = 1)

Arguments

ta_s

air temperature [lon, lat, time] at 2m above the surface(K).

pa_s

surface pressure [lon, lat, time] (hPa).

ta_pl

air temperature [lon, lat, lev, time] on pressure level (K).

pa_pl

pressure profile [lev] in ascending order from the TOA to the surface (hPa).

dp

thickness of the layer (hPa) to consider for averaging. Default is 200 hPa.

nthreads

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

Examples

data("ERA5_sfc")
ta_s <- ERA5_sfc$t2m
pa_s <- ERA5_sfc$sp / 100

data("ERA5_pl")
ta_pl <- ERA5_pl$ta
pa_pl <- ERA5_pl$plev / 100

res <- theta_averaging(
  ta_s, pa_s,
  ta_pl, pa_pl,
  dp = 200
)