对于逐月及逐日资料的处理

❓什么时候需要去趋势,什么时候需要去季节循环?

对于气象资料的基本处理:

(1) 原始的逐日资料减去对应这一日的气候态,就去掉了季节循环信号(季节循环:90-365 day),只剩下低频信号。
(2) 原始的逐月资料减去对应月份的气候态,就去掉了循环信号,只剩下年际、年代际等异常信号。
气候态的选取根据你的研究内容,例如做季节内研究一般选择气候态为夏季平均,但有的时候J J A分别作为气候态。

去季节循环
1、去趋势 dtrend
2、daily climatology
3、FFT分解得到前4个波即为季节循环(90天以上)
4、数据-季节循环

1

clmDayTLLncl中求多年日平均的函数
Calculates long term daily means (daily climatology) from daily data.
💫具体见ncl官网例子:clmDayTLL
Compute the daily climatologies.
The input is mean daily 500 hPa heights spanning 1990-1999.
The values are packed as type short and the time is in units "hours since 1-1-1 00:00:0".
There was no calendar attribute associated with the 'time' dimension/variable.
Hence, a gregorian calendar is assumed.
Still, the example shows how a user might check if the calendar attribute exists and associate it with the required variables.

;;The following library is loaded by default in NCL V6.2.0 and newer
;;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" 
diri    = "./"                             ; input directory   
fili    = "HGT.nc"                         ; input file       
f       = addfile (diri+fili , "r")                          
;***********************************************************
; Read time and create required yyyyddd                    
; NOte the tests for a calendar attribute are necessary for non-gregorian calendars
;***********************************************************
 time    = f->time                          ; time:units = "hours since            1-1-1 00:00:0.0"                               
TIME    = cd_calendar(time, 0)             ; type float 
year    = toint( TIME(:,0) )               ; toint strips meta data
month   = toint( TIME(:,1) )
day     = toint( TIME(:,2) ) 
                                                             ; check for        calendar attribute
 if (isatt(TIME,"calendar")) then           ; default is gregorian
   year@calendar = TIME@calendar         
end if

ddd     = day_of_year(year, month, day) 
 if (isatt(year,"calendar")) then           ; default is gregorian
   ddd@calendar = year@calendar  
end if

yyyyddd = year*1000 + ddd                                    ; needed for input
if (isatt(ddd,"calendar")) then           ; default is gregorian
   yyyyddd@calendar = ddd@calendar  
end if

;***********************************************************
; Read data: short2flt                                     
;*********************************************************** 
hgt     =  short2flt( f->hgt(:,0,:,:) )    ; convert to float 
printVarSummary( hgt ) 
;***********************************************************
; Compute daily climatology: raw daily means 
;***********************************************************
hClmDay    = clmDayTLL(hgt, yyyyddd)     ; daily climatology at each grid   point                                      
printVarSummary(hClmDay)   

2

calcDayAnomTLL:
💫具体见ncl官网例子:calcDayAnomTLL
Calculates daily anomalies from a daily data climatology.
Compute daily anomalies using a climatology created by clmDayTLL or smthClmDayTLL. The input is daily 500 hPa heights spanning 1990-1999. The values are packed as type short and the time is in units "hours since 1-1-1 00:00:0".

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" 
diri    = "./"                             ; input directory   
fili    = "HGT.nc"                         ; input file       
f       = addfile (diri+fili , "r")                          
;***********************************************************
; Read time and create required yyyyddd                    
;***********************************************************
time    = f->time                          ; time:units = "hours since 1-1-1 00:00:0.0"                               
TIME    = cd_calendar(time, 0)          ; type float 
year    = toint( TIME(:,0) )
month   = toint( TIME(:,1) )
day     = toint( TIME(:,2) ) 
ddd     = day_of_year(year, month, day) 
yyyyddd = year*1000 + ddd                                  ; needed for input
;***********************************************************
; Read data: short2flt                                     
;*********************************************************** 
hgt     = short2flt( f->hgt(:,0,:,:) )    ; convert to float 
printVarSummary( hgt ) 
;***********************************************************
; Compute daily climatology: raw and then 'smoothed'  
;***********************************************************
hClmDay    = clmDayTLL(hgt, yyyyddd)     ; daily climatology at each grid point                                      
printVarSummary(hClmDay)                                                                                              
;***********************************************************
;Compute smoothed daily climatology using 2 harmonics
;***********************************************************
hClmDay_sm = smthClmDayTLL(hClmDay, 2)
printVarSummary(hClmDay_sm)

;***********************************************************
; Compute daily anomalies using raw and smoothed daily climatologies
;***********************************************************
hAnom      = calcDayAnomTLL (hgt, yyyyddd, hClmDay)     
printVarSummary(hAnom_sm)
printMinMax(hAnom, 0)

hAnom_sm   = calcDayAnomTLL (hgt, yyyyddd, hClmDay_sm)     

hAnom_sm@long_name = "Anomalies from Smooth Daily Climatology"
printVarSummary(hAnom_sm)
printMinMax(hAnom_sm, 0)

去趋势

去趋势是为了消除数据中的线性趋势或高阶趋势,去趋势后的时间序列反应的是气候内部变率。如果不去趋势,可能会得到一个“虚假的”全球变暖的模态,因此在分析前应去趋势,即去掉全球变暖的信号。去趋势和标准化是两个概念,如果要标准化序列是需要再进行标准化的。

可以利用cdo处理,

detrend ifile ofile

dtrend_msg_n
💫具体见ncl官网例子:calcDayAnomTLL
ncl中去趋势去掉的是线性趋势。