Versions Compared

Key

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

DESCRIPTION

Convert a GRIB file(s) to netCDF format.

Note

The GRIB geometry should be a only supported geometries for this feature are regular lat/lon grid or a or regular Gaussian grid  (the key "typeOfGrid" should be "regular_ll" or "regular_gg")

If you are retrieving the data from our archive, check here the following article for more information about how to obtain it in that grid interpolated to those grids by using the "grid" keyword: grid - keyword in MARS/Dissemination request

USAGE

grib_to_netcdf [options] -o output_file grib_file grib_file ...

OPTIONS

...

Type of data. Possible values NC_BYTE, NC_SHORT, NC_INT, NC_FLOAT, NC_DOUBLE.
Default NC_SHORT


-T

Don't use time of validity.

...

Force. Force the execution not to fail on error.


-o output_file

The name of the netcdf netCDF output file.


-V

Version.


-M

Multi-field support off. Turn off support for multiple fields in single GRIB message.

...

Specifies the kind of file to be created. Possible values are:
1 -> netCDF classic file format
2 -> netCDF 64 bit classic file format (Default)
3 -> netCDF-4 file format
4 -> netCDF-4 classic model file format

...

Set dimension to be an unlimited dimension.

grib_to_netcdf examples

  1. Produce a NetCDF file from

  2. grib
  3. GRIB edition 1

    Code Block
  4. > grib_to_netcdf -o output.nc input.grib1
    



  5. If your grib file has analysis and 6-hour forecast, then ignore keys 'type' and 'step'. Thus type=an/fc and step=00/06 will not be considered as

  6. netcdf
  7. netCDF dimensions.

    Code Block
  8. > grib_to_netcdf -I type,step -o output.nc input.grib
    



  9. Do not use time of validity. If time of validity is used, it means the 1D time coordinate is considered as date+time+step, otherwise 3 different dimensions are created. The default behaviour is to use the time of validity.

    Code Block
  10. > grib_to_netcdf -T -o output.nc input.grib
    



  11. Produce

  12. NetCDF
  13. netCDF with data type of FLOAT (32bit floating-point, for higher precision). Note these types were chosen to provide a reasonably wide range of trade-offs between data precision and number of bits required for each value

    Code Block
  14. > grib_to_netcdf -D NC_FLOAT -o output.nc input.grib
    



  15. Set the

  16. netcdf
  17. netCDF dimension 'time' to be unlimited i.e. time can have unlimited length so variables using this dimension can grow along this dimension.

    Code Block
  18. > grib_to_netcdf -u time -o output.nc input.grib