Open edwardhartnett opened 2 years ago
This is good idea to use XML files in the repo. But, I do not know how UPP code use the g2tmpl lib in GFS, NAM, RRFS, and UFS models. You need to check with developers.
g2tmpl users will not see any change.
After ingesting the codes into g2c, the g2tmpl Fortran functions can be changed to get their results from the g2c library.
Users of g2tmpl would not see any difference, but the codes would move to the C library and be served from there to any other software that needs them, including g2tmpl.
That is great.
I do not like the fact that this requires external library to parse xml files. I think this just adds unnecessary complexity. Why do we need to read xml files instead of equivalent text files.
What equivalent text files?
These two, available from the same place the xml files are available from (WMO).
Those links take me to a sharepoint site for which I do not have permissions. Are these documents on the web?
I see the text versions are available here: https://wmoomm.sharepoint.com/sites/wmocpdb/eve_activityarea/Forms/AllItems.aspx?id=%2Fsites%2Fwmocpdb%2Feve%5Factivityarea%2FWMO%20Codes%2FWMO306%5FvI2%2FAllVERSIONS%2F2022%2D05%2D15%2FGRIB2%2D29%2E1&p=true&ga=1
I will ponder...
This is related to #345
Here we can find XML versions of the GRIB codes: https://community.wmo.int/activity-areas/wis/latest-version
Here's a sample:
So we can download these XML files (there are 2 for GRIB2) in the repo. Then we can find and use an XML parser library. Then g2c could read the XML and serve up all the code information. This would be very helpful for g2c, and for other applications using g2c.
In a further refactor, the g2tmpl project could just call the g2c library to get the codes, instead of maintaining them in Fortran code.
One problem is that we seem to have also defined our own "keys" which have to be maintained as well. I'm not sure yet how to cope with that.
The advantage is that we could use the WMO XML files directly, getting their updates and changes whenever they make them, automatically.
We would also still have to support any local codes as well.
@BoiVuong-NOAA @Hang-Lei-NOAA any comments on this idea?