1GRIBTONC(1)                 General Commands Manual                GRIBTONC(1)
2
3
4

NAME

6       gribtonc - GRIB to netCDF decoder
7

SYNOPSIS

9       gribtonc      [-l logpath]      [-v]      [-t timeout]     [-e errpath]
10              [-g userparams.tbl] [-q qspecs] CDL_path netCDF_path
11

DESCRIPTION

13       This program decodes GRIB products (embedded in WMO product  envelopes)
14       on the NWS High-Resolution Data Service (HRS) feed, writing the decoded
15       products into a single netCDF output file,  specified  by  netCDF_path.
16       In  case  the  output  netCDF file does not already exist, the CDL_path
17       must be supplied to specify the structure for the desired netCDF  file,
18       which  gribtonc creates.  The default parameter translation is made ac‐
19       cording to a definition by UCAR,  but  the  user  may  supply  specific
20       translations in a separate file by the -g tabfile option. The user-sup‐
21       plied translations will override the default ones.  GRIB  products  are
22       converted  to  the units specified for the appropriate netCDF variable,
23       if this differs from the units used for the GRIB parameter.  A  set  of
24       CDL files for all the model outputs appearing on the HRS data stream is
25       provided with gribtonc for use in decoding HRS GRIB data.
26

FORMAT OF GRIB TO NETCDF TRANSLATION TABLE

28       The format of the translation table is as follows: Each line contains
29           GRIB parameter number
30           netCDF parameter name (cannot start with digit, [A-Za-z0-9_] only )
31           netCDF long description
32           netCDF units
33           An optional comment
34
35       These are all separated by semicolon (";"). To comment  a  whole  line,
36       put  any letter or special character (i.e. not a digit) in front of it.
37       Trailing spaces are ignored before each semicolon, but not after.   The
38       GRIB number may have spaces in front.  Parameters found in the separate
39       file take presidence over the default parameter table, those not listed
40       in  the separate file are unchanged.  All parameters will be named with
41       a level suffix in addition to the name assigned in the separate file.
42
43

EXAMPLE

45       The command
46           gribtocdl -v -g my.tab sst.grib > sst.cdl
47
48       will decode the products in sst.grib and generate the corresponding CDL
49       code into file sst.cdl.  The file my.tab contains a specific conversion
50       table to be used when naming a parameter from  GRIB.   Later  the  GRIB
51       file may be converted to netCDF by using gribtonc:
52           gribtonc -v -g my.tab sst.cdl sst.nc < sst.grib
53
54       The file my.tab looks like this:
55           Grib;netCDF;long name               ;units;comments
56            31 ;CI    ;Sea-ice cover           ;none ;(0-1)
57            34 ;SSTK  ;Sea surface temperature ;K    ;
58           151 ;MSL   ;Mean sea-level pressure ;Pa   ;
59           167 ;T2M   ;2 metre temperature     ;K    ;
60
61       gribtonc can run as a subprocess of the LDM pqact(1) program, receiving
62       a stream of GRIB products from standard input and decoding them as they
63       arrive.   gribtonc  can  also be used as a standalone decoder, decoding
64       products on its standard  input  into  netCDF  form,  as  specified  by
65       netCDF_file  GRIB  products  that  do not conform to the specified file
66       structure (e.g. they are defined on a different grid or contain a  grid
67       parameter not included in the specified netCDF file) are skipped.
68
69       To  use  gribtonc from the LDM pqact(1) program requires adding entries
70       to the pqact configuration file that invoke gribtonc on appropriate HRS
71       products.   The  PIPE  action should be used in pattern-action entries.
72       The form of such an entry is:
73
74
75                HRS     pattern        PIPE gribtonc-executable
76                                  gribtonc-options                        cdl-
77              file  netcdf-file
78
79       where pattern is a regular expression pattern matching product  identi‐
80       fiers of products that are to be decoded and written to the output file
81       netcdf-file.
82
83       Any directories that do not exist in netcdf-file  will  be  created  as
84       needed, so date components, for example, may be part of the output file
85       path, specified by using matched parts of the regular  expression  pat‐
86       tern.   In  case the output netcdf-file does not already exist, it will
87       be created from the CDL specification in the  file  specified  by  cdl-
88       file.
89
90       The  path of the executable for gribtonc must be specified as the first
91       argument to the PIPE command, and should be  either  an  absolute  path
92       name or in a directory in the executable search path of pqact.
93
94       An  example  pqact.conf  entry  for decoding GRIB products from the ETA
95       model as they appear on the HRS data stream is:
96
97       # ETA model on Lambert conformal grid to yyyymmddhh_eta.nc HRS  ^Y.Q...
98              KWBC  (..)(..).*/mETA      PIPE /usr/local/ldm/decoders/gribtonc
99                   etc/eta.cdl      data/GRIB/(1:yyyy)(1:mm)12_eta.nc
100
101       Since gribtonc reads GRIB products from its standard input, it  may  be
102       invoked independently of pqact(1) by using I/O redirection.
103

