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

Last change on this file since 175 was 175, checked in by pinsard, 12 years ago

an other bunch of new functions

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