Documentation
The ecCodes GRIB tools are documented at:
There are examples of how to use them at:
Other useful resources:
Preliminaries
Login to ecs-login and work in your $SCRATCH:
$> cd $SCRATCH
Make a copy of the practicals directory in your $SCRATCH to Atos:
$> tar -xvf /home/trx/grib_practicals.tar
This will create a directory in your $SCRATCH called grib_practicals containing the GRIB data files for this tutorial.
There are sub-directories for each practical:
$> ls $SCRATCH/grib_practicals inspect modify python
For this tutorial cd to the inspect directory:
$> cd $SCRATCH/grib_practicals/inspect
Remember to load the ecmwf-toolbox !
$> module load ecmwf-toolbox
This tutorial covers the following topics:
Use grib_ls to inspect the content of the files t2m.grib1 and t2m.grib2
What fields do the GRIB messages contain ?
Do the default keys printed by grib_ls depend on the GRIB edition ? Do you see any other differences ?
How do you print the MARS keys for the two files ?
How do you add the shortName to the output of the previous command ?
How do you change the previous command so that the output is in descending step order ?
Hint: think about strings and integers
How do you use grib_ls to print only the centre, dataDate, stepRange, typeOfLevel and shortName ?
How do you change the previous command so that only the field for forecast step=6 is printed ?
How do you change the previous command to print the centre as both a string and an integer ?
How do you use grib_dump to inspect the fourth (count=4) GRIB message in both files in WMO Octet mode ?
The command may produce many lines of output. You may want to redirect output to a file using, e.g.:
$> grib_dump .... t2m.grib1 > t2m.grib1.output
The file t2m.grib1 contains the 2m temperature from the ENS control forecast at 6-hourly time steps for the first 24 hours on the O640 octahedral reduced Gaussian grid. The file lsm.grib1 contains the ENS land-sea mask on the O640 grid.
How do you use grib_ls to find the value of the 2m temperature at the grid point nearest to ECMWF's headquarters in the UK (Lat 51.42°N, Lon 0.95°W) at each forecast step ?
Be careful to specify the longitude correctly !