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

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

replace TROPFLUX by PROJECT

  • Property svn:executable set to *
File size: 14.8 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;       graph [
15;       rankdir="LR",
16;       ]
17;       q2m_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_2000_2009_erai_*.txt"];
18;       q2m_erai_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_q2m_19890101_20091231_oafluxgrid.nc"];
19;       q2m_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_trop_*.txt"];
20;       q2m_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_oaflx_*.txt"];
21;       q2m_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_ncep_*.txt"];
22;       q2m_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_ncep1_*.txt"];
23;
24;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_validation_scatter_2000_2009_basin.ps"];
25;
26;       q2m_validation_scatter_2000_2009_basin [shape=box,
27;       fontname=Courier,
28;       color=blue,
29;       URL="http://forge.ipsl.jussieu.fr/tropflux/broq2mer/trunk/src/paper01/fig7/q2m_validation_scatter_2000_2009_basin.pro",
30;       label="${TROPFLUX}/src/paper01/fig7/q2m_validation_scatter_2000_2009_basin.pro"];
31;
32;       {q2m_erai q2m_erai_2} -> {q2m_validation_scatter_2000_2009_basin} -> {q2m_tropflux q2m_oafluxq2m_ncep q2m_ncep1 figure}
33;    }
34;
35; SEE ALSO
36; ========
37;
38; :ref:`project_profile.sh`
39; :ref:`project_init.pro`
40; :ref:`cm_project.pro`
41;
42; :func:`x_site_location`
43; :func:`y_site_location`
44;
45; :ref:`read_variables_v2.pro`
46; :ref:`statistics_3var_v1.pro`
47;
48; EXAMPLES
49; ========
50;
51; ::
52;
53;  IDL> date1=19890101L
54;  IDL> date2=20091231L
55;  IDL> q2m_validation_scatter_2000_2009_basin, date1, date2
56;
57; TODO
58; ====
59;
60; make it work on cratos : pb restore
61;
62; ++ mooring data in graphviz
63;
64; coding rules
65;
66; get rid of spwan
67;
68; complete description
69;
70; handle IO error
71;
72; EVOLUTIONS
73; ==========
74;
75; $Id$
76;
77; - fplod 20110420T101050Z aedon.locean-ipsl.upmc.fr (Darwin)
78;
79;   * remove hard coding path
80;   * add graphviz
81;   * externalize functions
82;
83; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
84;
85;   * minimal header
86;
87;-
88
89pro q2m_validation_scatter_2000_2009_basin, date1, date2
90@cm_general
91@cm_project
92reinitplt, /z,/invert
93key_portrait = 1
94
95openps, FILENAME = 'idl.ps'
96
97;; Give the location of mooring for validation of basic meteorological variables
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
115sitelist=['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']
121ocean='Pac'
122
123sitelist=['0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
124          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
125ocean='AO'
126
127sitelist=['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']
131ocean='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_q2m_erai=project_id_env+'q2m_2000_2009_erai_'+ocean+'.txt'
150openw,1,fi_q2m_erai
151fi_q2m_trop=project_id_env+'q2m_2000_2009_trop_'+ocean+'.txt'
152openw,2,fi_q2m_trop
153fi_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_'+ocean+'.txt'
154openw,3,fi_q2m_oaflx
155fi_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_'+ocean+'.txt'
156openw,4,fi_q2m_ncep
157fi_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_'+ocean+'.txt'
158openw,5,fi_q2m_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_q2m_19890101_20091231_oafluxgrid.nc'
170initncdf, file
171unc=read_ncdf('q2m',date1,date2,file=file,/nostr)
172help, unc
173
174;save, unc, cor, oaf, nce, nce1, filename="q2m_era_trop_oaf_nce_nce1_2000_2009_global.idl"
175restore, file="/Users/pkb/work/MY_SAXO/q2m_era_trop_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    q2m=rh_to_sphum(rh,at,1008)               ;;        at  ->  q2m temperature
194;    q2m=at                                               ;;        q2m ->  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    ind=where(finite(q2m)) & q2m=q2m(ind) & uncr_q2m=uncr(ind)  & corr_q2m=corr(ind)
225    oafl=oafl(ind) & ncep=ncep(ind) & ncep1=ncep1(ind)
226    mean_tao=total(q2m,/nan)/n_elements(ind)
227
228    statistics_3var_v1, q2m, uncr_q2m, corr_q2m, $
229         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
230
231    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)'
232    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)'
233
234    statistics_3var_v1, q2m, oafl, ncep, $
235         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
236    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)'
237    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)'
238
239    statistics_3var_v1, q2m, ncep1, ncep, $
240         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
241    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)'
242
243endfor
244close,/all
245
246fi_q2m_erai=project_id_env+'q2m_2000_2009_erai_'+ocean+'.txt'
247res=read_ascii(fi_q2m_erai,data_start=1)
248ff=res.field1
249lat=reform(ff(0,*))
250lon=reform(ff(1,*))
251cor_era=reform(ff(2,*))   & cor_erai=total(cor_era)/n_elements(cor_era)
252bias_era=reform(ff(3,*))  & bias_erai=total(bias_era)/n_elements(bias_era)
253std_era=reform(ff(4,*))   & std_erai=total(std_era)/n_elements(std_era)
254rmsd_era=reform(ff(5,*))  & rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
255mean_tao=reform(ff(6,*))  & mean_erai=bias_era+mean_tao
256
257print, ''
258print, 'ERAI'
259print, cor_erai, bias_erai, std_erai, rmsd_erai
260cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
261splot, mean_tao, mean_erai, title='Q2m - TAO Vs ERAI', subtitle='', $
262     charsize=1.1, xtitle='TAO Q2m', ytitle='ERAI Q2m', small=[2,3,1], psym=2, $
263     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
264xyouts, 12,20.2, cstat, charsize=0.9
265xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
266
267oplot, [11,21], [11,21]
268ab=linfit(mean_tao, mean_erai,yfit=yfit)
269a=float(ab(0)) & b=float(ab(1))
270oplot, mean_tao, yfit, color=250, thick=2
271
272fi_q2m_trop=project_id_env+'q2m_2000_2009_trop_'+ocean+'.txt'
273res=read_ascii(fi_q2m_trop,data_start=1)
274ff=res.field1
275lat=reform(ff(0,*))
276lon=reform(ff(1,*))
277cor_tro=reform(ff(2,*))   & cor_trop=total(cor_tro)/n_elements(cor_tro)
278bias_tro=reform(ff(3,*))  & bias_trop=total(bias_tro)/n_elements(bias_tro)
279std_tro=reform(ff(4,*))   & std_trop=total(std_tro)/n_elements(std_tro)
280rmsd_tro=reform(ff(5,*))  & rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
281mean_tao=reform(ff(6,*))  & mean_trop=bias_tro+mean_tao
282
283print, ''
284print, 'TropFlux'
285print, cor_trop, bias_trop, std_trop, rmsd_trop
286cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
287
288splot, mean_tao, mean_trop, title='Q2m - TAO Vs TropFlux', subtitle='', $
289     charsize=1.1, xtitle='TAO Q2m', ytitle='TropFlux Q2m', small=[2,3,2],/noer, psym=2, $
290     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
291oplot, [11,21], [11,21]
292xyouts, 12,20.2, cstat, charsize=0.9
293xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
294
295ab=linfit(mean_tao, mean_trop,yfit=yfit)
296a=float(ab(0)) & b=float(ab(1))
297oplot, mean_tao, yfit, color=250, thick=2
298
299fi_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_'+ocean+'.txt'
300res=read_ascii(fi_q2m_oaflx,data_start=1)
301ff=res.field1
302lat=reform(ff(0,*))
303lon=reform(ff(1,*))
304cor_oaf=reform(ff(2,*))   & cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
305bias_oaf=reform(ff(3,*))  & bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
306std_oaf=reform(ff(4,*))   & std_oafl=total(std_oaf)/n_elements(std_oaf)
307rmsd_oaf=reform(ff(5,*))  & rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
308mean_tao=reform(ff(6,*))  & mean_oafl=bias_oaf+mean_tao
309
310print, ''
311print, 'OAFlux'
312print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
313cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
314
315splot, mean_tao, mean_oafl, title='Q2m - TAO Vs OAFlux', subtitle='', $
316     charsize=1.1, xtitle='TAO Q2m', ytitle='OAFlux Q2m', small=[2,3,3],/noer, psym=2, $
317     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
318oplot, [11,21], [11,21]
319xyouts, 12,20.2, cstat, charsize=0.9
320xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
321
322ab=linfit(mean_tao, mean_oafl,yfit=yfit)
323a=float(ab(0)) & b=float(ab(1))
324oplot, mean_tao, yfit, color=250, thick=2
325
326
327fi_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_'+ocean+'.txt'
328res=read_ascii(fi_q2m_ncep,data_start=1)
329ff=res.field1
330lat=reform(ff(0,*))
331lon=reform(ff(1,*))
332cor_nce=reform(ff(2,*))   & cor_ncep=total(cor_nce)/n_elements(cor_nce)
333bias_nce=reform(ff(3,*))  & bias_ncep=total(bias_nce)/n_elements(bias_nce)
334std_nce=reform(ff(4,*))   & std_ncep=total(std_nce)/n_elements(std_nce)
335rmsd_nce=reform(ff(5,*))  & rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
336mean_tao=reform(ff(6,*))  & mean_ncep=bias_nce+mean_tao
337
338print, ''
339print, 'NCEP2'
340print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
341cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
342
343splot, mean_tao, mean_ncep, title='Q2m - TAO Vs NCEP2', subtitle='', $
344     charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP2 Q2m', small=[2,3,4],/noer, psym=2, $
345     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
346oplot, [11,21], [11,21]
347xyouts, 12,20.2, cstat, charsize=0.9
348xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
349
350ab=linfit(mean_tao, mean_ncep,yfit=yfit)
351a=float(ab(0)) & b=float(ab(1))
352oplot, mean_tao, yfit, color=250, thick=2
353
354fi_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_'+ocean+'.txt'
355res=read_ascii(fi_q2m_ncep1,data_start=1)
356ff=res.field1
357lat=reform(ff(0,*))
358lon=reform(ff(1,*))
359cor_nce=reform(ff(2,*))   & cor_ncep=total(cor_nce)/n_elements(cor_nce)
360bias_nce=reform(ff(3,*))  & bias_ncep=total(bias_nce)/n_elements(bias_nce)
361std_nce=reform(ff(4,*))   & std_ncep=total(std_nce)/n_elements(std_nce)
362rmsd_nce=reform(ff(5,*))  & rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
363mean_tao=reform(ff(6,*))  & mean_ncep=bias_nce+mean_tao
364
365print, ''
366print, 'NCEP1'
367print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
368cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
369
370splot, mean_tao, mean_ncep, title='Q2m - TAO Vs NCEP', subtitle='', $
371     charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP1 Q2m', small=[2,3,5],/noer, psym=2, $
372     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
373oplot, [11,21], [11,21]
374xyouts, 12,20.2, cstat, charsize=0.9
375xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
376
377ab=linfit(mean_tao, mean_ncep,yfit=yfit)
378a=float(ab(0)) & b=float(ab(1))
379oplot, mean_tao, yfit, color=250, thick=2
380
381closeps
382
383fig=project_od_env+'q2m_validation_scatter_2000_2009_'+ocean+'.ps'
384spawn, 'mv '+psdir+'idl.ps '+fig
385spawn, 'gv '+fig
386end
Note: See TracBrowser for help on using the repository browser.