Reading WP-MIP grib2 #3281
|
The WP-MIP data portal [https://hpfx.collab.science.gc.ca/~swpm001/selector.html] provides grib2 files which I want to put through METplus. The grib files are monthly chunks for a single variable, all lead times & inits in the same file. You can download by variable/level. Here I am looking at T250. Running wgrib2 shows this sort of thing. The files are in init with 6-hourly output to 240h with a t+0h [I am not going to vouch for this being the case for all models. It should be but I have looked at another model and found the time info different!] At least this is the case for the AIFS. [t_250_oic_ecmf_ai_00_pl_02.grib2] 62:60549961:d=2024020600:TMP:250 mb:anl: That looks ok. Next, using the grib_dump utility to decode the octets for Section 1& 4 you get this: ====================== SECTION_4 ( length=34, padding=0 ) ====================== That all looks ok... as far as my grib knowledge goes (which isn't far) Then, on to the METplus output. METplus fails. Here are some lines from the log file. getdrstemplate: DRS Template 5.42 not defined. I have searched and searched but can’t quite make the link between the tables here https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-0.shtml and the MET documentation under 5.13.2.9 in https://metplus.readthedocs.io/projects/met/en/latest/Users_Guide/config_options.html. How does one work out which index is which and what to set? With the grib_dump octets I thought I figured out which index was the lead time but it wasn't right, and the output went from telling me it can't pick a unique record, to it can't find anything to match! I clearly didn't pick the right one. How do i work out which ipdtmpl indices to set and what do I set them to? And what if, as I suspect, the grib table is not the same as MET uses, how does one get around that? I know folks at the DTC will want to work with these files too so I am sure they may find this of interest [@KathrynNewman and @michelleharrold]. |
Replies: 4 comments 11 replies
|
So, I managed to pick out the correct index value to get the lead time (8), but it filters the number of fields down to 9 matching records. Having inspected the GRIB headers of these fields, the difference between them now is the date/time information. |
|
Also, digging into the GRIB2 documentation at: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/ suggests that Data Representation Template 5.42 is defined at https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-42.shtml. |
|
@mpm-meto, thanks for pointing us to the WP-MIP Data Portal. I assume that WP-MIP is not actually generating any GRIB2 data, they're just redistributing data generated by other centers. We should be able to configure METplus to account for how the GRIB2 records are organized into files, but it may require using some new options in METplus config files. So I'm less worried about that. To test, I filled out this data selector site to generate this pull command: And pulled this
Yes, you technically can distinguish between these by setting the For example: Produces a lot of warnings like this: Whereas adding the Does not produce any warnings about multiple matching records. HOWEVER, I do see other GRIB2 issues that warrant further investigation... |
|
Have downloaded and built the new versions of the 3 pieces of software, rebuilt the MET code base pointing to the new versions of GRIB2C and JASPER (there wasn't an option for AEC?), but rerunning the job is still complaining about 5.42 not defined. I will have another look next week, but if there are any places where I may have misinterpretted something then please do let me know. |

@mpm-meto, yes, I'd recommend recompiling the existing version of MET using updated versions of the GRIB2C library, Jasper, and AEC. I'll list the details of the versions I used and why, but other combinations of versions may work as well:
cmakethan what's currently on my Mac):