; ******************************************************************* ; M. Haley ; Compute a dimension average of "x" [x may have many dimensions] ; return with one less dimension. Based on dim_avg_Wrap. ; Copies over all the attributes and coordinate variables ; x - multidimensional variable ; dims - dimension(s) to do average across undef ("dim_avg_n_Wrap") function dim_avg_n_Wrap (x:numeric,dim_args[*]) local xave, dims begin dims = dimnames_to_indexes(x,dim_args) xave = dim_avg_n(x,dims) ; arithmetic ave [no meta data] copy_VarAtts (x, xave) ; copy attributes ; copy dim names and coord variables copy_VarCoords_not_n (x, xave, dims) ; add an extra attribute xave@average_op_ncl = dimWrapString("dim_avg_n",x,dims) return (xave) end