source: trunk/src/paper01/fig7/q2m_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.6 KB
Line 
1;+
2; .. _q2m_validation_scatter_2000_2009_basin.pro:
3;
4; ==========================================
5; q2m_validation_scatter_2000_2009_basin.pro
6; ==========================================
7;
8; DESCRIPTION
9; ===========
10;
11; .. graphviz::
12;
13;    digraph q2m_validation_scatter_2000_2009_basin {
14;
15;       q2m_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_2000_2009_erai_*.txt"];
16;       q2m_erai_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_q2m_19890101_20091231_oafluxgrid.nc"];
17;       q2m_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_trop_*.txt"];
18;       q2m_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_oaflx_*.txt"];
19;       q2m_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_ncep_*.txt"];
20;       q2m_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_ncep1_*.txt"];
21;
22;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_validation_scatter_2000_2009_basin.ps"];
23;
24;       q2m_validation_scatter_2000_2009_basin [shape=box,
25;       fontname=Courier,
26;       color=blue,
27;       URL="http://forge.ipsl.jussieu.fr/tropflux/broq2mer/trunk/src/paper01/fig7/q2m_validation_scatter_2000_2009_basin.pro",
28;       label="${TROPFLUX}/src/paper01/fig7/q2m_validation_scatter_2000_2009_basin.pro"];
29;
30;       {q2m_erai q2m_erai_2} -> {q2m_validation_scatter_2000_2009_basin} -> {q2m_tropflux q2m_oafluxq2m_ncep q2m_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;  q2m_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 20110420T101050Z aedon.locean-ipsl.upmc.fr (Darwin)
76;
77;   * remove hard coding path
78;   * add graphviz
79;   * externalize functions
80;
81; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
82;
83;   * minimal header
84;
85;-
86;
87pro q2m_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+'q2m_validation_scatter_2000_2009_'+ocean+'.ps'
94;
95; Give the location of mooring for validation of basic meteorological variables
96sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
97           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $
98           '8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
99          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
100          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
101          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
102          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
103          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $
104          '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
105          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
106;
107ocean='global'
108;
109sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
110           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e']
111ocean='IO'
112;
113sitelist=['8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
114          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
115          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
116          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
117          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
118          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w']
119ocean='Pac'
120;
121sitelist=['0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
122          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
123ocean='AO'
124;
125sitelist=['8s165e', '8s180w',  '8s155w','5s156e', '5s165e', '5s180w', '5s170w','2s156e', '2s165e', '2s180w', $
126          '2s170w','0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '2n147e', '2n156e', '2n165e', '2n180w', $
127          '2n170w', '5n147e', '5n156e', '5n165e', '5n170w', '8n156e', '8n165e', '8n180w', '8n170w', '9n140w',$
128          '8n125w', '8n110w', '8n95w']
129ocean='Pac_warmpool'
130;
131;sitelist=['8s125w', '8s110w', '8s95w','5s155w', '5s140w', '5s125w', '5s110w', '5s95w','2s155w', '2s140w', $
132;          '2s125w', '2s110w', '2s95w', '0n155w', '0n140w', '0n125w', '0n110w', '0n95w', '2n155w', '2n140w', $
133;          '2n125w', '2n110w', '2n95w',  '5n155w', '5n140w', '5n125w', '5n110w', '5n95w']
134;ocean='Pac_coldtongue'
135;
136;sitelist=['0n0e','0n35w', '4n23w', '4n38w', '8n38w']
137;ocean='AO_warmpool'
138;
139;sitelist=['0n10w','0n23w','10s10w','12n23w','12n38w','14s32w','15n38w', '19s34w','20n38w', $
140;          '21n23w', '6s10w', '8s30w']
141;ocean='AO_coldtongue'
142;
143nsmooth=1.    ; statistics are with 7 day smoothed
144;   This program will create the following text files with statistics of respective variables
145close,/all
146;
147fi_q2m_erai=project_id_env+'q2m_2000_2009_erai_'+ocean+'.txt'
148openw,1,fi_q2m_erai
149fi_q2m_trop=project_id_env+'q2m_2000_2009_trop_'+ocean+'.txt'
150openw,2,fi_q2m_trop
151fi_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_'+ocean+'.txt'
152openw,3,fi_q2m_oaflx
153fi_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_'+ocean+'.txt'
154openw,4,fi_q2m_ncep
155fi_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_'+ocean+'.txt'
156openw,5,fi_q2m_ncep1
157;
158printf,1, 'x     y      cor    bias     std     rmsd    mean_tao'
159printf,2, 'x     y      cor    bias     std     rmsd    mean_tao'
160printf,3, 'x     y      cor    bias     std     rmsd    mean_tao'
161printf,4, 'x     y      cor    bias     std     rmsd    mean_tao'
162printf,5, 'x     y      cor    bias     std     rmsd    mean_tao'
163;
164; first reading the whole ERAI uncorrected and corrected data
165;
166file=project_id_env+'erai_q2m_19890101_20091231_oafluxgrid.nc'
167initncdf, file
168unc=read_ncdf('q2m',date1,date2,file=file,/nostr)
169help, unc
170;
171;save, unc, cor, oaf, nce, nce1, filename="q2m_era_trop_oaf_nce_nce1_2000_2009_global.idl"
172restore, file="/Users/pkb/work/MY_SAXO/q2m_era_trop_oaf_nce_nce1_2000_2009_global.idl"
173help, unc, cor, oaf, nce, nce1
174;
175nn=n_elements(sitelist)
176for n=0, nn-1 do begin
177;
178; reading data from mooring
179;
180    site=sitelist(n)
181    csite=site
182    print, csite
183    x=x_site_location(site)
184    y=y_site_location(site)
185    if (y ge 0. and y le 30.) then y=y+360.
186    dx=0.5
187    dy=0.5
188    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    q2m=rh_to_sphum(rh,at,1008)               ;        at  ->  q2m temperature
193;    q2m=at                                               ;        q2m ->  sea surface temperature
194                                                ;        lh  ->  latent heat flux
195                                                ;        rh  ->  relative humidity
196                                                ;   wu,wv,ws ->  wind speed
197;
198;  extracting the corrected and uncorrected ERAI data at the locations
199    nsmooth=1.
200;
201    extract_flux_tropflux,unc,box, $
202        tropflux
203    uncr=tropflux
204;
205     extract_flux_tropflux,cor,box, $
206        tropflux
207     corr=tropflux
208;
209     extract_flux_tropflux,oaf,box, $
210        tropflux
211     oafl=tropflux
212;
213     extract_flux_tropflux,nce,box, $
214        tropflux
215     ncep=tropflux
216;
217     extract_flux_tropflux,nce1,box, $
218        tropflux
219     ncep1=tropflux
220;
221    ind=where(finite(q2m))
222    q2m=q2m(ind)
223    uncr_q2m=uncr(ind)
224    corr_q2m=corr(ind)
225    oafl=oafl(ind)
226    ncep=ncep(ind)
227    ncep1=ncep1(ind)
228    mean_tao=total(q2m,/nan)/n_elements(ind)
229;
230    statistics_3var_v1, q2m, uncr_q2m, corr_q2m, $
231         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
232;
233    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)'
234    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)'
235;
236    statistics_3var_v1, q2m, oafl, ncep, $
237         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
238    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)'
239    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)'
240;
241    statistics_3var_v1, q2m, ncep1, ncep, $
242         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
243    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)'
244;
245endfor
246close,/all
247;
248fi_q2m_erai=project_id_env+'q2m_2000_2009_erai_'+ocean+'.txt'
249res=read_ascii(fi_q2m_erai,data_start=1)
250ff=res.field1
251lat=reform(ff(0,*))
252lon=reform(ff(1,*))
253cor_era=reform(ff(2,*))
254cor_erai=total(cor_era)/n_elements(cor_era)
255bias_era=reform(ff(3,*))
256bias_erai=total(bias_era)/n_elements(bias_era)
257std_era=reform(ff(4,*))
258std_erai=total(std_era)/n_elements(std_era)
259rmsd_era=reform(ff(5,*))
260rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
261mean_tao=reform(ff(6,*))
262mean_erai=bias_era+mean_tao
263;
264print, ''
265print, 'ERAI'
266print, cor_erai, bias_erai, std_erai, rmsd_erai
267cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
268splot, mean_tao, mean_erai, title='Q2m - TAO Vs ERAI', subtitle='', $
269     charsize=1.1, xtitle='TAO Q2m', ytitle='ERAI Q2m', small=[2,3,1], psym=2, $
270     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
271xyouts, 12,20.2, cstat, charsize=0.9
272xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
273;
274oplot, [11,21], [11,21]
275ab=linfit(mean_tao, mean_erai,yfit=yfit)
276a=float(ab(0))
277b=float(ab(1))
278oplot, mean_tao, yfit, color=250, thick=2
279;
280fi_q2m_trop=project_id_env+'q2m_2000_2009_trop_'+ocean+'.txt'
281res=read_ascii(fi_q2m_trop,data_start=1)
282ff=res.field1
283lat=reform(ff(0,*))
284lon=reform(ff(1,*))
285cor_tro=reform(ff(2,*))
286cor_trop=total(cor_tro)/n_elements(cor_tro)
287bias_tro=reform(ff(3,*))
288bias_trop=total(bias_tro)/n_elements(bias_tro)
289std_tro=reform(ff(4,*))
290std_trop=total(std_tro)/n_elements(std_tro)
291rmsd_tro=reform(ff(5,*))
292rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
293mean_tao=reform(ff(6,*))
294mean_trop=bias_tro+mean_tao
295;
296print, ''
297print, 'TropFlux'
298print, cor_trop, bias_trop, std_trop, rmsd_trop
299cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
300;
301splot, mean_tao, mean_trop, title='Q2m - TAO Vs TropFlux', subtitle='', $
302     charsize=1.1, xtitle='TAO Q2m', ytitle='TropFlux Q2m', small=[2,3,2],/noer, psym=2, $
303     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
304oplot, [11,21], [11,21]
305xyouts, 12,20.2, cstat, charsize=0.9
306xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
307;
308ab=linfit(mean_tao, mean_trop,yfit=yfit)
309a=float(ab(0))
310b=float(ab(1))
311oplot, mean_tao, yfit, color=250, thick=2
312;
313fi_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_'+ocean+'.txt'
314res=read_ascii(fi_q2m_oaflx,data_start=1)
315ff=res.field1
316lat=reform(ff(0,*))
317lon=reform(ff(1,*))
318cor_oaf=reform(ff(2,*))
319cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
320bias_oaf=reform(ff(3,*))
321bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
322std_oaf=reform(ff(4,*))
323std_oafl=total(std_oaf)/n_elements(std_oaf)
324rmsd_oaf=reform(ff(5,*))
325rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
326mean_tao=reform(ff(6,*))
327mean_oafl=bias_oaf+mean_tao
328;
329print, ''
330print, 'OAFlux'
331print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
332cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
333;
334splot, mean_tao, mean_oafl, title='Q2m - TAO Vs OAFlux', subtitle='', $
335     charsize=1.1, xtitle='TAO Q2m', ytitle='OAFlux Q2m', small=[2,3,3],/noer, psym=2, $
336     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
337oplot, [11,21], [11,21]
338xyouts, 12,20.2, cstat, charsize=0.9
339xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
340;
341ab=linfit(mean_tao, mean_oafl,yfit=yfit)
342a=float(ab(0))
343b=float(ab(1))
344oplot, mean_tao, yfit, color=250, thick=2
345;
346fi_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_'+ocean+'.txt'
347res=read_ascii(fi_q2m_ncep,data_start=1)
348ff=res.field1
349lat=reform(ff(0,*))
350lon=reform(ff(1,*))
351cor_nce=reform(ff(2,*))
352cor_ncep=total(cor_nce)/n_elements(cor_nce)
353bias_nce=reform(ff(3,*))
354bias_ncep=total(bias_nce)/n_elements(bias_nce)
355std_nce=reform(ff(4,*))
356std_ncep=total(std_nce)/n_elements(std_nce)
357rmsd_nce=reform(ff(5,*))
358rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
359mean_tao=reform(ff(6,*))
360mean_ncep=bias_nce+mean_tao
361;
362print, ''
363print, 'NCEP2'
364print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
365cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
366;
367splot, mean_tao, mean_ncep, title='Q2m - TAO Vs NCEP2', subtitle='', $
368     charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP2 Q2m', small=[2,3,4],/noer, psym=2, $
369     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
370oplot, [11,21], [11,21]
371xyouts, 12,20.2, cstat, charsize=0.9
372xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
373;
374ab=linfit(mean_tao, mean_ncep,yfit=yfit)
375a=float(ab(0))
376b=float(ab(1))
377oplot, mean_tao, yfit, color=250, thick=2
378;
379fi_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_'+ocean+'.txt'
380res=read_ascii(fi_q2m_ncep1,data_start=1)
381ff=res.field1
382lat=reform(ff(0,*))
383lon=reform(ff(1,*))
384cor_nce=reform(ff(2,*))
385cor_ncep=total(cor_nce)/n_elements(cor_nce)
386bias_nce=reform(ff(3,*))
387bias_ncep=total(bias_nce)/n_elements(bias_nce)
388std_nce=reform(ff(4,*))
389std_ncep=total(std_nce)/n_elements(std_nce)
390rmsd_nce=reform(ff(5,*))
391rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
392mean_tao=reform(ff(6,*))
393mean_ncep=bias_nce+mean_tao
394;
395print, ''
396print, 'NCEP1'
397print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
398cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
399;
400splot, mean_tao, mean_ncep, title='Q2m - TAO Vs NCEP', subtitle='', $
401     charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP1 Q2m', small=[2,3,5],/noer, psym=2, $
402     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
403oplot, [11,21], [11,21]
404xyouts, 12,20.2, cstat, charsize=0.9
405xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
406;
407ab=linfit(mean_tao, mean_ncep,yfit=yfit)
408a=float(ab(0))
409b=float(ab(1))
410oplot, mean_tao, yfit, color=250, thick=2
411;
412closeps
413;
414end
Note: See TracBrowser for help on using the repository browser.