## Dimension Environment

The data set is always viewed by GrADS as a generalized 4-D (5-D if you include variables) array located in physical space (lon, lat, lev, time), even if it is in reality a subset of a 4-D space.

The current dimension environment describes what part of the data set you want to work with. Expressions are evaluated with respect to the dimension environment (which allows for simplicity in the expression syntax), and the final display will be determined by the dimension environment. Thus, the dimension environment is a GrADS concept that is important to understand.

The dimension environment is manipulated by the user by entering one of the following set commands:

```set lat|lon|lev|time val1 <val2>```

This set command sets one dimension of the dimension environment using world coordinates.

Alternatively:

```set x|y|z|t val1 <val2>```

This sets one dimension of the dimension environment using grid coordinates. You may use whatever coordinates are convenient to you. Issuing `set lon` is equivalent to issuing `set x`, both set the x dimension. The difference is only the units you wish to enter the command in.

When you enter just one value, that dimension is said to be "fixed". When you enter two values, that dimension is said to be "varying". The combination of fixed and varying dimensions defines the dimension environment.

Examples:

```set lon -180 0```     sets longitude to vary from 180W to 0
```set lat 0 90```         sets latitude to vary from the equator to 90N
```set lev 500```           sets the level to 500mb - a fixed dimension
```set t 1```                   sets time to the first time in the data set--using grid coordinates in this case. Time is now a fixed dimension

When all dimensions are fixed, you are referring to a single data point.

When one dimension is varying, you are referring to a 1-D "slice" through the data set.

When two dimensions are varying, you are referring to a 2-D "slice" through the data set.

When three dimension vary, GrADS interprets this as a sequence of 2-D slices.

An important note: When you enter dimensions in grid coordinates, they are always converted to world coordinates. This conversion requires some knowledge of what scaling is in use for grid to world conversions. The scaling that is used in all cases (except one) is the scaling of the default file. The exception is when you supply a dimension expression within a variable specification, which will be covered later.