Computation/
grad.pro
compute the gradient of a variable located on Arakawa C-grid.
grad
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 371 2008-08-07 09:32:02Z 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
Produced by IDLdoc 2.0.