## gribmap

The GrADS data descriptor file defines a grid structure into which the data will fit -- it gives "shape" to the data by identifying its spatial dimensions, the number of time steps, and the number of variables.

If the data is in binary format, its structure has already been prescribed. If the data is in GRIB format, no consistent relationship exists between the data and the grid structure defined in the data descriptor file. Hence, the need for the `gribmap` utility which "maps" between the GRIB data and the GrADS data description.

As `gribmap` reads each field in the GRIB data file, the parameters for that field (e.g. variable name, vertical level, time) are compared to the information in the data descriptor file until a match is found. The process continues until all the GRIB elements have been "mapped" to their location within the GrADS grid structure.

The syntax for the `gribmap` command is as follows:

`gribmap [options]`

The options are as follows:

`-i fname`

Where `fname` is the name of the data descriptor file. If not specified, `gribmap` will prompt the user.

`-v`

Verbose mode -- detailed output makes it easier to verify what is being mapped. Default is off.

`-q`

Quiet mode -- suppresses all messages except for errors. Default is off.

`-t0`

Matches only those grib records whose base time is the same as the initial time in the data descriptor file. This is used to pull out a forecast sequence (0, 12, 24, ... , 72 hours) starting a specific time.

`-0`

Ignores the forecast time when setting up a match. This is useful for reanalysis data sets in which some diagnostic fields are "valid" at slightly different forecast time even though the share the same starting time.

`-min0`

Ignores the minutes code.

`-b`

Valid time for averages is set to be the beginning of the period rather than the end (default is the end)`.`

`-fhr`

Matches only those grib records whose forecast time is `hr` hours. This is used to isolate a sequence of forecasts. For example, if you wanted to sample all the 120-hour forecasts from the MRF ensemble runs, you would use `gribmap -f120`.

`-sxxx`

Skips over no more than `xxx` bytes between records. The default is 1000.

`-hxxx`

Skips over `xxx` bytes before starting the scan process.

`-u`

Updates existing gribmap if adding data files are being added to templated data set

`-1`

Creates a machine-specific version 1 map

`-2`

Creates a machine-INDEPENDENT version 2 map (the default for 1.9b3 and above)

`-e`

Ignores junk bytes (non GRIB msg) at end of file (e.g., ECMWF GRIB because of blocking)

`-E`

Ignore junk bytes in middle and/or end of GRIB file

`-N`

Does NOT write the map....

`-m`

SPECIAL OPTION for MPI....

`-hnmc`

SPECIAL OPTION for NCEP (before the name change from NMC)

Another feature was added to map by the GRIB "time-range-indicator" as specified in the `.ctl` file. This was put in for handling NMC reanalysis data where the time-range-indicator distinguishes between monthly mean variances and means.