1 | ;------------------------------------------------------------ |
---|
2 | pro fig16_timeseries_nino3 |
---|
3 | @common |
---|
4 | ;------------------------------------------------------------ |
---|
5 | |
---|
6 | reinitplt, /z,/invert |
---|
7 | key_portrait = 1 |
---|
8 | |
---|
9 | openps, FILENAME = 'idl.ps' |
---|
10 | ;------------------------------------------------------------ |
---|
11 | date1=19940101 & date2=20071231 |
---|
12 | box=[240,330,-5,5] |
---|
13 | |
---|
14 | file_trop='/Users/pkb/data/TropFlux/TropFlux_sst_19890101_20091231.nc' |
---|
15 | initncdf, file_trop |
---|
16 | sst=read_ncdf("sst", date1, date2, box=box, file=file_trop,/nostr) |
---|
17 | sst=grossemoyenne(sst, "xy",/nan) |
---|
18 | restore, filename="/Users/pkb/work/MY_SAXO/netflux_nino3_1989_2007.idl" |
---|
19 | help, trop, oafl, nce2, era, nce, sst |
---|
20 | ;------------------------------------------------------------------------------------------------------------------------ |
---|
21 | ;; creating climatology |
---|
22 | ny=(2007-1994)+1 |
---|
23 | nt=365*ny |
---|
24 | nsmooth=30. |
---|
25 | |
---|
26 | trop_nclim=total(reform(trop(0:nt-1),365,ny),2)/ny |
---|
27 | oafl_nclim=total(reform(oafl(0:nt-1),365,ny),2)/ny |
---|
28 | nce2_nclim=total(reform(nce2(0:nt-1),365,ny),2)/ny |
---|
29 | era_nclim=total(reform(era(0:nt-1),365,ny),2)/ny |
---|
30 | nce_nclim=total(reform(nce(0:nt-1),365,ny),2)/ny |
---|
31 | sst_nclim=total(reform(sst(0:nt-1),365,ny),2)/ny |
---|
32 | |
---|
33 | trop_nclim=[trop_nclim ,trop_nclim, trop_nclim] & trop_nclim=smooth(trop_nclim,nsmooth,/nan) & trop_nclim=trop_nclim[365:365+364] |
---|
34 | oafl_nclim=[oafl_nclim ,oafl_nclim, oafl_nclim] & oafl_nclim=smooth(oafl_nclim,nsmooth,/nan) & oafl_nclim=oafl_nclim[365:365+364] |
---|
35 | nce2_nclim=[nce2_nclim ,nce2_nclim ,nce2_nclim] & nce2_nclim=smooth(nce2_nclim,nsmooth,/nan) & nce2_nclim=nce2_nclim[365:365+364] |
---|
36 | era_nclim=[era_nclim ,era_nclim, era_nclim] & era_nclim=smooth(era_nclim,nsmooth,/nan) & era_nclim=era_nclim[365:365+364] |
---|
37 | nce_nclim=[nce_nclim ,nce_nclim ,nce_nclim] & nce_nclim=smooth(nce_nclim,nsmooth,/nan) & nce_nclim=nce_nclim[365:365+364] |
---|
38 | sst_nclim=[sst_nclim ,sst_nclim ,sst_nclim] & sst_nclim=smooth(sst_nclim,nsmooth,/nan) & sst_nclim=sst_nclim[365:365+364] |
---|
39 | |
---|
40 | time=time & jpt=n_elements(time) |
---|
41 | |
---|
42 | caldat, time,mon,day,yea |
---|
43 | trop_clim=trop*0. & era_clim=trop*0. |
---|
44 | oafl_clim=trop*0. & nce_clim=trop*0. |
---|
45 | nce2_clim=trop*0. & sst_clim=trop*0. |
---|
46 | |
---|
47 | for jt=0,jpt-1 do begin |
---|
48 | jtt=(time(jt)-julday(1,1,yea(jt))) < 364 |
---|
49 | trop_clim(jt)=trop_nclim(jtt) |
---|
50 | oafl_clim(jt)=oafl_nclim(jtt) |
---|
51 | nce2_clim(jt)=nce2_nclim(jtt) |
---|
52 | era_clim(jt)=era_nclim(jtt) |
---|
53 | nce_clim(jt)=nce_nclim(jtt) |
---|
54 | sst_clim(jt)=sst_nclim(jtt) |
---|
55 | endfor |
---|
56 | |
---|
57 | trop_ano=trop-trop_clim & oafl_ano=oafl-oafl_clim |
---|
58 | nce2_ano=nce2-nce2_clim & era_ano=era-era_clim |
---|
59 | nce_ano=nce-nce_clim & sst_ano=sst-sst_clim |
---|
60 | |
---|
61 | trop_hf=trop*0. & nce2_hf=trop*0. |
---|
62 | oafl_hf=trop*0. & era_hf=trop*0. |
---|
63 | nce_hf=trop*0. |
---|
64 | |
---|
65 | Thf=1 & Tlf=90 |
---|
66 | tsamp=1. ; monthly |
---|
67 | freq=findgen(jpt/2+1)/(jpt*tsamp) |
---|
68 | freq=[freq,-1.*reverse(freq(1:jpt/2))] |
---|
69 | peri=1./(abs(freq) > 1.e-20)*(2*(freq ge 0)-1.) |
---|
70 | ; Variance |
---|
71 | msk_spec=float((abs(peri) ge Thf) and (abs(peri) le Tlf)) |
---|
72 | ts=reform(trop_ano) |
---|
73 | ff_ts=fft(ts) |
---|
74 | ff_ts_f=ff_ts*msk_spec |
---|
75 | trop_hf=float(fft(ff_ts_f,/inverse)) |
---|
76 | ; |
---|
77 | ts=reform(nce2_ano) |
---|
78 | ff_ts=fft(ts) |
---|
79 | ff_ts_f=ff_ts*msk_spec |
---|
80 | nce2_hf=float(fft(ff_ts_f,/inverse)) |
---|
81 | ; |
---|
82 | ts=reform(era_ano) |
---|
83 | ff_ts=fft(ts) |
---|
84 | ff_ts_f=ff_ts*msk_spec |
---|
85 | era_hf=float(fft(ff_ts_f,/inverse)) |
---|
86 | ; |
---|
87 | ts=reform(nce_ano) |
---|
88 | ff_ts=fft(ts) |
---|
89 | ff_ts_f=ff_ts*msk_spec |
---|
90 | nce_hf=float(fft(ff_ts_f,/inverse)) |
---|
91 | ; |
---|
92 | ts=reform(oafl_ano) |
---|
93 | ff_ts=fft(ts) |
---|
94 | ff_ts_f=ff_ts*msk_spec |
---|
95 | oafl_hf=float(fft(ff_ts_f,/inverse)) |
---|
96 | ; |
---|
97 | help, trop_hf, nce2_hf, era_hf, nce_hf |
---|
98 | |
---|
99 | trop_ano=trop_ano-trop_hf & oafl_ano=oafl_ano-oafl_hf |
---|
100 | nce2_ano=nce2_ano-nce2_hf & era_ano=era_ano-era_hf |
---|
101 | nce_ano=nce_ano-nce_hf |
---|
102 | |
---|
103 | nsmooth=30. |
---|
104 | marge=[-3,-3,0,4] |
---|
105 | |
---|
106 | pltt, ts_smooth(sst_ano,nsmooth,/nan), "t",/rempl,/nocolorb, $ |
---|
107 | small=[1,3,1], title="a) Nino 3 index ", subtitle="", $ |
---|
108 | ytitle="(degree Celcius)", marge=marge, linethick=1.3, charsize=1.1, xmin=-1, ymin=-1 |
---|
109 | |
---|
110 | nsmooth=90. |
---|
111 | |
---|
112 | pltt, ts_smooth(trop,nsmooth,/nan), "t",/rempl,/nocolorb, 0,150, $ |
---|
113 | small=[1,3,2], title="b) Net Heat Flux", subtitle="", color=30, $ |
---|
114 | ytitle="(W/m2)", marge=marge, linethick=1.3, charsize=1.1,/noer, xmin=-1, ymin=-1 |
---|
115 | pltt, ts_smooth(oafl,nsmooth,/nan), "t",/ov1d, color=145 |
---|
116 | pltt, ts_smooth(era,nsmooth,/nan), "t",/ov1d, color=190 |
---|
117 | pltt, ts_smooth(nce2,nsmooth,/nan), "t",/ov1d, color=250 |
---|
118 | pltt, ts_smooth(nce,nsmooth,/nan), "t",/ov1d, color=65 |
---|
119 | |
---|
120 | nsmooth=120 |
---|
121 | pltt, ts_smooth(trop_ano,nsmooth,/nan), "t",/rempl,/nocolorb, -45,30, color=30, $ |
---|
122 | small=[1,3,3], ytitle="(W/m2)", marge=marge, linethick=1.3, xmin=-1, ymin=-1, $ |
---|
123 | title="c) Interannual Net Flux",/noer, charsize=1.1, subtitle="" |
---|
124 | pltt, ts_smooth(oafl_ano,nsmooth,/nan), "t",/ov1d, color=145 |
---|
125 | pltt, ts_smooth(era_ano,nsmooth,/nan), "t",/ov1d, color=190 |
---|
126 | pltt, ts_smooth(nce2_ano,nsmooth,/nan), "t",/ov1d, color=250 |
---|
127 | pltt, ts_smooth(nce_ano,nsmooth,/nan), "t",/ov1d, color=65 |
---|
128 | |
---|
129 | ;---------------------------------------------------------- |
---|
130 | closeps |
---|
131 | fig='fig16_timeseries_nino3.ps' |
---|
132 | spawn, 'mv '+psdir+'idl.ps '+cpsdir+fig |
---|
133 | spawn, 'gv '+cpsdir+fig |
---|
134 | return |
---|
135 | end |
---|
136 | ;-------------------------------------------------------------------------- |
---|
137 | function x_site_location, site |
---|
138 | n1=strpos(site, 's') |
---|
139 | if (n1 gt -1) then begin |
---|
140 | ns=-1. |
---|
141 | x=strmid(site, 0, n1) |
---|
142 | x=float(x)*ns |
---|
143 | endif else begin |
---|
144 | n1=strpos(site, 'n') |
---|
145 | x=strmid(site, 0, n1) |
---|
146 | ny=1. |
---|
147 | x=float(x)*ny |
---|
148 | endelse |
---|
149 | return, float(x) |
---|
150 | end |
---|
151 | ;-------------------------------------------------------------------------- |
---|
152 | function y_site_location, site |
---|
153 | n1=strpos(site, 'e') |
---|
154 | if (n1 gt -1) then begin |
---|
155 | n=strpos(site, 's') |
---|
156 | if (n gt -1) then begin |
---|
157 | y=strmid(site, n+1, n1-n-1) |
---|
158 | endif else begin |
---|
159 | n=strpos(site, 'n') |
---|
160 | y=strmid(site, n+1, n1-n-1) |
---|
161 | endelse |
---|
162 | |
---|
163 | endif else begin |
---|
164 | n1=strpos(site, 'w') |
---|
165 | n=strpos(site, 's') |
---|
166 | if (n gt -1) then begin |
---|
167 | y=strmid(site, n+1, n1-n-1) |
---|
168 | y=180+(180-float(y)) |
---|
169 | endif else begin |
---|
170 | n=strpos(site, 'n') |
---|
171 | y=strmid(site, n+1, n1-n-1) |
---|
172 | y=180+(180-float(y)) |
---|
173 | endelse |
---|
174 | endelse |
---|
175 | return,float(y) |
---|
176 | end |
---|
177 | |
---|
178 | ;-------------------------------------------------------------------------- |
---|
179 | |
---|