next up previous contents index
Next: 4.19 The NaN data Up: 4. General features Previous: 4.17 Grdfile format specifications   Contents   Index


4.18 Options for COARDS-compliant netCDF files

When the netCDF file contains more than one 2-dimensional variable, GMT programs will load the first such variable in the file and ignore all others. Alternatively, the user can select the required variable by adding the suffix ``?varname'' to the file name. For example, to get information on the variable ``slp'' in file file.nc, use:

	grdinfo "file.nc?slp"
Since COARDS-compliant netCDF files are the default, the additional suffix ``=nf'' can be omitted.

In case the named variable is 3-dimensional, GMT will load first (bottom) layer. If another layer is required, either add ``[index]'' or ``(level)'', where index is the index of the third (depth) variable (starting at 0 for the first layer) and level is the numerical value of the third (depth) variable associated with the requested layer. To indicate the second layer of the 3-D variable ``slp'' use as file name: file.nc?slp[1].

When you supply the numerical value for the third variable using ``(level)'', GMT will pick the layer closest to that value. No interpolation is performed.

Note that the question mark, brackets and parentheses have special meanings on Unix-based platforms. Therefore, you will need to either escape these characters, by placing a backslash in front of them, or place the whole file name plus modifiers between single quotes or double quotes.


next up previous contents index
Next: 4.19 The NaN data Up: 4. General features Previous: 4.17 Grdfile format specifications   Contents   Index
Paul Wessel 2006-01-01