Documentation
The ecCodes GRIB tools are documented at:
There are examples of how to use them at:
Other useful resources:
Preliminaries
If you have already followed the Introduction Tutorial on GRIB decoding with ecCodes GRIB tools: inspecting GRIB files there is no need to redo these preliminary steps.
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 modify directory:
$> cd $SCRATCH/grib_practicals/modify
Remember to load the ecmwf-toolbox !
$> module load ecmwf-toolbox
This tutorial covers the following topics:
The file tz_an_pl.grib1 contains parameters T and Z on six pressure levels.
How could you use grib_copy to create two files, one containing all of the pressure levels for parameter T, the other for parameter Z ? Check the content of the new files with grib_ls.
Using grib_set to change key values
The field in the file tp.grib is supposed to contain total precipitation, created using MARS compute to sum the convective and large-scale (stratiform) precipitation.
What is the parameter set to in the file tp.grib ? How could you use grib_set to change it is set correctly to total precipitation (shortName=tp, paramId=228) ?
Converting GRIB data to netCDF with grib_to_netcdf
How could you use the grib_to_netcdf tool to convert the GRIB messages in file1.grib to netCDF and store the result in a file named out1.nc using the default NC_SHORT netCDF data type ?
Load the netcdf4 module and use ncdump to check the values in the netCDF file created in the previous step as follows:
$> module load netcdf4 $> ncdump -v t2m out1.nc