source: trunk/src/paper01/fig7/q2m_validation_scatter_2000_2009_basin.pro @ 94

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

get rid of multistatement lines

  • Property svn:executable set to *
  • Property svn:keywords set to URL
File size: 14.7 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;  IDL> date1=19890101L
52;  IDL> date2=20091231L
53;  IDL> 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
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_q2m_19890101_20091231_oafluxgrid.nc'
168initncdf, file
169unc=read_ncdf('q2m',date1,date2,file=file,/nostr)
170help, unc
171
172;save, unc, cor, oaf, nce, nce1, filename="q2m_era_trop_oaf_nce_nce1_2000_2009_global.idl"
173restore, file="/Users/pkb/work/MY_SAXO/q2m_era_trop_oaf_nce_nce1_2000_2009_global.idl"
174help, unc, cor, oaf, nce, nce1
175
176nn=n_elements(sitelist)
177for n=0, nn-1 do begin
178
179;; reading data from mooring
180
181    site=sitelist(n)
182    csite=site
183    print, csite
184    x=x_site_location(site)
185    y=y_site_location(site)
186    if (y ge 0. and y le 30.) then y=y+360.
187    dx=0.5
188    dy=0.5
189    box=[y-dy, y+dy, x-dx, x+dx]
190    read_variables_v2, csite,date1,date2,nsmooth, $
191         at, sw,rh,sst,wu,wv,ws,lh
192
193
194    q2m=rh_to_sphum(rh,at,1008)               ;;        at  ->  q2m temperature
195;    q2m=at                                               ;;        q2m ->  sea surface temperature
196                                                ;;        lh  ->  latent heat flux
197                                                ;;        rh  ->  relative humidity
198                                                ;;   wu,wv,ws ->  wind speed
199;;
200
201
202;;  extracting the corrected and uncorrected ERAI data at the locations
203    nsmooth=1.
204
205    extract_flux_tropflux,unc,box, $
206        tropflux
207    uncr=tropflux
208
209     extract_flux_tropflux,cor,box, $
210        tropflux
211     corr=tropflux
212
213     extract_flux_tropflux,oaf,box, $
214        tropflux
215     oafl=tropflux
216
217     extract_flux_tropflux,nce,box, $
218        tropflux
219     ncep=tropflux
220
221     extract_flux_tropflux,nce1,box, $
222        tropflux
223     ncep1=tropflux
224
225    ind=where(finite(q2m))
226    q2m=q2m(ind)
227    uncr_q2m=uncr(ind) 
228    corr_q2m=corr(ind)
229    oafl=oafl(ind)
230    ncep=ncep(ind)
231    ncep1=ncep1(ind)
232    mean_tao=total(q2m,/nan)/n_elements(ind)
233
234    statistics_3var_v1, q2m, uncr_q2m, corr_q2m, $
235         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
236
237    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)'
238    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)'
239
240    statistics_3var_v1, q2m, oafl, ncep, $
241         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
242    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)'
243    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)'
244
245    statistics_3var_v1, q2m, ncep1, ncep, $
246         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
247    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)'
248
249endfor
250close,/all
251
252fi_q2m_erai=project_id_env+'q2m_2000_2009_erai_'+ocean+'.txt'
253res=read_ascii(fi_q2m_erai,data_start=1)
254ff=res.field1
255lat=reform(ff(0,*))
256lon=reform(ff(1,*))
257cor_era=reform(ff(2,*))   
258cor_erai=total(cor_era)/n_elements(cor_era)
259bias_era=reform(ff(3,*)) 
260bias_erai=total(bias_era)/n_elements(bias_era)
261std_era=reform(ff(4,*))   
262std_erai=total(std_era)/n_elements(std_era)
263rmsd_era=reform(ff(5,*)) 
264rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
265mean_tao=reform(ff(6,*)) 
266mean_erai=bias_era+mean_tao
267
268print, ''
269print, 'ERAI'
270print, cor_erai, bias_erai, std_erai, rmsd_erai
271cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
272splot, mean_tao, mean_erai, title='Q2m - TAO Vs ERAI', subtitle='', $
273     charsize=1.1, xtitle='TAO Q2m', ytitle='ERAI Q2m', small=[2,3,1], psym=2, $
274     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
275xyouts, 12,20.2, cstat, charsize=0.9
276xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
277
278oplot, [11,21], [11,21]
279ab=linfit(mean_tao, mean_erai,yfit=yfit)
280a=float(ab(0))
281b=float(ab(1))
282oplot, mean_tao, yfit, color=250, thick=2
283
284fi_q2m_trop=project_id_env+'q2m_2000_2009_trop_'+ocean+'.txt'
285res=read_ascii(fi_q2m_trop,data_start=1)
286ff=res.field1
287lat=reform(ff(0,*))
288lon=reform(ff(1,*))
289cor_tro=reform(ff(2,*))   
290cor_trop=total(cor_tro)/n_elements(cor_tro)
291bias_tro=reform(ff(3,*)) 
292bias_trop=total(bias_tro)/n_elements(bias_tro)
293std_tro=reform(ff(4,*))   
294std_trop=total(std_tro)/n_elements(std_tro)
295rmsd_tro=reform(ff(5,*)) 
296rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
297mean_tao=reform(ff(6,*)) 
298mean_trop=bias_tro+mean_tao
299
300print, ''
301print, 'TropFlux'
302print, cor_trop, bias_trop, std_trop, rmsd_trop
303cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
304
305splot, mean_tao, mean_trop, title='Q2m - TAO Vs TropFlux', subtitle='', $
306     charsize=1.1, xtitle='TAO Q2m', ytitle='TropFlux Q2m', small=[2,3,2],/noer, psym=2, $
307     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
308oplot, [11,21], [11,21]
309xyouts, 12,20.2, cstat, charsize=0.9
310xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
311
312ab=linfit(mean_tao, mean_trop,yfit=yfit)
313a=float(ab(0))
314b=float(ab(1))
315oplot, mean_tao, yfit, color=250, thick=2
316
317fi_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_'+ocean+'.txt'
318res=read_ascii(fi_q2m_oaflx,data_start=1)
319ff=res.field1
320lat=reform(ff(0,*))
321lon=reform(ff(1,*))
322cor_oaf=reform(ff(2,*))   
323cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
324bias_oaf=reform(ff(3,*)) 
325bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
326std_oaf=reform(ff(4,*))   
327std_oafl=total(std_oaf)/n_elements(std_oaf)
328rmsd_oaf=reform(ff(5,*)) 
329rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
330mean_tao=reform(ff(6,*)) 
331mean_oafl=bias_oaf+mean_tao
332
333print, ''
334print, 'OAFlux'
335print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
336cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
337
338splot, mean_tao, mean_oafl, title='Q2m - TAO Vs OAFlux', subtitle='', $
339     charsize=1.1, xtitle='TAO Q2m', ytitle='OAFlux Q2m', small=[2,3,3],/noer, psym=2, $
340     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
341oplot, [11,21], [11,21]
342xyouts, 12,20.2, cstat, charsize=0.9
343xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
344
345ab=linfit(mean_tao, mean_oafl,yfit=yfit)
346a=float(ab(0))
347b=float(ab(1))
348oplot, mean_tao, yfit, color=250, thick=2
349
350
351fi_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_'+ocean+'.txt'
352res=read_ascii(fi_q2m_ncep,data_start=1)
353ff=res.field1
354lat=reform(ff(0,*))
355lon=reform(ff(1,*))
356cor_nce=reform(ff(2,*))   
357cor_ncep=total(cor_nce)/n_elements(cor_nce)
358bias_nce=reform(ff(3,*)) 
359bias_ncep=total(bias_nce)/n_elements(bias_nce)
360std_nce=reform(ff(4,*))   
361std_ncep=total(std_nce)/n_elements(std_nce)
362rmsd_nce=reform(ff(5,*)) 
363rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
364mean_tao=reform(ff(6,*)) 
365mean_ncep=bias_nce+mean_tao
366
367print, ''
368print, 'NCEP2'
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='Q2m - TAO Vs NCEP2', subtitle='', $
373     charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP2 Q2m', small=[2,3,4],/noer, psym=2, $
374     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
375oplot, [11,21], [11,21]
376xyouts, 12,20.2, cstat, charsize=0.9
377xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
378
379ab=linfit(mean_tao, mean_ncep,yfit=yfit)
380a=float(ab(0))
381b=float(ab(1))
382oplot, mean_tao, yfit, color=250, thick=2
383
384fi_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_'+ocean+'.txt'
385res=read_ascii(fi_q2m_ncep1,data_start=1)
386ff=res.field1
387lat=reform(ff(0,*))
388lon=reform(ff(1,*))
389cor_nce=reform(ff(2,*))   
390cor_ncep=total(cor_nce)/n_elements(cor_nce)
391bias_nce=reform(ff(3,*)) 
392bias_ncep=total(bias_nce)/n_elements(bias_nce)
393std_nce=reform(ff(4,*))   
394std_ncep=total(std_nce)/n_elements(std_nce)
395rmsd_nce=reform(ff(5,*)) 
396rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
397mean_tao=reform(ff(6,*)) 
398mean_ncep=bias_nce+mean_tao
399
400print, ''
401print, 'NCEP1'
402print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
403cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
404
405splot, mean_tao, mean_ncep, title='Q2m - TAO Vs NCEP', subtitle='', $
406     charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP1 Q2m', small=[2,3,5],/noer, psym=2, $
407     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
408oplot, [11,21], [11,21]
409xyouts, 12,20.2, cstat, charsize=0.9
410xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
411
412ab=linfit(mean_tao, mean_ncep,yfit=yfit)
413a=float(ab(0))
414b=float(ab(1))
415oplot, mean_tao, yfit, color=250, thick=2
416
417closeps
418
419end
Note: See TracBrowser for help on using the repository browser.