OPTIONS

105       -l logpath
106              Log  file  pathname.  The program uses Unidata's ulog(3) package
107              to write error and log messages.  The default is to write to the
108              syslogd(8)  daemon.   If this option is specified, however, then
109              messages will be written to the file logpath unless  that  path‐
110              name is "-", in which case all messages will be written to stan‐
111              dard error.
112
113       -v     Verbose logging.   Informative  messages  (level  LOG_INFO)  are
114              logged,  including a line for each GRIB product decoded.  By de‐
115              fault, only messages of  severity  LOG_NOTICE  and  greater  are
116              logged.
117
118       -t timeout
119              Timeout in seconds (default is 600).  If there has been no input
120              available on stdin for the duration of  the  specified  timeout,
121              the program exits gracefully.
122
123       -e errpath
124              If a GRIB product cannot be decoded, perhaps because it is trun‐
125              cated or otherwise corrupted, it is appended to this file.
126
127       -g tabfile
128              Use GRIB-netcdf translation defined in this file. The format  of
129              this file is described below.
130
131       -q qspecs
132              Specification  for  how  to  expand  so-called  quasi-regular or
133              thinned grids into rectangular grids.  This argument is a comma-
134              delimited text string that specifies the method of interpolation
135              used (currently lin for linear or cub for cubic), and the  lati‐
136              tude  and longitude increments in degrees for the resulting grid
137              (e.g. dlat=2.5,dlon=5.0).
138
139       CDL_path
140              The path name of a file to be used as a template for the  netCDF
141              file, if the netCDF file specified as output does not exist.  If
142              the netCDF output file does exist, this argument is ignored.   A
143              path  name relative to the directory specified by the LDM_ETCDIR
144              environment variable may be used, but you must  make  sure  this
145              environment variable is defined in gribtonc
146
147       netCDF_path
148              The  path name of the netCDF output file.  This may be specified
149              as an absolute path name or (more typically) relative to the di‐
150              rectory from which gribtonc is invoked.  Directories that do not
151              exist in the path name of the output file  will  be  created  as
152              needed.
153
154

EXAMPLE

156       The command
157           gribtonc -v -l- -q "lin,dlat=2.5,dlon=5.0" avn-x.cdl avn-x.nc < avn-x.wmo
158       will  decode  the  products in avn-x.wmo into the netCDF file avn-x.nc,
159       creating the latter file if it does not already exist  from  the  ASCII
160       CDL  template file avn-x.cdl.  If the data contain quasi-regular grids,
161       they will be expanded to full regular grids on a 2.5 by 5.0 degree grid
162       before being written into the output file.
163

SEE ALSO

165       gribdump(1), netcdf(3), pqact(1), udunits(3), ulog(3)
166

DIAGNOSTICS

168       Error messages and log messages are written to the log file.
169
170
171
172
173                                  8 June 1995                      GRIBTONC(1)
Impressum