source: trunk/src/paper01/fig7/air_validation_scatter_2000_2009_basin.pro @ 85

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

restart consolidation of paper01 software

  • Property svn:executable set to *
  • Property svn:keywords set to URL
File size: 14.8 KB
Line 
1;+
2; .. _air_validation_scatter_2000_2009_basin.pro:
3;
4; ==========================================
5; air_validation_scatter_2000_2009_basin.pro
6; ==========================================
7;
8; DESCRIPTION
9; ===========
10;
11; .. graphviz::
12;
13;    digraph air_validation_scatter_2000_2009_basin {
14,
15;       air_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/air_2000_2009_erai_*.txt"];
16;       air_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_trop_*.txt"];
17;       air_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_oaflx_*.txt"];
18;       air_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_ncep2_*.txt"];
19;       air_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_ncep1_*.txt"];
20;       t2m_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_t2m_19890101_20091231_oafluxgrid.nc"];
21;
22;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_validation_scatter_2000_2009_basin.ps"];
23;
24;       air_validation_scatter_2000_2009_basin [shape=box,
25;       fontname=Courier,
26;       color=blue,
27;       URL="http://forge.ipsl.jussieu.fr/tropflux/broairer/trunk/src/paper01/fig7/air_validation_scatter_2000_2009_basin.pro",
28;       label="${TROPFLUX}/src/paper01/fig7/air_validation_scatter_2000_2009_basin.pro"];
29;
30;       {air_tropflux t2m_erai} -> {air_validation_scatter_2000_2009_basin} -> {air_oaflux air_erai air_ncep2 air_ncep1 figure}
31;    }
32;
33; SEE ALSO
34; ========
35;
36; :ref:`project_profile.sh`
37; :ref:`project_init.pro`
38; :ref:`cm_project.pro`
39;
40; :func:`x_site_location`
41; :func:`y_site_location`
42;
43; :ref:`read_variables_v2.pro`
44; :ref:`statistics_3var_v1.pro`
45;
46; EXAMPLES
47; ========
48;
49; ::
50;
51;  IDL> date1=19890101L
52;  IDL> date2=20091231L
53;  IDL> air_validation_scatter_2000_2009_basin, date1, date2
54;
55; TODO
56; ====
57;
58; make it work on cratos : pb restore
59;
60; ++ mooring data in graphviz
61;
62; coding rules
63;
64; complete description
65;
66; handle IO error
67;
68; EVOLUTIONS
69; ==========
70;
71; $Id$
72;
73; $URL$
74;
75; - fplod 20110420T093206Z aedon.locean-ipsl.upmc.fr (Darwin)
76;
77;   * remove hard coding path
78;   * add graphviz
79;   * externalize functions
80;   * change name of procedure according to filename
81;
82; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
83;
84;   * minimal header
85;
86;-
87pro air_validation_scatter_2000_2009_basin, date1, date2
88@cm_general
89@cm_project
90reinitplt, /z,/invert
91key_portrait = 1
92
93openps, FILENAME = project_od_env+'air_validation_scatter_2000_2009_'+ocean+'.ps'
94
95;; Give the location of mooring for validation of basic meteorological variables
96
97
98sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
99           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $
100           '8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
101          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
102          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
103          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
104          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
105          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $
106          '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
107          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
108
109ocean='global'
110
111sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
112           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e']
113ocean='IO'
114
115;sitelist=['8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
116;          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
117;          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
118;          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
119;          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
120;          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w']
121;ocean='Pac'
122
123;sitelist=['0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
124;          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
125;ocean='AO'
126
127;sitelist=['8s165e', '8s180w',  '8s155w','5s156e', '5s165e', '5s180w', '5s170w','2s156e', '2s165e', '2s180w', $
128;          '2s170w','0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '2n147e', '2n156e', '2n165e', '2n180w', $
129;          '2n170w', '5n147e', '5n156e', '5n165e', '5n170w', '8n156e', '8n165e', '8n180w', '8n170w', '9n140w',$
130;          '8n125w', '8n110w', '8n95w']
131;ocean='Pac_warmpool'
132
133;sitelist=['8s125w', '8s110w', '8s95w','5s155w', '5s140w', '5s125w', '5s110w', '5s95w','2s155w', '2s140w', $
134;          '2s125w', '2s110w', '2s95w', '0n155w', '0n140w', '0n125w', '0n110w', '0n95w', '2n155w', '2n140w', $
135;         '2n125w', '2n110w', '2n95w',  '5n155w', '5n140w', '5n125w', '5n110w', '5n95w']
136;ocean='Pac_coldtongue'
137
138;sitelist=['0n0e','0n35w', '4n23w', '4n38w', '8n38w']
139;ocean='AO_warmpool'
140
141;sitelist=['0n10w','0n23w','10s10w','12n23w','12n38w','14s32w','15n38w', '19s34w','20n38w', $
142;          '21n23w', '6s10w', '8s30w']
143;ocean='AO_coldtongue'
144
145nsmooth=1.    ;; statistics are with 7 day smoothed
146;;   This program will create the following text files with statistics of respective variables
147close,/all
148
149fi_air_erai=project_id_env+'air_2000_2009_erai_'+ocean+'.txt'
150openw,1,fi_air_erai
151fi_air_trop=project_id_env+'air_2000_2009_trop_'+ocean+'.txt'
152openw,2,fi_air_trop
153fi_air_oaflx=project_id_env+'air_2000_2009_oaflx_'+ocean+'.txt'
154openw,3,fi_air_oaflx
155fi_air_ncep2=project_id_env+'air_2000_2009_ncep2_'+ocean+'.txt'
156openw,4,fi_air_ncep2
157fi_air_ncep1=project_id_env+'air_2000_2009_ncep1_'+ocean+'.txt'
158openw,5,fi_air_ncep1
159
160
161printf,1, 'x     y      cor    bias     std     rmsd    mean_tao'
162printf,2, 'x     y      cor    bias     std     rmsd    mean_tao'
163printf,3, 'x     y      cor    bias     std     rmsd    mean_tao'
164printf,4, 'x     y      cor    bias     std     rmsd    mean_tao'
165printf,5, 'x     y      cor    bias     std     rmsd    mean_tao'
166
167;; first reading the whole ERAI uncorrected and corrected data
168
169file=project_id_env+'erai_t2m_19890101_20091231_oafluxgrid.nc'
170initncdf, file
171unc=read_ncdf('t2m',date1,date2,file=file,/nostr) & unc=unc-273.15
172help, unc
173
174;save, unc, cor, oaf, nce, nce1, filename="airt_unc_cor_oaf_nce_nce1_2000_2009_global.idl"
175restore, file="/Users/pkb/work/MY_SAXO/airt_unc_cor_oaf_nce_nce1_2000_2009_global.idl"
176help, unc, cor, oaf, nce, nce1
177
178nn=n_elements(sitelist)
179for n=0, nn-1 do begin
180
181;; reading data from mooring
182
183    site=sitelist(n) & csite=site
184    print, csite
185    x=x_site_location(site)
186    y=y_site_location(site)
187    if (y ge 0. and y le 30.) then y=y+360.
188    dx=0.5 & dy=0.5 & box=[y-dy, y+dy, x-dx, x+dx]
189    read_variables_v2, csite,date1,date2,nsmooth, $
190         at, sw,rh,sst,wu,wv,ws,lh
191
192
193;    air=rh_to_sphum(rh,at,1008)               ;;        at  ->  air temperature
194    air=at                                               ;;        air ->  sea surface temperature
195                                                ;;        lh  ->  latent heat flux
196                                                ;;        rh  ->  relative humidity
197                                                ;;   wu,wv,ws ->  wind speed
198;;
199
200
201;;  extracting the corrected and uncorrected ERAI data at the locations
202    nsmooth=1.
203
204    extract_flux_tropflux,unc,box, $
205        tropflux
206    uncr=tropflux
207
208     extract_flux_tropflux,cor,box, $
209        tropflux
210     corr=tropflux
211
212     extract_flux_tropflux,oaf,box, $
213        tropflux
214     oafl=tropflux
215
216     extract_flux_tropflux,nce,box, $
217        tropflux
218     ncep=tropflux
219
220     extract_flux_tropflux,nce1,box, $
221        tropflux
222     ncep1=tropflux
223
224
225    ind=where(finite(air)) & air=air(ind) & uncr_air=uncr(ind)  & corr_air=corr(ind)
226    oafl=oafl(ind) & ncep=ncep(ind) & ncep1=ncep1(ind)
227    mean_tao=total(air,/nan)/n_elements(ind)
228
229    statistics_3var_v1, air, uncr_air, corr_air, $
230         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
231
232    printf, 1, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
233    printf, 2, x, y, cor2, bias2, std2, rmsd2, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
234
235    statistics_3var_v1, air, oafl, ncep, $
236         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
237    printf, 3, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
238    printf, 4, x, y, cor2, bias2, std2, rmsd2, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f6.2,3x,f4.2,3x,f4.2,3x,f6.2)'
239
240    statistics_3var_v1, air, ncep1, ncep, $
241         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
242    printf, 5, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
243
244endfor
245close,/all
246
247fi_air_erai=project_id_env+'air_2000_2009_erai_'+ocean+'.txt'
248res=read_ascii(fi_air_erai,data_start=1)
249ff=res.field1
250lat=reform(ff(0,*))
251lon=reform(ff(1,*))
252cor_era=reform(ff(2,*))   & cor_erai=total(cor_era)/n_elements(cor_era)
253bias_era=reform(ff(3,*))  & bias_erai=total(bias_era)/n_elements(bias_era)
254std_era=reform(ff(4,*))   & std_erai=total(std_era)/n_elements(std_era)
255rmsd_era=reform(ff(5,*))  & rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
256mean_tao=reform(ff(6,*))  & mean_erai=bias_era+mean_tao
257
258print, ''
259print, 'ERAI'
260print, cor_erai, bias_erai, std_erai, rmsd_erai
261cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
262splot, mean_tao, mean_erai, title='T2m - TAO Vs ERAI', subtitle='', $
263     charsize=1.1, xtitle='TAO T2m', ytitle='ERAI T2m', small=[2,3,1], psym=2, $
264     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
265xyouts, 22.3,30.2, cstat, charsize=0.9
266xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
267
268oplot, [22,31], [22,31]
269ab=linfit(mean_tao, mean_erai,yfit=yfit)
270a=float(ab(0)) & b=float(ab(1))
271oplot, mean_tao, yfit, color=250, thick=2
272
273fi_air_trop=project_id_env+'air_2000_2009_trop_'+ocean+'.txt'
274res=read_ascii(fi_air_trop,data_start=1)
275ff=res.field1
276lat=reform(ff(0,*))
277lon=reform(ff(1,*))
278cor_tro=reform(ff(2,*))   & cor_trop=total(cor_tro)/n_elements(cor_tro)
279bias_tro=reform(ff(3,*))  & bias_trop=total(bias_tro)/n_elements(bias_tro)
280std_tro=reform(ff(4,*))   & std_trop=total(std_tro)/n_elements(std_tro)
281rmsd_tro=reform(ff(5,*))  & rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
282mean_tao=reform(ff(6,*))  & mean_trop=bias_tro+mean_tao
283
284print, ''
285print, 'TropFlux'
286print, cor_trop, bias_trop, std_trop, rmsd_trop
287cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
288
289splot, mean_tao, mean_trop, title='T2m - TAO Vs TropFlux', subtitle='', $
290     charsize=1.1, xtitle='TAO T2m', ytitle='TropFlux T2m', small=[2,3,2],/noer, psym=2, $
291     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
292oplot, [22,31], [22,31]
293xyouts, 22.3,30.2, cstat, charsize=0.9
294xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
295
296ab=linfit(mean_tao, mean_trop,yfit=yfit)
297a=float(ab(0)) & b=float(ab(1))
298oplot, mean_tao, yfit, color=250, thick=2
299
300fi_air_oaflx=project_id_env+'air_2000_2009_oaflx_'+ocean+'.txt'
301res=read_ascii(fi_air_oaflx,data_start=1)
302ff=res.field1
303lat=reform(ff(0,*))
304lon=reform(ff(1,*))
305cor_oaf=reform(ff(2,*))   & cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
306bias_oaf=reform(ff(3,*))  & bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
307std_oaf=reform(ff(4,*))   & std_oafl=total(std_oaf)/n_elements(std_oaf)
308rmsd_oaf=reform(ff(5,*))  & rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
309mean_tao=reform(ff(6,*))  & mean_oafl=bias_oaf+mean_tao
310
311print, ''
312print, 'OAFlux'
313print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
314cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
315
316splot, mean_tao, mean_oafl, title='T2m - TAO Vs OAFlux', subtitle='', $
317     charsize=1.1, xtitle='TAO T2m', ytitle='OAFlux T2m', small=[2,3,3],/noer, psym=2, $
318     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
319oplot, [22,31], [22,31]
320xyouts, 22.3,30.2, cstat, charsize=0.9
321xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
322
323ab=linfit(mean_tao, mean_oafl,yfit=yfit)
324a=float(ab(0)) & b=float(ab(1))
325oplot, mean_tao, yfit, color=250, thick=2
326
327
328
329fi_air_ncep=project_id_env+'air_2000_2009_ncep2_'+ocean+'.txt'
330res=read_ascii(fi_air_ncep,data_start=1)
331ff=res.field1
332lat=reform(ff(0,*))
333lon=reform(ff(1,*))
334cor_nce=reform(ff(2,*))   & cor_ncep=total(cor_nce)/n_elements(cor_nce)
335bias_nce=reform(ff(3,*))  & bias_ncep=total(bias_nce)/n_elements(bias_nce)
336std_nce=reform(ff(4,*))   & std_ncep=total(std_nce)/n_elements(std_nce)
337rmsd_nce=reform(ff(5,*))  & rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
338mean_tao=reform(ff(6,*))  & mean_ncep=bias_nce+mean_tao
339
340print, ''
341print, 'NCEP2'
342print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
343cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
344
345splot, mean_tao, mean_ncep, title='T2m - TAO Vs NCEP2', subtitle='', $
346     charsize=1.1, xtitle='TAO T2m', ytitle='NCEP2 T2m', small=[2,3,4],/noer, psym=2, $
347     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
348oplot, [22,31], [22,31]
349xyouts, 22.3,30.2, cstat, charsize=0.9
350xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
351
352ab=linfit(mean_tao, mean_ncep,yfit=yfit)
353a=float(ab(0)) & b=float(ab(1))
354oplot, mean_tao, yfit, color=250, thick=2
355
356fi_air_ncep1=project_id_env+'air_2000_2009_ncep1_'+ocean+'.txt'
357res=read_ascii(fi_air_ncep1,data_start=1)
358ff=res.field1
359lat=reform(ff(0,*))
360lon=reform(ff(1,*))
361cor_nce=reform(ff(2,*))   & cor_ncep=total(cor_nce)/n_elements(cor_nce)
362bias_nce=reform(ff(3,*))  & bias_ncep=total(bias_nce)/n_elements(bias_nce)
363std_nce=reform(ff(4,*))   & std_ncep=total(std_nce)/n_elements(std_nce)
364rmsd_nce=reform(ff(5,*))  & rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
365mean_tao=reform(ff(6,*))  & mean_ncep=bias_nce+mean_tao
366
367print, ''
368print, 'NCEP1'
369print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
370cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
371
372splot, mean_tao, mean_ncep, title='T2m - TAO Vs NCEP_NCAR', subtitle='', $
373     charsize=1.1, xtitle='TAO T2m', ytitle='NCEP', small=[2,3,5],/noer, psym=2, $
374     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
375oplot, [22,31], [22,31]
376xyouts, 22.3,30.2, cstat, charsize=0.9
377xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
378
379ab=linfit(mean_tao, mean_ncep,yfit=yfit)
380a=float(ab(0)) & b=float(ab(1))
381oplot, mean_tao, yfit, color=250, thick=2
382
383closeps
384
385end
Note: See TracBrowser for help on using the repository browser.