
Compute Potential Vorticity on Pressure Levels
Ertel_potential_vorticity.Rd
This function calculates the Ertel potential vorticity (PV) on pressure levels from a given 4D wind, temperature, and pressure field [lon, lat, lev, time].
Arguments
- ta
air temperature [lon, lat, lev, time] (K).
- ua
zonal wind component [lon, lat, lev, time] (m/s).
- va
meridional wind component [lon, lat, lev, time] (m/s).
- lon
longitude coordinates [lon] (degrees east).
- lat
latitude coordinates [lat] (degrees north).
- pa_pl
pressure levels [lev] (hPa).
- nthreads
an integer specifying the number of threads to use for computation (OpenMP). Default is 1.
Details
The derivatives are approximated using finite differences. Grid spacing is computed using Haversine formula.
Examples
data("ERA5_pl")
ta <- ERA5_pl$ta
ua <- ERA5_pl$ua
va <- ERA5_pl$va
lon <- ERA5_pl$lon
lat <- ERA5_pl$lat
pa_pl <- ERA5_pl$plev / 100
EPV <- Ertel_potential_vorticity(ta, ua, va, lon, lat, pa_pl)