You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Visualizing model output is under development. The instructions below are a temporary solution allowing users to convert to netCDF for their favourite plotting program.

Forthcoming OpenIFS releases will provide additional software to analyse and view model output more easily without the need to modify the GRIB output files.

Model output

The OpenIFS model outputs files in GRIB format. These files are a mix of GRIB 1 & GRIB 2 format messages. They also contain multiple vertical coordinates: pressure levels, sub-surface levels etc as well as fields on reduced Gaussian grids which causes a problem with some 3rd party tools as the same GRIB variable code is used for each axis. The instructions below show how to work around this.

The ICMGG files contain all the gridpoint fields. The ICMSH files are the spherical harmonics of the wind fields, pressure and temperature.

CDO commands

These instructions assume the use of a recent version of Climate Data Operators (CDO) (available from Max-Planck-Institut, Germany).

CDO supports GRIB2 but needs the GRIB_API library from ECMWF in order to succeed. If you find the CDO command below do not work, you can either build CDO yourself, making sure grib_api is used, or you can use a workaround. In order to work around this, use the grib_set command (from the grib_api installation) to change the GRIB edition number for all messages. Note this will only work if you are using less than 128 model levels and it does not actually convert the message to GRIB1.

Workaround if CDO does not understand GRIB2
grib_set -s editionNumber=1 <input grib2 file> <output grib1 file>

CDO can be used to interpolate from the reduced Gaussian grid to a regular Gaussian grid

Convert to regular Gaussian grid
 cdo -R copy <input grib> <output grib>

Before converting to netCDF separate the different vertical axes:

cdo splitzaxis <input grib> <output grib>

Then finally convert the resulting output files to netcdf:

cdo -f nc copy <input grib> <output netcdf>

The following script shows how to loop over several output files using the steps above to convert to netCDF:

for i in 000 024 048 072
do

grib_set -s editionNumber=1 ICMGGfpp4+000${i} ICMGGfpp4+000${i}.grb
cdo -R copy ICMGGfpp4+000${i}.grb ICMGGfpp4+000${i}_R.grb
cdo splitzaxis ICMGGfpp4+000${i}_R.grb ICMGGfpp4+000${i}
cdo -f nc copy ICMGGfpp4+000${i}01.grb ICMGGfpp4+000${i}_PLGG.nc
cdo -f nc copy ICMGGfpp4+000${i}02.grb ICMGGfpp4+000${i}_MLGG.nc


grib_set -s editionNumber=1 ICMSHfpp4+000${i} ICMSHfpp4+000${i}.grb
cdo splitzaxis ICMSHfpp4+000${i}.grb ICMSHfpp4+000${i}
cdo sp2gpl ICMSHfpp4+000${i}01.grb ICMSHfpp4+000${i}01_GP.grb
cdo sp2gpl ICMSHfpp4+000${i}03.grb ICMSHfpp4+000${i}03_GP.grb
cdo sp2gpl ICMSHfpp4+000${i}04.grb ICMSHfpp4+000${i}04_GP.grb
cdo -f nc copy ICMSHfpp4+000${i}03_GP.grb ICMSHfpp4+000${i}_ML.nc
cdo -f nc copy ICMSHfpp4+000${i}01_GP.grb ICMSHfpp4+000${i}_PL.nc
cdo -f nc copy ICMSHfpp4+000${i}04_GP.grb ICMSHfpp4+000${i}_surf.nc
done

Note the spherical harmonic files are also converted but the extra command using the sp2gpl operator is first used to convert the variables from spherical harmonics to gridpoint.

 

  • No labels