Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Problem

Excerpt
hiddentrue

If you have a file with both Control and Perturbed forecasts, grib_to_netcdf will only convert the pf. Normally from 51 members in the GRIB file, only 50 appear in the netCDF.

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

No Format
% grib_to_netcdf -o output.nc 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 in 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. Once converted the Control Forecast will appear as 'ensemble_number' = 0 in the NetCDF file.

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

Content by Label
showLabelsfalse
max5
spaces~usa
showSpacefalse
sortmodified
reversetrue
typepage
excludeCurrenttrue
cqllabel in ("kb-troubleshooting-article","eccodes-faqs","grib","conversion","netcdf") and label in ("netcdf","grib") and label = "grib_to_netcdf" and type = "page" and space = "UDOC"
labelskb-troubleshooting-article