## grads | gradsdap
gradsc | gradsnc | gradshdf | gradsdods

GrADS is an interactive desktop tool for the analysis and display of earth science data. GrADS is used worldwide and freely available over the internet. GrADS implements two data models: a 5-Dimensional gridded data model, and a station data model. In the gridded data model, the dimensions are presumed to be latitude, longitude, level, time, and ensemble. In the station data model, data exist at arbitrary locations in space and time. Four dimensions (longitude, latitude, level, and time) are used as a framework in the station data model to guide which station reports are to be examined. Each data set is placed within a 4- or 5-Dimensional space by the use of a data descriptor file. Both gridded and station data may be described. Gridded data may be non-linearly spaced; gaussian grids and variable resolution ocean model grids are directly supported. The internal data format in a file may be binary, GRIB1, GRIB2, BUFR, NetCDF, HDF4-SDS, or HDF5. Operations may be performed on the data directly, and interactively, by entering expressions at the command line. The expression syntax allows complex operations that range over very large amounts of data to be performed with simple expressions. A rich set of built-in functions are provided. In addition, users may add their own functions as external routines written in any programming language.

The syntax for running GrADS is:

`GrADS_executable < options >`

Beginning with GrADS version 2.0.a8, there is only one choice for `GrADS_executable,` a single, fully-featured build:
`grads` | Reads GRIB (version 1 and 2), gridded binary, BUFR, GrADS station data, NetCDF (classic and NetCDF-4), HDF4-SDS, HDF5, and OPeNDAP (grids and station data) Writes binary, NetCDF (classic and NetCDF-4), GeoTIFF, KML Draws shapefiles

For GrADS versions 2.0.a0 through 2.0.a7, the choices for `GrADS_executable` are:
`grads` | Reads GRIB (version 1 and 2), gridded binary, BUFR, GrADS station data, NetCDF, HDF4-SDS Writes binary, NetCDF, (starting with 2.0.a5) GeoTIFF, KML
`gradsdap` | Reads GRIB (version 1 and 2), gridded binary, BUFR, GrADS station data, NetCDF, HDF4-SDS, OPeNDAP Writes binary, NetCDF, (starting with 2.0.a5) GeoTIFF, KML

For GrADS version 1.9 and earlier, the choices for `GrADS_executable` are:
`gradsc` | Reads GRIB1, gridded binary, BUFR, GrADS station data Writes binary, GRIB1
`gradsnc` | Reads GRIB1, gridded binary, BUFR, GrADS station data, NetCDF Writes binary, GRIB1, NetCDF
`gradshdf` | Reads GRIB1, gridded binary, BUFR, GrADS station data, NetCDF, HDF4-SDS Writes binary, GRIB1, HDF-SDS
`gradsdods` | Reads GRIB1, gridded binary, BUFR, GrADS station data, NetCDF, OPeNDAP (aka DODS) Writes binary, GRIB1, NetCDF
Command line `options` are:
`-help` | Prints the command line options.
`-a ratio` | (GrADS 2.0.a9+) Specifies the aspect ratio of the real page inside GrADS. A valid `ratio` is the X size divided by the Y size and must be greater than 0.2 and less than 5.0. Page size is scaled so the longer side will always be 11 inches. On startup, GrADS will provide the page dimensions with the message that begins with "`GX Package Initialization: Size =` "
`-b` | Runs GrADS in batch mode. No graphics output window is opened.
`-c 'command'` | Executes the supplied `command` after GrADS has started.
`-C N` | (GrADS 2.0.a9+) Enables colorization of text displayed in the GrADS command window. N can be 0, 1, or 2. If -C is invoked but N is not provided, color scheme 0 will be used.
`-d gxdname` | Specifies the name of the graphics display plug-in (default is "Cairo")
`-E` | Disables command line editing
`-g geometry` | Specifies the size of the graphics output window, which is a representation on your computer screen of the real page and may be any size at all. The size of the real page in GrADS is controlled by the -l or -p or -a options. The `geometry` argument has the syntax `W`x`H`+`X`+`Y` , where `W` is the width of window in pixels, `H` is the height of window in pixels, `X` is the starting pixel point in x, and `Y` is the starting pixel point in y. Note that `X` and `Y` may be negative.
`-h gxpname` | Specifies the name of the graphics printing plug-in (default is "Cairo")
`-H filename` | Enables command line logging to `filename`. If `filename` is not provided, command history written to file $HOME/.grads.log
`-l` | Runs GrADS in landscape mode, sets the "real" page size to 11 x 8.5.
`-m NNN` | Sets metafile buffer size to NNN, which must be an integer. Default value is 1000000.
`-p` | Runs GrADS in portrait mode, sets the "real" page size to 8.5 x 11. If neither the `-l` or `-p` options are used, GrADS will prompt the user for a preferred mode.
`-u` | Unbuffers output, needed for IPC mode
`-x` | Generally used with the -c option, causes GrADS to automatically quit after the supplied `command` has been executed.

Options that do not require arguments may be concatenated. Some examples follow:

`grads -pb
grads -lbxc "myscript.gs"
grads -Ca 1.7778
grads -C 2 -a 1.7778
grads -pHm 5000000 -g 1100x850+70+0
grads -pH mysession.log -m 5000000 -g 1100x850+70+0`

## Environment Variables

Some environment variables must be set before starting GrADS.
`GADDIR` | Points to the directory containing the supplemental font and map files in the GrADS release package. If GADDIR is not set, GrADS will look in the default location, /usr/local/lib/grads/.
`GASCRP` | Points to a list of directories containing GrADS utility scripts and user scripts. If more than one directory is specified, acceptable delimiters are a space, a semi-colon, colon, or a comma.
`GASHP` | (GrADS version 2.0.0+) Points to a list of directories containing shapefiles. Put your shapefiles in those directories, and then it won't be necessary to use the full path when drawing or querying the shapefiles. If more than one directory is specified, acceptable delimiters are a space, a semi-colon, colon, or a comma.
`GAUDFT` | (GrADS version 1.9 or earlier) Points to the user defined function table. If this variable is not set, the function table will not be read.
`GAUDPT` | (GrADS version 2.1.1+) This variable identifies the user defined plug-in table, and should contain a single filename with its full path. GrADS will also look in the directory named by GADDIR for a file named "udpt".

For example:

C-shell

`example% setenv GADDIR /ford1/local/lib/grads
example% setenv GASHP $HOME/grads/shapefiles
example% setenv GASCRP "$HOME/grads/scripts /opt/local/share/grads/library"
example% setenv GAUDPT $HOME/grads/udpt
`

Bourne shell

`example% GADDIR=/ford1/local/lib/grads; export GADDIR
example% GASCRP=$HOME/grads/scripts; export GASCRP
example% GAUDPT=$HOME/grads/udpt; export GAUDPT
`