calcMonAnomTLL
Calculates monthly anomalies by subtracting the long term mean from each point (time,lat,lon version)
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 calcMonAnomTLL ( x [*][*][*] : float or double, xAve [12][*][*] : numeric ) return_val [dimsizes(x)] : numeric
Arguments
xA three-dimensional array of any numeric type. Dimensions must be time,lat,lon The time dimension must be a multiple of 12.
xAveA three-dimensional array equal to the monthly averages of x. The leftmost two dimensions are lat and lon, while the leftmost must be of size 12.
Return value
An array of the same size and type as x.
Description
Calculates climatological anomalies by subtracting the long term mean from each point. Assumes monthly data. If the input data contains metadata (e.g. coordinate variables and attributes), these will be retained.
See Also
calcMonAnomLLLT, calcMonAnomLLT, calcMonAnomTLLL, clmMonLLT, clmMonLLLT, clmMonTLL, clmMonTLLL
Examples
;---Get data
fa = addfile("air.mean.nc","r")
fb = addfile("air.nobs.nc","r")
air = short2flt( fa->air) ; air temp
nobs = short2flt( fb->air) ; # obs for air
; filter out geographic locations that have < nMin observations
nMin = 2 ; min # obs
air = mask(air,nobs.ge.nMin,True)
;---Compute the climatology using a function in contributed.ncl
yrStrt = 1950
yrLast = 1979
moStrt = (yrStrt-1800)*12 ; start subscript
moLast = (yrLast-1800)*12 + 11 ; last subscript
clm = clmMonTLL (air(moStrt:moLast,:,:)) ; monthly climatology
;---Compute the anomalies from the climatology just computed
xAnom = calcMonAnomTLL (air,clm)