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

Compare with Current View Page History

Version 1 Next »

Problem

If you have a file with both Control and Perturbed forecast in the same GRIB file, grib_to_netcdf will only convert the Perturbed Forecast. From 51 members present in the GRIB file, only 50 appear in the netCDF file.

$ grib_to_netcdf  -o output.nc -s input.grib
...
grib_to_netcdf: Found 51 GRIB fields in 1 file.
...
grib_to_netcdf: Done.


$ ncinfo output.nc
...
    dimensions(sizes): longitude(26), latitude(31), number(50), time(1)

This only occurs when 'type=pf and type=cf' fields coexist on the same file (common use case if you get real-time data).

Solution

The solution is to set the type=pf for the control forecast. This will then have 'ensemble_number' = 0 in the NetCDF file.

grib_set -s type=pf -w type=cf input.grib input2.grib
grib_to_netcdf  -o output.nc -s input2.grib


  • No labels