Fields from IFS on model levels are provided in GRIB2 format which WPS cannot process directly due to following reasons:

  1. GRIB2 gridded data from IFS is compresses usingĀ CCSDS compression which cannot be decompressed directly by ungrib
  2. Vtable compatible with ECMWF' GRIB2 data is not provided in WPS

Handling CCSDS compression

Use ecCodes to change packing from CCSDS to "SIMPLE PACKING"

grib_set -r -w packingType=grid_ccsds -s packingType=grid_simple ccsds.grib grid_simple.grib


Addressing GRIB2 format

Separation of GRIB1 and GRIB2 fields to different files

Because ungrib cannot process a mixture of GRIB1 and GRIB2 fields in the same file, one can always split fields into separate files for each GRIB edition using ecCodes:

grib_filter split.rule input.grib

Where "split.rule" file has following content:

write "[dataDate]_[levelType]_[step].grib[edition]";

Conversion of model level fields from GRIB2 to GRIB1

Since WPS doesn't include Vtable describing ECMWF model level fields in GRIB2 format, one option is to convert these fields to GRIB1. This can be done with ecCodes:

grib_set -w edition=2 -s deletePV=1,edition=1 input_file.grib2 output_file.grib1

where input_file.grib2 contains all model level parameters in GRIB2 format. When setting the GRIB edition number to 1, it's the 'pv' GRIB parameter that causes the problem. PV is an array holding the half level values of the model's A & B coefficients that define the location of the levels which needs to be removed in order to fit all 137 model levels to GRIB1 format.

Run ungrib twice, for surface and for model level files:

Ungrib run for files containing surface fields

Ungrib section of namelist.wps file

&ungrib
 out_format = 'WPS',
 prefix = 'SFILE',
/


ln -sf Vtable.ECMWF_sigma Vtable
link_grib.csh *sfc*
ungrib.exe


Ungrib run for files containing model level fields

Ungrib section of namelist.wps file

&ungrib
 out_format = 'WPS',
 prefix = 'MFILE',
/


ln -sf Vtable.ECMWF_sigma Vtable
link_grib.csh *ml*
ungrib.exe


Calculate pressure at model levels

Using calc_ecmwf_p.exe utility tool available at WPS/util/ directory, calculate pressure at ECMWF model levels.