<<prev file | next file >>    view single page | view frames    summary: fields | routine    details: routine

Computation/

grad.pro

compute the gradient of a variable located on Arakawa C-grid.

topgrad Calculation

result = grad(field, direc, MILLION=scalar: 0 or 1, _EXTRA=_EXTRA)

Return value

the gradient of the input data with the same size 2D, 3D or 4D array, located on the appropriate grid (see restrictions)

Parameters

field       

The field for which we want to compute the gradient. A 2D (xy), 3D (xyz or yt) or 4D (xyzt) array or a structure readable by litchamp and containing a 2D (xy), 3D (xyz or yt) or 4D (xyzt) array. Note that the dimension of the array must suit the domain dimension.

direc        type: scalar string

the gradient direction: 'x', 'y', 'z'

Keywords

MILLION        type: scalar: 0 or 1 default: 0

Activate to multiply returned array by 1.e6

_EXTRA       

Used to declare that this routine accepts inherited keywords

Examples

IDL> @tst_initorca2 IDL> plt, grad({arr:gphit,g:'T'}, 'x') IDL> plt, grad({arr:gphit,g:'T'}, 'y')

Version history

Version

$Id: grad.pro 327 2007-12-13 16:22:35Z pinsard $

History

Sebastien Masson (smasson@lodyc.jussieu.fr)

Known issues

Restrictions

- Works only for Arakawa C-grid. - When computing the gradient, the result is not on the same grid point than the input data. In consequence, we update, vargrid and the grid position parameters (firstx[tuvf], lastx[tuvf], nx[tuvf], firsty[tuvf], lasty[tuvf], ny[tuvf], firstz[tw], lastz[tw], nz[tw]). - points that cannot be computed (domain boundaries, coastline) are set to NaN - the common variable jpt is used to differ xyz (jpt=1) and xyt (jpt=1) cases.

Other attributes

Uses routines

cm_4cal cm_4data cm_4mesh

Statistics

McCabe cyclic 70
McCabe essential 1
McCabe modular design 1
Produced by IDLdoc 2.0.