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