Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

WRF-python post-processing wind speed issues


New member
Recently, I used uvmet from WRF-Python to extract the U and V components of wind velocity. However, when I extracted the composite wind speed from uvmet_wspd_wdir, I found that the wind speed calculated using the U and V components differed significantly from the directly extracted wspd values. I checked the source code of the relevant library, and it showed the method I used is consistent with the implementation. I'm not sure what key factors I might have overlooked.chrome_9njoAvRqJp.pngCode_OvjIMfFhFo.png
Would you please upload the script you used to derive wind speed?
import wrf
import numpy as np
from netCDF4 import Dataset

file_data = Dataset('')
U,V = wrf.getvar(file_data,'uvmet') #m/s
WSD,WDIR = wrf.getvar(file_data,'uvmet_wspd_wdir')
a = np.sqrt(np.array(U.values)**2+np.array(V.values)**2)
b = np.array(WSD.values)

The result indicates that a is the transpose matrix of b.
Last edited:
FYI, I've experienced a similar set of issues in the last month for other functions such as get_cloudfrac (cloud fraction) and get_rh (relative humidity).

I've had to rewrite the fortran routines (e.g. DCLOUDFRAC2, DCOMPUTERH, DCOMPUTETK) in python to get them to work.

I then compared to outcomes at each stage to the python 3.9 run Fortran WRF routines to confirm the python 3.11 versions worked which they do but python 3.11 using the WRF-python runs into issues.

Not a solution to your problem but empathy with your issues.