A GrADS expression consists of operators, operands, and parentheses. Parentheses are used to control the order of operation.

Operators are:

Operands are:

variable specifications, functions, and constants.

Operations between two variables are done on equivalent grid points in each grid. Missing data values in either grid give a result of a missing data value at that grid point. Dividing by zero gives a result of a missing data value at that grid point.

Operations cannot be done between grids that have different scaling in their varying dimensions -- i.e., grids that have different rules for converting the varying dimensions from grid space to world coordinate space. This can only be encountered when you are attempting operations between grids from different files that have different scaling rules.

If one grid has more varying dimensions than the other, the grid with fewer varying dimensions is 'expanded' and the operation is performed.

Expression evaluation in GrADS is recursive, so that multiple expressions may be nested together.

(GrADS version 2.0.a7+) Variable specifications can include a dimension expression to set time as an offset from the variable's initial time.

Some examples of expressions: