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

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

fix some svn propset

  • Property svn:executable set to *
  • Property svn:keywords set to Id URL
File size: 14.7 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;  date1 = 19890101L
52;  date2 = 20091231L
53;  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;
97sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
98           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $
99           '8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
100          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
101          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
102          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
103          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
104          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $
105          '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
106          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
107;
108ocean='global'
109;
110sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
111           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e']
112ocean='IO'
113;
114;sitelist=['8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
115;          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
116;          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
117;          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
118;          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
119;          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w']
120;ocean='Pac'
121;
122;sitelist=['0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
123;          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
124;ocean='AO'
125;
126;sitelist=['8s165e', '8s180w',  '8s155w','5s156e', '5s165e', '5s180w', '5s170w','2s156e', '2s165e', '2s180w', $
127;          '2s170w','0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '2n147e', '2n156e', '2n165e', '2n180w', $
128;          '2n170w', '5n147e', '5n156e', '5n165e', '5n170w', '8n156e', '8n165e', '8n180w', '8n170w', '9n140w',$
129;          '8n125w', '8n110w', '8n95w']
130;ocean='Pac_warmpool'
131;
132;sitelist=['8s125w', '8s110w', '8s95w','5s155w', '5s140w', '5s125w', '5s110w', '5s95w','2s155w', '2s140w', $
133;          '2s125w', '2s110w', '2s95w', '0n155w', '0n140w', '0n125w', '0n110w', '0n95w', '2n155w', '2n140w', $
134;         '2n125w', '2n110w', '2n95w',  '5n155w', '5n140w', '5n125w', '5n110w', '5n95w']
135;ocean='Pac_coldtongue'
136;
137;sitelist=['0n0e','0n35w', '4n23w', '4n38w', '8n38w']
138;ocean='AO_warmpool'
139;
140;sitelist=['0n10w','0n23w','10s10w','12n23w','12n38w','14s32w','15n38w', '19s34w','20n38w', $
141;          '21n23w', '6s10w', '8s30w']
142;ocean='AO_coldtongue'
143;
144nsmooth=1.    ; statistics are with 7 day smoothed
145;   This program will create the following text files with statistics of respective variables
146close,/all
147;
148fi_air_erai=project_id_env+'air_2000_2009_erai_'+ocean+'.txt'
149openw,1,fi_air_erai
150fi_air_trop=project_id_env+'air_2000_2009_trop_'+ocean+'.txt'
151openw,2,fi_air_trop
152fi_air_oaflx=project_id_env+'air_2000_2009_oaflx_'+ocean+'.txt'
153openw,3,fi_air_oaflx
154fi_air_ncep2=project_id_env+'air_2000_2009_ncep2_'+ocean+'.txt'
155openw,4,fi_air_ncep2
156fi_air_ncep1=project_id_env+'air_2000_2009_ncep1_'+ocean+'.txt'
157openw,5,fi_air_ncep1
158;
159printf,1, 'x     y      cor    bias     std     rmsd    mean_tao'
160printf,2, 'x     y      cor    bias     std     rmsd    mean_tao'
161printf,3, 'x     y      cor    bias     std     rmsd    mean_tao'
162printf,4, 'x     y      cor    bias     std     rmsd    mean_tao'
163printf,5, 'x     y      cor    bias     std     rmsd    mean_tao'
164;
165; first reading the whole ERAI uncorrected and corrected data
166;
167file=project_id_env+'erai_t2m_19890101_20091231_oafluxgrid.nc'
168initncdf, file
169unc=read_ncdf('t2m',date1,date2,file=file,/nostr)
170unc=unc-273.15
171help, unc
172;
173;save, unc, cor, oaf, nce, nce1, filename="airt_unc_cor_oaf_nce_nce1_2000_2009_global.idl"
174restore, file="/Users/pkb/work/MY_SAXO/airt_unc_cor_oaf_nce_nce1_2000_2009_global.idl"
175help, unc, cor, oaf, nce, nce1
176;
177nn=n_elements(sitelist)
178for n=0, nn-1 do begin
179;
180; reading data from mooring
181;
182    site=sitelist(n)
183csite=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
189    dy=0.5
190    box=[y-dy, y+dy, x-dx, x+dx]
191    read_variables_v2, csite,date1,date2,nsmooth, $
192         at, sw,rh,sst,wu,wv,ws,lh
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;  extracting the corrected and uncorrected ERAI data at the locations
200    nsmooth=1.
201;
202    extract_flux_tropflux,unc,box, $
203        tropflux
204    uncr=tropflux
205;
206     extract_flux_tropflux,cor,box, $
207        tropflux
208     corr=tropflux
209;
210     extract_flux_tropflux,oaf,box, $
211        tropflux
212     oafl=tropflux
213;
214     extract_flux_tropflux,nce,box, $
215        tropflux
216     ncep=tropflux
217;
218     extract_flux_tropflux,nce1,box, $
219        tropflux
220     ncep1=tropflux
221;
222    ind=where(finite(air))
223    air=air(ind)
224    uncr_air=uncr(ind)
225    corr_air=corr(ind)
226    oafl=oafl(ind)
227    ncep=ncep(ind)
228    ncep1=ncep1(ind)
229    mean_tao=total(air,/nan)/n_elements(ind)
230;
231    statistics_3var_v1, air, uncr_air, corr_air, $
232         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
233;
234    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)'
235    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)'
236;
237    statistics_3var_v1, air, oafl, ncep, $
238         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
239    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)'
240    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)'
241;
242    statistics_3var_v1, air, ncep1, ncep, $
243         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
244    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)'
245;
246endfor
247close,/all
248;
249fi_air_erai=project_id_env+'air_2000_2009_erai_'+ocean+'.txt'
250res=read_ascii(fi_air_erai,data_start=1)
251ff=res.field1
252lat=reform(ff(0,*))
253lon=reform(ff(1,*))
254cor_era=reform(ff(2,*))
255cor_erai=total(cor_era)/n_elements(cor_era)
256bias_era=reform(ff(3,*))
257bias_erai=total(bias_era)/n_elements(bias_era)
258std_era=reform(ff(4,*))
259std_erai=total(std_era)/n_elements(std_era)
260rmsd_era=reform(ff(5,*))
261rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
262mean_tao=reform(ff(6,*))
263mean_erai=bias_era+mean_tao
264;
265print, ''
266print, 'ERAI'
267print, cor_erai, bias_erai, std_erai, rmsd_erai
268cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
269splot, mean_tao, mean_erai, title='T2m - TAO Vs ERAI', subtitle='', $
270     charsize=1.1, xtitle='TAO T2m', ytitle='ERAI T2m', small=[2,3,1], psym=2, $
271     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
272xyouts, 22.3,30.2, cstat, charsize=0.9
273xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
274;
275oplot, [22,31], [22,31]
276ab=linfit(mean_tao, mean_erai,yfit=yfit)
277a=float(ab(0))
278b=float(ab(1))
279oplot, mean_tao, yfit, color=250, thick=2
280;
281fi_air_trop=project_id_env+'air_2000_2009_trop_'+ocean+'.txt'
282res=read_ascii(fi_air_trop,data_start=1)
283ff=res.field1
284lat=reform(ff(0,*))
285lon=reform(ff(1,*))
286cor_tro=reform(ff(2,*))
287cor_trop=total(cor_tro)/n_elements(cor_tro)
288bias_tro=reform(ff(3,*))
289bias_trop=total(bias_tro)/n_elements(bias_tro)
290std_tro=reform(ff(4,*))
291std_trop=total(std_tro)/n_elements(std_tro)
292rmsd_tro=reform(ff(5,*))
293rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
294mean_tao=reform(ff(6,*))
295mean_trop=bias_tro+mean_tao
296;
297print, ''
298print, 'TropFlux'
299print, cor_trop, bias_trop, std_trop, rmsd_trop
300cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
301;
302splot, mean_tao, mean_trop, title='T2m - TAO Vs TropFlux', subtitle='', $
303     charsize=1.1, xtitle='TAO T2m', ytitle='TropFlux T2m', small=[2,3,2],/noer, psym=2, $
304     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
305oplot, [22,31], [22,31]
306xyouts, 22.3,30.2, cstat, charsize=0.9
307xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
308;
309ab=linfit(mean_tao, mean_trop,yfit=yfit)
310a=float(ab(0))
311b=float(ab(1))
312oplot, mean_tao, yfit, color=250, thick=2
313;
314fi_air_oaflx=project_id_env+'air_2000_2009_oaflx_'+ocean+'.txt'
315res=read_ascii(fi_air_oaflx,data_start=1)
316ff=res.field1
317lat=reform(ff(0,*))
318lon=reform(ff(1,*))
319cor_oaf=reform(ff(2,*))
320cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
321bias_oaf=reform(ff(3,*))
322bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
323std_oaf=reform(ff(4,*))
324std_oafl=total(std_oaf)/n_elements(std_oaf)
325rmsd_oaf=reform(ff(5,*))
326rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
327mean_tao=reform(ff(6,*))
328mean_oafl=bias_oaf+mean_tao
329;
330print, ''
331print, 'OAFlux'
332print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
333cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
334;
335splot, mean_tao, mean_oafl, title='T2m - TAO Vs OAFlux', subtitle='', $
336     charsize=1.1, xtitle='TAO T2m', ytitle='OAFlux T2m', small=[2,3,3],/noer, psym=2, $
337     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
338oplot, [22,31], [22,31]
339xyouts, 22.3,30.2, cstat, charsize=0.9
340xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
341;
342ab=linfit(mean_tao, mean_oafl,yfit=yfit)
343a=float(ab(0))
344b=float(ab(1))
345oplot, mean_tao, yfit, color=250, thick=2
346;
347fi_air_ncep=project_id_env+'air_2000_2009_ncep2_'+ocean+'.txt'
348res=read_ascii(fi_air_ncep,data_start=1)
349ff=res.field1
350lat=reform(ff(0,*))
351lon=reform(ff(1,*))
352cor_nce=reform(ff(2,*))
353cor_ncep=total(cor_nce)/n_elements(cor_nce)
354bias_nce=reform(ff(3,*))
355bias_ncep=total(bias_nce)/n_elements(bias_nce)
356std_nce=reform(ff(4,*))
357std_ncep=total(std_nce)/n_elements(std_nce)
358rmsd_nce=reform(ff(5,*))
359rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
360mean_tao=reform(ff(6,*))
361mean_ncep=bias_nce+mean_tao
362;
363print, ''
364print, 'NCEP2'
365print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
366cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
367;
368splot, mean_tao, mean_ncep, title='T2m - TAO Vs NCEP2', subtitle='', $
369     charsize=1.1, xtitle='TAO T2m', ytitle='NCEP2 T2m', small=[2,3,4],/noer, psym=2, $
370     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
371oplot, [22,31], [22,31]
372xyouts, 22.3,30.2, cstat, charsize=0.9
373xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
374;
375ab=linfit(mean_tao, mean_ncep,yfit=yfit)
376a=float(ab(0))
377b=float(ab(1))
378oplot, mean_tao, yfit, color=250, thick=2
379;
380fi_air_ncep1=project_id_env+'air_2000_2009_ncep1_'+ocean+'.txt'
381res=read_ascii(fi_air_ncep1,data_start=1)
382ff=res.field1
383lat=reform(ff(0,*))
384lon=reform(ff(1,*))
385cor_nce=reform(ff(2,*))
386cor_ncep=total(cor_nce)/n_elements(cor_nce)
387bias_nce=reform(ff(3,*))
388bias_ncep=total(bias_nce)/n_elements(bias_nce)
389std_nce=reform(ff(4,*))
390std_ncep=total(std_nce)/n_elements(std_nce)
391rmsd_nce=reform(ff(5,*))
392rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
393mean_tao=reform(ff(6,*))
394mean_ncep=bias_nce+mean_tao
395;
396print, ''
397print, 'NCEP1'
398print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
399cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
400;
401splot, mean_tao, mean_ncep, title='T2m - TAO Vs NCEP_NCAR', subtitle='', $
402     charsize=1.1, xtitle='TAO T2m', ytitle='NCEP', small=[2,3,5],/noer, psym=2, $
403     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
404oplot, [22,31], [22,31]
405xyouts, 22.3,30.2, cstat, charsize=0.9
406xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
407;
408ab=linfit(mean_tao, mean_ncep,yfit=yfit)
409a=float(ab(0))
410b=float(ab(1))
411oplot, mean_tao, yfit, color=250, thick=2
412;
413closeps
414;
415end
Note: See TracBrowser for help on using the repository browser.