NCL Home >
Documentation >
Functions >
General applied math,
Statistics,
Drought
dim_cumsum_n_Wrap
Calculates the cumulative sum along the given dimension(s) and retains metadata.
Prototype
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" ; This library is automatically loaded
; from NCL V6.2.0 onward.
; No need for user to explicitly load.
function dim_cumsum_n_Wrap (
x : numeric,
opt : integer,
dims [*] : integer
)
return_val [dimsizes(x)] : float or double
Arguments
xA variable of numeric type and any dimensionality.
optOption for how to treat _FillValue:
- opt = 0 ; when _FillValue is encountered, set current element and all remaining to _FillValue
- opt = 1 ; when _FillValue is encountered set element to _FillValue and resume summing
- opt = 2 ; treat _FillValue as numeric zero when summing
The dimension(s) of x on which to do the cumulative sum across.
Description
This function is identical to dim_cumsum_n, except the return value will have metadata added based on metadata attached to x. See the dim_cumsum_n page for full documentation and examples.