Skip to content
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

Regridding towards curvilinear grids #287

Open
jbeaumet opened this issue Aug 2, 2023 · 6 comments
Open

Regridding towards curvilinear grids #287

jbeaumet opened this issue Aug 2, 2023 · 6 comments

Comments

@jbeaumet
Copy link

jbeaumet commented Aug 2, 2023

Hi all,
I am a new user of xESMF, the regridding package looks very promising.
I would like to use xe regridder to upscale (so with method "conservative" or conservative-normed") satellite data wich are rectilinear to the domains of WRF model I am using which are curvilinear.
I have read the docs (https://xesmf.readthedocs.io/en/latest/notebooks/Curvilinear_grid.html) and it contains an example of the other way round: regridding from curvilinear to rectilinear, although it says it is possible to regrid towards curvilinear grids. I have tried, it is not working and this far my understanding of it, is that it is not working because in the wrf file there is no information on the lat/lon values of cell boundaries (lat_b, lon_b in the exemple). It is does not seems obvious where to get this information from WRF output files but I imagine I could use XLONG_U/XLONG_V and XLAT_U/XLAT_V from the u,v component of the winds which are usually given on the border of grid cells ? I was wondering if someone allready overcome this issue since there many wrf users ? May-be the issues with data from rasm model mentionned in the doc ?
Thanks in advance from your help and regards !
Julien

@aulemahal
Copy link
Collaborator

I can't confidently answer the question as I am not a user of WRF, but reading the doc here : https://amps-backup.ucar.edu/information/configuration/wrf_grid_structure.html, I think you are right.

I'm guessing lat_b would be XLAT_V and lon_b would be XLONG_U ?

Otherwise, cf_xarray has capacity to guess the bounds : https://cf-xarray.readthedocs.io/en/latest/bounds.html. But the approximation can be quite crude, depending on the curvature of the grid.

@jbeaumet
Copy link
Author

jbeaumet commented Aug 3, 2023

I can't confidently answer the question as I am not a user of WRF, but reading the doc here : https://amps-backup.ucar.edu/information/configuration/wrf_grid_structure.html, I think you are right.

I'm guessing lat_b would be XLAT_V and lon_b would be XLONG_U ?

Otherwise, cf_xarray has capacity to guess the bounds : https://cf-xarray.readthedocs.io/en/latest/bounds.html. But the approximation can be quite crude, depending on the curvature of the grid.

"Thanks a lot for your reply. I think you are right, I am going to try using lat_b as XLAT_V and XLONG_U as lon_b in xESMF and also may-be verify all these coordinates by plotting them in qgis but it makes sense."

@huard
Copy link
Contributor

huard commented Aug 31, 2023

Salut Julien @jbeaumet

Should we consider this issue resolved?

Also, please consider submitting a short "recipe" for the documentation on how to regrid for WRF, I'm confident this would be useful to many people.

@jbeaumet
Copy link
Author

jbeaumet commented Aug 31, 2023 via email

@huard
Copy link
Contributor

huard commented Aug 31, 2023

@jthielen
Copy link

Sorry for chiming in late to the discussion here, but this seems like it would be a good fit for xWRF, which seeks to adapt WRF output to CF conventions and make it easy to use with tools like xgcm and cf_xarray! I added an issue for this topic here: xarray-contrib/xwrf#134.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants