source: trunk/src/paper01/fig16/fig16_timeseries_nino3.pro @ 43

Last change on this file since 43 was 43, checked in by pinsard, 13 years ago

add minimal header in paper01 IDL files

  • Property svn:executable set to *
File size: 5.7 KB
Line 
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;-
34pro fig16_timeseries_nino3
35@common
36
37reinitplt, /z,/invert
38key_portrait = 1
39
40openps, FILENAME = 'idl.ps'
41date1=19940101 & date2=20071231
42box=[240,330,-5,5]
43
44file_trop='/Users/pkb/data/TropFlux/TropFlux_sst_19890101_20091231.nc'
45initncdf, file_trop
46sst=read_ncdf("sst", date1, date2, box=box, file=file_trop,/nostr)
47sst=grossemoyenne(sst, "xy",/nan)
48restore, filename="/Users/pkb/work/MY_SAXO/netflux_nino3_1989_2007.idl"
49help, trop, oafl, nce2, era, nce, sst
50;; creating climatology
51ny=(2007-1994)+1
52nt=365*ny
53nsmooth=30.
54
55trop_nclim=total(reform(trop(0:nt-1),365,ny),2)/ny
56oafl_nclim=total(reform(oafl(0:nt-1),365,ny),2)/ny
57nce2_nclim=total(reform(nce2(0:nt-1),365,ny),2)/ny
58era_nclim=total(reform(era(0:nt-1),365,ny),2)/ny
59nce_nclim=total(reform(nce(0:nt-1),365,ny),2)/ny
60sst_nclim=total(reform(sst(0:nt-1),365,ny),2)/ny
61
62trop_nclim=[trop_nclim ,trop_nclim, trop_nclim] & trop_nclim=smooth(trop_nclim,nsmooth,/nan) & trop_nclim=trop_nclim[365:365+364]
63oafl_nclim=[oafl_nclim ,oafl_nclim, oafl_nclim] & oafl_nclim=smooth(oafl_nclim,nsmooth,/nan) & oafl_nclim=oafl_nclim[365:365+364]
64nce2_nclim=[nce2_nclim ,nce2_nclim ,nce2_nclim] & nce2_nclim=smooth(nce2_nclim,nsmooth,/nan) & nce2_nclim=nce2_nclim[365:365+364]
65era_nclim=[era_nclim ,era_nclim, era_nclim] & era_nclim=smooth(era_nclim,nsmooth,/nan) & era_nclim=era_nclim[365:365+364]
66nce_nclim=[nce_nclim ,nce_nclim ,nce_nclim] & nce_nclim=smooth(nce_nclim,nsmooth,/nan) & nce_nclim=nce_nclim[365:365+364]
67sst_nclim=[sst_nclim ,sst_nclim ,sst_nclim] & sst_nclim=smooth(sst_nclim,nsmooth,/nan) & sst_nclim=sst_nclim[365:365+364]
68
69time=time & jpt=n_elements(time)
70
71caldat, time,mon,day,yea
72trop_clim=trop*0. & era_clim=trop*0.
73oafl_clim=trop*0. & nce_clim=trop*0.
74nce2_clim=trop*0. & sst_clim=trop*0.
75
76for 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)
84endfor
85
86trop_ano=trop-trop_clim & oafl_ano=oafl-oafl_clim
87nce2_ano=nce2-nce2_clim & era_ano=era-era_clim
88nce_ano=nce-nce_clim    & sst_ano=sst-sst_clim
89
90trop_hf=trop*0. & nce2_hf=trop*0.
91oafl_hf=trop*0. & era_hf=trop*0.
92nce_hf=trop*0.
93
94Thf=1 & Tlf=90
95tsamp=1.   ; monthly
96freq=findgen(jpt/2+1)/(jpt*tsamp)
97freq=[freq,-1.*reverse(freq(1:jpt/2))]
98peri=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;
126help, trop_hf, nce2_hf, era_hf, nce_hf
127
128trop_ano=trop_ano-trop_hf & oafl_ano=oafl_ano-oafl_hf
129nce2_ano=nce2_ano-nce2_hf & era_ano=era_ano-era_hf
130nce_ano=nce_ano-nce_hf
131
132nsmooth=30.
133marge=[-3,-3,0,4]
134
135pltt, 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
139nsmooth=90.
140
141pltt, 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
144pltt, ts_smooth(oafl,nsmooth,/nan), "t",/ov1d, color=145
145pltt, ts_smooth(era,nsmooth,/nan), "t",/ov1d, color=190
146pltt, ts_smooth(nce2,nsmooth,/nan), "t",/ov1d, color=250
147pltt, ts_smooth(nce,nsmooth,/nan), "t",/ov1d, color=65
148
149nsmooth=120
150pltt, 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=""
153pltt, ts_smooth(oafl_ano,nsmooth,/nan), "t",/ov1d, color=145
154pltt, ts_smooth(era_ano,nsmooth,/nan), "t",/ov1d, color=190
155pltt, ts_smooth(nce2_ano,nsmooth,/nan), "t",/ov1d, color=250
156pltt, ts_smooth(nce_ano,nsmooth,/nan), "t",/ov1d, color=65
157
158closeps
159fig='fig16_timeseries_nino3.ps'
160spawn, 'mv '+psdir+'idl.ps '+cpsdir+fig
161spawn, 'gv '+cpsdir+fig
162return
163end
164function x_site_location, site
165    n1=strpos(site, 's')
166if (n1 gt -1) then begin
167    ns=-1.
168    x=strmid(site, 0, n1)
169    x=float(x)*ns
170endif else begin
171    n1=strpos(site, 'n')
172    x=strmid(site, 0, n1)
173    ny=1.
174    x=float(x)*ny
175endelse
176return, float(x)
177end
178function y_site_location, site
179    n1=strpos(site, 'e')
180if (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
189endif 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
200endelse
201return,float(y)
202end
Note: See TracBrowser for help on using the repository browser.