-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WRF-python post-processing wind speed issues #229
Comments
This error occurs only when using Python 3.11 and did not occur when using version 3.9. |
Thanks for the bug report! Can you confirm which variables are transposed (i.e. U/V or WSD/WDIR) and share a bit of info about the system you're running on (operating system) and your environment (e.g. the output of I wasn't able to replicate this locally. |
Thank you very much for your reply. I am using Windows 10 as my operating system, with conda version 23.7.4 and Python version 3.11.4. The variables that have been transposed are WSD and WDIR. The calculation results for U and V are consistent with those obtained when running on Python 3.9. My conda list is: |
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. |
Thank you very much for your reply, and I appreciate the alternative approach you provided for modifying the Fortran program. I have also attempted to make changes to some Fortran programs but was unsuccessful. In the end, I decided to revert back to Python 3.9. I am currently not sure whether the issue lies within the internal Fortran program or the Python program. |
I apologize for forgetting to use the reply format in my previous response. The link to my previous answer is here: #229 (comment) |
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.
code:
import wrf
import numpy as np
from netCDF4 import Dataset
file_data = Dataset('D3_2010_07_3_20100712161000.nc')
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.
Why does the matrix transpose happen? Is it due to the storage problem of components in u and v?
I am not very sure which one is the true value that can be compared with observed values.
I am so glad looking forward to your answer.
The text was updated successfully, but these errors were encountered: