NCL Home > Documentation > Functions > General applied math


Calculates a weighted running average on the given dimension and retains metadata.


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 wgt_runave_n_Wrap (
		x       : numeric,  
		wgt     : numeric,  
		opt     : integer,  
		dim [1] : integer   

	return_val  :  float or double



An array with one or more dimensions. The dim-th dimension will be the dimension on which the weighted running average is performed. Missing values should be indicated by x@_FillValue. If x@_FillValue is not set, then the NCL default (appropriate to the type of x) is assumed.


A one-dimensional vector containing all the weights. Most commonly, the number of weights is an odd number.


End-point option (opt = 0 is the most common option)

For a full description of the opt argument, see the wgt_runave_n page.


A scalar integer indicating which dimension of x to do the calculation on. Dimension numbering starts at 0.


This function is identical to wgt_runave_n, except the return value will have metadata added based on metadata attached to x. See the wgt_runave_n page for full documentation and examples.