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 |
---|
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 | ;- |
---|
95 | pro swr_isccp_tropflux_new_v1 |
---|
96 | ; |
---|
97 | @cm_4cal |
---|
98 | @cm_4data |
---|
99 | @cm_4mesh |
---|
100 | @cm_4data |
---|
101 | @cm_project |
---|
102 | ; |
---|
103 | reinitplt, /z,/invert |
---|
104 | key_portrait = 1 |
---|
105 | ; |
---|
106 | openps, FILENAME = project_od_env+'correlation_rmsd_olra_swra_smooth.ps' |
---|
107 | st=19890101 |
---|
108 | en=20071231 |
---|
109 | ; |
---|
110 | file=project_od_env+'swr_oafluxgrid_1985_2007.nc' |
---|
111 | initncdf, file |
---|
112 | sw_isccp=read_ncdf("swr", st, en, file=file,/nostr) |
---|
113 | ; |
---|
114 | file=project_od_env+'sw_reconstred_1989_2009.nc' |
---|
115 | initncdf, file |
---|
116 | sw_trop=read_ncdf("sw", st, en+1, file=file,/nostr) |
---|
117 | ; |
---|
118 | file=project_od_env+'olr_oafluxgrid_30n30s.nc' |
---|
119 | initncdf, file |
---|
120 | olr=read_ncdf("olr", st, en, file=file,/nostr) |
---|
121 | ; |
---|
122 | help, sw_isccp, sw_trop , olr |
---|
123 | ; |
---|
124 | ;creating climatology |
---|
125 | ; |
---|
126 | ny=(2007-1989)+1 |
---|
127 | nt=365*ny |
---|
128 | ; |
---|
129 | olri=total(reform(olr(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny |
---|
130 | swi=total(reform(sw_isccp(*,*,0:nt-1),nxt,nyt,365,ny),4)/ny |
---|
131 | help, olri, swi |
---|
132 | ; |
---|
133 | ; applying smoothing |
---|
134 | nsmooth=45 |
---|
135 | ; |
---|
136 | swi=[[[swi]],[[swi]],[[swi]]] |
---|
137 | olri=[[[olri]],[[olri]],[[olri]]] |
---|
138 | si=size(sw) |
---|
139 | n1=si(1) |
---|
140 | n2=si(2) |
---|
141 | ; |
---|
142 | for 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 |
---|
149 | endfor |
---|
150 | ; |
---|
151 | swi=swi[*,*,365:365+364] |
---|
152 | olri=olri[*,*,365:365+364] |
---|
153 | help, swi, olri |
---|
154 | ; |
---|
155 | caldat, time,mon,day,yea |
---|
156 | swm=olr*0. |
---|
157 | olrm=olr*0. |
---|
158 | for 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 |
---|
163 | endfor |
---|
164 | swa=sw_isccp-swm ; swr anomaly |
---|
165 | olra=olr-olrm ; olr anomaly |
---|
166 | help, swa, olra |
---|
167 | m=reform(sw_trop(*,*,0)) |
---|
168 | tmask=finite(m) |
---|
169 | cor_olr=fltarr(jpi,jpj)+!values.f_nan |
---|
170 | rms_olr=fltarr(jpi,jpj)+!values.f_nan |
---|
171 | ; |
---|
172 | for 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 |
---|
185 | endfor |
---|
186 | ; |
---|
187 | cor=fltarr(jpi,jpj)+!values.f_nan |
---|
188 | rms=fltarr(jpi,jpj)+!values.f_nan |
---|
189 | for 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 |
---|
195 | endfor |
---|
196 | ; |
---|
197 | save, cor, cor_olr, filename=project_od_env + 'correlation_isccp_olr.idl' |
---|
198 | ; |
---|
199 | lct=64 |
---|
200 | cs=0.9 |
---|
201 | marge1=[0,0,-5,0] |
---|
202 | help, cor |
---|
203 | ; |
---|
204 | plt, 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 | ; |
---|
209 | file=project_od_env+'TropFlux_sst_19890101_20091231.nc" |
---|
210 | initncdf, file |
---|
211 | sst=read_ncdf("sst", 19890101, 20091231, file=file,/nostr) |
---|
212 | sst=grossemoyenne(sst, "t",/nan) |
---|
213 | ; |
---|
214 | plt, 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 | ; |
---|
220 | plt, 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 | ; |
---|
225 | closeps |
---|
226 | ; |
---|
227 | end |
---|