source: trunk/src/paper01/fig11/swr_isccp_tropflux_new_v1.pro @ 94

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

get rid of multistatement lines

  • Property svn:keywords set to URL
File size: 5.3 KB
Line 
1;+
2;
3; .. _swr_isccp_tropflux_new_v1.pro:
4;
5; =============================
6; swr_isccp_tropflux_new_v1.pro
7; =============================
8;
9; DESCRIPTION
10; ===========
11;
12; :file:`${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc`
13; containing
14; sst corrected on OAFLUX grid
15; has been produced by
16; :ref:`sst_correction_ncdf.pro`.
17;
18; ++ are written in
19; :file:`${PROJECT_OD}/correlation_isccp_olr.idl`
20;
21; This output file
22; :file:`${PROJECT_OD}/correlation_isccp_olr.idl`
23; will be used by :ref:`swr_isccp_tropflux_correlation_fig10.pro`.
24
25; .. graphviz::
26;
27;    digraph swr_isccp_tropflux_new_v1 {
28;
29;       swr [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/swr_oafluxgrid_1985_2007.nc"];
30;       sw [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/sw_reconstred_1989_2009.nc"];
31;       olr [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/olr_oafluxgrid_30n30s.nc"];
32;       sst [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/TropFlux_sst_19890101_20091231.nc"];
33;       cor_olr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/correlation_isccp_olr.idl"];
34;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/correlation_rmsd_olra_swra_smooth.ps"];
35;
36;       swr_isccp_tropflux_new_v1 [shape=box,
37;       fontname=Courier,
38;       color=blue,
39;       URL="http://forge.ipsl.jussieu.fr/tropflux/broswrer/trunk/src/paper01/fig11/swr_isccp_tropflux_new_v1.pro",
40;       label="${TROPFLUX}/src/paper01/fig11/swr_isccp_tropflux_new_v1.pro"];
41;
42;       {swr sw olr sst} -> {swr_isccp_tropflux_new_v1} -> {col_olr figure}
43;    }
44;
45; SEE ALSO
46; ========
47;
48; :ref:`project_profile.sh`
49; :ref:`project_init.pro`
50; :ref:`cm_project.pro`
51;
52; EXAMPLES
53; ========
54;
55; ::
56;
57;  IDL> swr_isccp_tropflux_new_v1
58;
59; TODO
60; ====
61;
62; make it work on cratos : missing data swr_oafluxgrid_1985_2007.nc, etc.
63;
64; no more save to avoid IDL dependant files
65;
66; coding rules
67;
68; complete description
69;
70; handle IO error
71;
72; EVOLUTIONS
73; ==========
74;
75; $Id$
76;
77; $URL$
78;
79; - fplod 20110817T100234Z aedon.locean-ipsl.upmc.fr (Darwin)
80;
81;   * remove _v20 in filename
82;   * add PROJECT_OD to saved file
83;
84; - fplod 20110420T113330Z aedon.locean-ipsl.upmc.fr (Darwin)
85;
86;   * remove hard coding path
87;   * add graphviz
88;
89; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
90;
91;   * minimal header
92;
93;-
94pro swr_isccp_tropflux_new_v1
95;
96@cm_4cal
97@cm_4data
98@cm_4mesh
99@cm_4data
100@cm_project
101;
102reinitplt, /z,/invert
103key_portrait = 1
104
105openps, FILENAME = project_od_env+'correlation_rmsd_olra_swra_smooth.ps'
106st=19890101
107en=20071231
108
109file=project_od_env+'swr_oafluxgrid_1985_2007.nc'
110initncdf, file
111sw_isccp=read_ncdf("swr", st, en, file=file,/nostr)
112
113file=project_od_env+'sw_reconstred_1989_2009.nc'
114initncdf, file
115sw_trop=read_ncdf("sw", st, en+1, file=file,/nostr)
116
117file=project_od_env+'olr_oafluxgrid_30n30s.nc'
118initncdf, file
119olr=read_ncdf("olr", st, en, file=file,/nostr)
120
121help, sw_isccp, sw_trop , olr
122
123;;creating climatology
124
125ny=(2007-1989)+1
126nt=365*ny
127
128olri=total(reform(olr(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny
129swi=total(reform(sw_isccp(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny
130help, olri, swi
131
132;; applying smoothing
133nsmooth=45
134
135swi=[[[swi]],[[swi]],[[swi]]]
136olri=[[[olri]],[[olri]],[[olri]]]
137si=size(sw)
138n1=si(1)
139n2=si(2)
140
141for j=0,n2-1 do begin
142  for i=0,n1-1 do begin
143    x=reform(swi(i,j,*))
144    y=reform(olri(i,j,*))
145    swi(i,j,*)=smooth(x,nsmooth)
146    olri(i,j,*)=smooth(y,nsmooth)
147  endfor
148endfor
149
150swi=swi[*,*,365:365+364]
151olri=olri[*,*,365:365+364]
152help, swi, olri
153
154caldat, time,mon,day,yea
155swm=olr*0.
156olrm=olr*0.
157for jt=0,jpt-1 do begin
158  jtt=(time(jt)-julday(1,1,yea(jt))) < 364
159  swm(*,*,jt)=swi(*,*,jtt)
160  olrm(*,*,jt)=olri(*,*,jtt)
161  print, jt
162endfor
163swa=sw_isccp-swm        ; swr anomaly
164olra=olr-olrm     ; olr anomaly
165help, swa, olra
166m=reform(sw_trop(*,*,0))
167tmask=finite(m)
168cor_olr=fltarr(jpi,jpj)+!values.f_nan
169rms_olr=fltarr(jpi,jpj)+!values.f_nan
170
171for jj=0,jpj-1 do begin
172  for ji=0,jpi-1 do begin
173    if (tmask(ji,jj)) then begin
174      print, 'over',jj, '/', jpj-1
175
176      swr_ano=reform(swa(ji,jj,*))
177      olr_ano=reform(olra(ji,jj,*))
178
179      cor_olr(ji,jj)=correlate(swr_ano,olr_ano)
180      rms_olr(ji,jj)=(total((swr_ano-olr_ano)^2)/(jpt-1l))^.5
181
182    endif
183  endfor
184endfor
185
186cor=fltarr(jpi,jpj)+!values.f_nan
187rms=fltarr(jpi,jpj)+!values.f_nan
188for jj=1,jpj-2 do begin
189  for ji=1,jpi-2 do begin
190    if (tmask(ji,jj)) then begin
191       cor(ji,jj)=(cor_olr(ji-1,jj)+cor_olr(ji+1,jj)+cor_olr(ji,jj-1)+cor_olr(ji,jj+1))*tmask(ji,jj)/(tmask(ji-1,jj)+tmask(ji+1,jj)+tmask(ji,jj-1)+tmask(ji,jj+1))
192    endif
193  endfor
194endfor
195
196save, cor, cor_olr, filename=project_od_env + 'correlation_isccp_olr.idl'
197
198lct=64
199cs=0.9
200marge1=[0,0,-5,0]
201help, cor
202
203plt, cor_olr,0.5,1, lct=lct, $
204     small=[1,4,1],/rempl,/noer,/nocont, $
205     charsize=cs,/nocolorb,marge=marge, $
206     subt='',title='a) Correlation (OLRA, SWRA)',xminor=1,yminor=1
207
208file=project_od_env+'TropFlux_sst_19890101_20091231.nc"
209initncdf, file
210sst=read_ncdf("sst", 19890101, 20091231, file=file,/nostr)
211sst=grossemoyenne(sst, "t",/nan)
212
213plt, cor_olr,0.5,1, lct=lct, $
214     small=[1,4,3],/rempl,/noer,/nocont, $
215     charsize=cs,marge=marge, $
216     subt='',title='a) Correlation (OLRA, SWRA)',xminor=1,yminor=1, $
217     contour=sst, contmin=26.5, contmax=28.5, contint=1.
218
219plt, rms_olr, lct=lct, $
220     small=[1,4,4],/rempl,/noer,/nocont, $
221     charsize=cs, marge=marge,/nocolorb, $
222     subt='',title='b) RMS Difference (OLRA, SWRA)',xminor=1,yminor=1
223
224closeps
225end
Note: See TracBrowser for help on using the repository browser.