Skip to contents

Calculation of the wind speed and direction based on the u and v wind components.

Usage

wind_speed_direction(u_wind, v_wind, nthreads = 1)

Arguments

u_wind

the u-component (east-west) of the wind (m/s) in [lon, lat, lev, time] dimensions.

v_wind

the v-component (north-south) of the wind (m/s) in [lon, lat, lev, time] dimensions.

nthreads

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

Value

A list of "4D" arrays containing:

`windspeed`

wind speed (m/s) in [lon, lat, lev, time] dimensions.

`winddir`

the wind direction in degrees from north in [lon, lat, lev, time] dimensions.

Examples


# Example data
data("ERA5_pl")
u <- ERA5_pl$ua
v <- ERA5_pl$va
ws_wd <- wind_speed_direction(u, v, nthreads = 1)