# RE) How to remove interdecadal variation by using NCL

From: ¼­ÁöÀ± <joy0826_at_nyahnyahspammersnyahnyah>
Date: Thu, 26 Oct 2006 16:56:37 +0900

I tried to remove linear trend on monthly Hadisst data (1957~2005)by using dtrend_msg.
This my NCL script.
;*************************************************
; Detrend
;************************************************
;************************************************
begin

x = new((/588,180,360/),"float")
x!0 = "time"
x!1 = "lat"
x!2 = "lon"
x&time = ispan(0,587,1)
x@_FillValue = -99999.0
do nrec = 0,587
end do
print(x(383,92,181))
;===================================
; DTREND
;===================================

Dx = dtrend_msg(x&time,x(lat|:,lon|:,time|:),True,False)
Dx!0 = "lat"
Dx!1 = "lon"
Dx!2 = "time"
print(Dx(92,181,383))

re_Dx = Dx(time|:,lat|:,lon|:)
do n = 0,587
fbindirwrite(o_path,re_Dx(n,:,:))
end do
end
**************************************************************************
As I put the print commend in the scripts, the result is like this
Variable: x (subsection)
Type: float
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 2
time : 383
_FillValue : -99999
(0) 28.34

Variable: Dx (subsection)
Type: float
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 1
_FillValue : -99999
(0) 0.6002823
I don't know why 28.34 C turns to 0.6002823. I don't think I removed linear trend correctly.