Norwegian Service Centre for Climate Modelling -> Format Conversion Tools -> gribtonc
gribtonc - GRIB to netCDF decoder
gribtonc [-l logpath] [-v] [-t timeout] [-e errpath] [-g tabfile] [-q qspecs] [CDL_path] netCDF_path
This program decodes GRIB products (embedded in WMO product envelopes) on the NWS High-Resolution Data Service (HRS) feed, writing the decoded products into a single netCDF output file, specified by netCDF_path. In case the output netCDF file does not already exist, the CDL_path must be supplied to specify the structure for the desired netCDF file, which gribtonc creates. GRIB products are converted to the units specified for the appropriate netCDF variable, if this differs from the units used for the GRIB parameter. A set of CDL files for all the model outputs appearing on the HRS data stream is provided with gribtonc for use in decoding HRS GRIB data.
gribtonc can run as a subprocess of the LDM pqact(1) program, receiving a stream of GRIB products from standard input and decoding them as they arrive. gribtonc can also be used as a standalone decoder, decoding products on its standard input into netCDF form, as specified by netCDF_file GRIB products that do not conform to the specified file structure (e.g. they are defined on a different grid or contain a grid parameter not included in the specified netCDF file) are skipped.
To use gribtonc from the LDM pqact(1) program requires adding entries to the pqact configuration file that invoke gribtonc on appropriate HRS products. The PIPE action should be used in pattern-action entries. The form of such an entry is:
where pattern is a regular expression pattern matching product identifiers of products that are to be decoded and written to the output file netcdf-file.
Any directories that do not exist in netcdf-file will be created as needed, so date components, for example, may be part of the output file path, specified by using matched parts of the regular expression pattern. In case the output netcdf-file does not already exist, it will be created from the CDL specification in the file specified by cdl-file.
The path of the executable for gribtonc must be specified as the first argument to the PIPE command, and should be either an absolute path name or in a directory in the executable search path of pqact.
An example pqact.conf entry for decoding GRIB products from the ETA model as they appear on the HRS data stream is:
# ETA model on Lambert conformal grid to yymmddhh_eta.nc
Since gribtonc reads GRIB products from its standard input, it may be invoked independently of pqact(1) by using I/O redirection.
will decode the products in avn-x.wmo into the netCDF file avn-x.nc, creating the latter file if it does not already exist from the ASCII CDL template file avn-x.cdl. If the data contain quasi-regular grids, they will be expanded to full regular grids on a 2.5 by 5.0 degree grid before being written into the output file.
gribdump(1), gribtocdl(1), netcdf(3), pqact(1), udunits(3), ulog(3)
Error messages and log messages are written to the log file.
Send comments to webmaster