# [ncl-talk] Removing seasonal cycle from monthly data

Sri.durgesh Nandini-Weiss sri.durgesh.nandini-weiss at uni-hamburg.de
Mon Nov 11 03:48:09 MST 2019

```Hello everyone,

I am doing a simple calculation on monthly means data e.g. temp from
1850-2000.

I would like to calculate the mean, standard deviation (e.g tempfrom
1986-2006). For this the seasonal cycles of the respective periods
should be removed otherwise its probably not Gaussian so i want to
extract the seasonal cycle out of my data.

Are the below steps the correct way to do this? My script is successful
in retrieving the anomalies.

however i want which function is correct? (rmvmean or calcMonAnomTLLL)
rmvmean(x): remove mean (and returns deviation from mean)

calcMonAnomTLLL(x): Anomalies from Annual Cycle: calcMonAnomTLL:
contributed.ncl

;=================================================================
; Concepts illustrated:
;   - Calculates long term monthly means (monthly climatology) from
monthly data: (time,lev,lat,lon) version
;   - Compute monthly anomalies using monthly climatology
;   - 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.
;==================================================================
yrStrt = 1986
yrLast = 2006

TIME   = f->time
TIME = TIME-31
YYYY   = cd_calendar(TIME,-1)/100                 ; entire file
iYYYY  = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)  ;this is from 1
Jan 1986 to 1 Dec 2006

zo = f->zo(iYYYY,:,:,:,:) ; [time | 240] x [ens:100] x [depth:1] x
[lat | 192] x [lon | 288]
zo at _FillValue = 9.96921e+36
printVarSummary(zo)
printMinMax(zo,0)

zo1 = dim_avg_n_Wrap( zo, 2)
;[time | 240] x [ens:100] x [lat | 192] x [lon | 288]
printVarSummary(zo1)

;==================================================================
; Compute monthly climatology
;==================================================================

zo2 = clmMonTLLL( zo1 )                                          ;
[month | 12] x [ens | 100] x [lat | 45] x [lon | 90]
printVarSummary(zo2)

;==================================================================
; Compute  monthly anomalies from the above climatology to remove
seasonal cycle
;==================================================================

zAnom = calcMonAnomTLLL (zo1,zo2)
printVarSummary(zAnom) ;[time | 240] x [ens | 100] x [lat | 45] x [lon | 90]

zAnom at long_name = "Anomalies from monthly Climatology"
printVarSummary(zAnom)
printMinMax(zAnom, 0)

Or should i be using rmMonAnnCycLLLT (removes the annual cycle from the