-
Notifications
You must be signed in to change notification settings - Fork 16
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
[FEATURE]: Pull in coordinates from separate file #36
Comments
But, as far as I know, they don't typically have the XLAT_C/XLONG_C fields, which are the lat/lons of the grid cell corners. These variables are present in the geo_em* files though. Corner locations are useful to have when doing conservative regridding (such as https://xesmf.readthedocs.io/en/latest/notebooks/Pure_numpy.html?highlight=conservative#Regridding) from one curvlinear grid to another. This isn't an operation that everyone needs to do, but it is an important one for comparing wrf outputs to other datasets.
|
@bsu-wrudisill is correct in that XLAT_C and XLONG_C are in the geo_em* files, but not in the wrfout* files. Having just used xesmf to regrid a bunch of other data onto my WRF grids for analysis, it would be really great to have it also parse the corners. Conservative regridding is particularly important for precipitation comparisons so any regridding doesn't add/subtract mass when comparing between WRF and other datasets. As for renaming dimensions I think it would be good to rename here because |
Do you think it is fair to design XWRF to be optimized only with WRFv.3.8.1+, and maybe add support for earlier versions (with separate geo-files) later? |
As for renaming dimensions, I wonder if we can use |
@jukent... I think that should be fine... WRF v3.8 is already 5+ years old so I would imagine most current usage is these versions or higher. I also went back to the UGs of the previous versions and going back to v3.3 (when I first started using WRF) found that XLAT_C and XLONG_C (the grid corners) only seemed to be found in the geo_em* files in v3.8+. XLAT/XLONG, XLAT_U/XLONG_U, and XLAT_V/XLONG_V will all still be in the wrfouts* from earlier versions. So much of the functionality in XWRF will still work... but when folks need to do conservative regridding they'd need to compute the grid corners. So maybe a version check and a warning? |
Yeah. That sounds reasonable. |
Okay. Should I rename this issue to adding a WRF version check? |
@LejoFlores Do I understand coorectly that the I believe that since |
Yep! |
@LejoFlores I too find that naming less intuitive than Do you ever have a grid tilted so strongly (45°) that the naming distinction between |
While this issue pre-dates many of the features that have made it into the initial release of xWRF, I thought it would be good to revisit it (especially with an eye towards a rough roadmap going forward). The
Also, wanted suggest another option (could have both) to merging in external coordinate information: would we want to support re-computation of all the grid center/wall/corner latitudes and longitudes from projection coordinates (which are in turn derived from dataset attrs like |
Description
Some WRF data does not contain the lat/lon coordinates in the same file as the data variables. This was the case in this example. There is still the added step of needing to pull in this data before XWRF can effectively do its work (it still cleans up the time coordinates nicely). I have tested this in this notebook.
Implementation
Here is a sample function that adds cleaned up lat/lon coordinates when a file is missing them:
Tests
Perhaps we need to add a test that all variable dimensions are represented by a coordinate.
Questions
How common is it for WRF data to store the coordinate information in a separate geo-file?
Are there any patterns for where this geo-file is located that we can exploit to automatically find and pull in the correct geo-file without needing it provided?
Also I noticed that XWRF does not currently rename dimension names (
south_north
toy
, e.g.). Is this something we want to do? It is done in the example.The text was updated successfully, but these errors were encountered: