source: trunk/src/paper01/fig3/q2m_validation_scatter_2000_2009_v50.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: 13.4 KB
Line 
1;+
2;
3; .. _q2m_validation_scatter_2000_2009_v50.pro:
4;
5; ========================================
6; q2m_validation_scatter_2000_2009_v50.pro
7; ========================================
8;
9; DESCRIPTION
10; ===========
11;
12; .. graphviz::
13;
14;    digraph q2m_validation_scatter_2000_2009_v50 {
15;
16;       q2m_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_2000_2009_erai_v50.txt"];
17;
18;       q2m_trop [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_trop_v50.txt"];
19;       q2m_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_oaflx_v50.txt"];
20;       q2m_ncep  [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_ncep_v50.txt"];
21;       q2m_ncep1  [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_ncep1_v50.txt"];
22;
23;       erai_q2m_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_t2m_19890101_20091231_oafluxgrid.nc"];
24;
25;       tropflux_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_q2m_19890101_20091231_v50.nc"];
26;
27;       oaflux_basic [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/OAFlux_basic_variables_1985_2009.nc"];
28;
29;       sphum_ncep2_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/sphum_ncep2_oafluxgrid_19890101_20091231.nc"];
30;
31;       q2m_validation_scatter_2000_2009_v50 [shape=box,
32;       fontname=Courier,
33;       color=blue,
34;       URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/paper01/fig3/q2m_validation_scatter_2000_2009_v50.pro",
35;       label="${TROPFLUX}/src/paper01/fig3/q2m_validation_scatter_2000_2009_v50.pro"];
36;
37;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_validation_scatter_2000_2009_v50.ps"];
38;
39;       {q2m_erai erai_q2m_oafluxgrid tropflux_q2m oaflux_basic sphum_ncep2_oafluxgrid} -> {q2m_validation_scatter_2000_2009_v50} -> {q2m_trop q2m_oaflux q2m_ncep q2m_ncep1 figure}
40;
41;     }
42;
43; SEE ALSO
44; ========
45;
46; :ref:`project_profile.sh`
47; :ref:`project_init.pro`
48; :ref:`cm_project.pro`
49;
50; :func:`x_site_location`
51; :func:`y_site_location`
52;
53; :ref:`read_variables_v2.pro`
54; :ref:`statistics_3var_v1.pro`
55;
56; EXAMPLES
57; ========
58;
59; ::
60;
61;  date1 = 20001001L
62;  date2 = 20091231L
63;  q2m_validation_scatter_2000_2009_v50, date1, date2
64;
65; TODO
66; ====
67;
68; make it work (missing data)
69;
70; Praveen confirm date selection
71;
72; coding rules
73;
74; complete description
75;
76; handle IO error
77;
78; EVOLUTIONS
79; ==========
80;
81; $Id$
82;
83; $URL$
84;
85; - pinsard 2011-04-20T15:17:57Z loholt1.ipsl.polytechnique.fr (Linux)
86;
87;   * typo
88;   * externalize function
89;
90; - fplod 20110412T104125Z aedon.locean-ipsl.upmc.fr (Darwin)
91;
92;   * remove hard coding path
93;   * add graphviz
94;
95; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
96;
97;   * minimal header
98;
99;-
100pro q2m_validation_scatter_2000_2009_v50, date1, date2
101;
102@cm_project
103;
104reinitplt, /z,/invert
105key_portrait = 1
106;
107openps, FILENAME = project_od_env+'q2m_validation_scatter_2000_2009_v50.ps'
108;
109; Give the location of mooring for validation of basic meteorological variables
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', $
113           '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', $
119          '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
120          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
121;
122ocean='global'
123;
124nsmooth=1.    ; statistics are with 7 day smoothed
125;   This program will create the following text files with statistics of respective variables
126close,/all
127;
128fi_q2m_erai=project_id_env+'q2m_2000_2009_erai_v50.txt'
129openw,1,fi_q2m_erai
130fi_q2m_trop=project_id_env+'q2m_2000_2009_trop_v50.txt'
131openw,2,fi_q2m_trop
132fi_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_v50.txt'
133openw,3,fi_q2m_oaflx
134fi_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_v50.txt'
135openw,4,fi_q2m_ncep
136fi_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_v50.txt'
137openw,5,fi_q2m_ncep1
138;
139printf,1, 'x     y      cor    bias     std     rmsd    mean_tao'
140printf,2, 'x     y      cor    bias     std     rmsd    mean_tao'
141printf,3, 'x     y      cor    bias     std     rmsd    mean_tao'
142printf,4, 'x     y      cor    bias     std     rmsd    mean_tao'
143printf,5, 'x     y      cor    bias     std     rmsd    mean_tao'
144;
145; first reading the whole ERAI uncorrected and corrected data
146;
147file=project_id_env+'erai_q2m_19890101_20091231_oafluxgrid.nc'
148initncdf, file
149unc=read_ncdf('q2m',date1,date2,file=file,/nostr)
150help, unc
151;
152file=project_id_env+'TropFlux_q2m_19890101_20091231_v20.nc'
153initncdf, file
154cor=read_ncdf('q2m',date1,date2,file=file,/nostr)
155help, cor
156;
157file=project_id_env+'OAFlux_basic_variables_1985_2009.nc'
158initncdf, file
159oaf=read_ncdf("sphum", date1, date2, file=file,/nostr)
160help, oaf
161;
162fi=project_id_env+'sphum_ncep2_oafluxgrid_19890101_20091231.nc'
163initncdf, fi
164nce=read_ncdf("shum", date1-1, date2, file=fi,/nostr)
165nce=nce*1000
166help, nce
167;
168file=project_id_env+'q2m_ncep1_19890101_20091231.nc'
169initncdf, file
170nce1=read_ncdf("q2m", date1, date2, file=file,/nostr)
171nce1=nce1*1000
172help, nce1
173;
174nn=n_elements(sitelist)
175for n=0, nn-1 do begin
176;
177; reading data from mooring
178;
179    site=sitelist(n)
180    csite=site
181    print, csite
182    x=x_site_location(site)
183    y=y_site_location(site)
184    if (y ge 0. and y le 30.) then y=y+360.
185    dx=0.5
186    dy=0.5
187    box=[y-dy, y+dy, x-dx, x+dx]
188    read_variables_v2, csite,date1,date2,nsmooth, $
189         at, sw,rh,sst,wu,wv,ws,lh
190;
191    q2m=rh_to_sphum(rh,at,1008)               ;        at  ->  q2m temperature
192;    q2m=at                                               ;        q2m ->  sea surface temperature
193                                                ;        lh  ->  latent heat flux
194                                                ;        rh  ->  relative humidity
195                                                ;   wu,wv,ws ->  wind speed
196;
197;  extracting the corrected and uncorrected ERAI data at the locations
198    nsmooth=1.
199;
200    extract_flux_tropflux,unc,box, $
201        tropflux
202    uncr=tropflux
203;
204     extract_flux_tropflux,cor,box, $
205        tropflux
206     corr=tropflux
207;
208     extract_flux_tropflux,oaf,box, $
209        tropflux
210     oafl=tropflux
211;
212     extract_flux_tropflux,nce,box, $
213        tropflux
214     ncep=tropflux
215;
216     extract_flux_tropflux,nce1,box, $
217        tropflux
218     ncep1=tropflux
219;
220    ind=where(finite(q2m))
221    q2m=q2m(ind)
222    uncr_q2m=uncr(ind)
223    corr_q2m=corr(ind)
224    oafl=oafl(ind)
225    ncep=ncep(ind)
226    ncep1=ncep1(ind)
227    mean_tao=total(q2m,/nan)/n_elements(ind)
228;
229    statistics_3var_v1, q2m, uncr_q2m, corr_q2m, $
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, q2m, 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, q2m, 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_q2m_erai=project_id_env+'q2m_2000_2009_erai_v50.txt'
248res=read_ascii(fi_q2m_erai,data_start=1)
249ff=res.field1
250lat=reform(ff(0,*))
251lon=reform(ff(1,*))
252cor_era=reform(ff(2,*))
253cor_erai=total(cor_era)/n_elements(cor_era)
254bias_era=reform(ff(3,*))
255bias_erai=total(bias_era)/n_elements(bias_era)
256std_era=reform(ff(4,*))
257std_erai=total(std_era)/n_elements(std_era)
258rmsd_era=reform(ff(5,*))
259rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
260mean_tao=reform(ff(6,*))
261mean_erai=bias_era+mean_tao
262;
263print, ''
264print, 'ERAI'
265print, cor_erai, bias_erai, std_erai, rmsd_erai
266cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
267splot, mean_tao, mean_erai, title='Q2m - TAO Vs ERAI', subtitle='', $
268     charsize=1.1, xtitle='TAO Q2m', ytitle='ERAI Q2m', small=[2,3,1], psym=2, $
269     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
270xyouts, 12,20.2, cstat, charsize=0.9
271xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
272;
273oplot, [11,21], [11,21]
274ab=linfit(mean_tao, mean_erai,yfit=yfit)
275a=float(ab(0))
276b=float(ab(1))
277oplot, mean_tao, yfit, color=250, thick=2
278;
279fi_q2m_trop=project_id_env+'q2m_2000_2009_trop_v50.txt'
280res=read_ascii(fi_q2m_trop,data_start=1)
281ff=res.field1
282lat=reform(ff(0,*))
283lon=reform(ff(1,*))
284cor_tro=reform(ff(2,*))
285cor_trop=total(cor_tro)/n_elements(cor_tro)
286bias_tro=reform(ff(3,*))
287bias_trop=total(bias_tro)/n_elements(bias_tro)
288std_tro=reform(ff(4,*))
289std_trop=total(std_tro)/n_elements(std_tro)
290rmsd_tro=reform(ff(5,*))
291rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
292mean_tao=reform(ff(6,*))
293mean_trop=bias_tro+mean_tao
294;
295print, ''
296print, 'TropFlux'
297print, cor_trop, bias_trop, std_trop, rmsd_trop
298cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
299;
300splot, mean_tao, mean_trop, title='Q2m - TAO Vs TropFlux', subtitle='', $
301     charsize=1.1, xtitle='TAO Q2m', ytitle='TropFlux Q2m', small=[2,3,2],/noer, psym=2, $
302     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
303oplot, [11,21], [11,21]
304xyouts, 12,20.2, cstat, charsize=0.9
305xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
306;
307ab=linfit(mean_tao, mean_trop,yfit=yfit)
308a=float(ab(0))
309b=float(ab(1))
310oplot, mean_tao, yfit, color=250, thick=2
311;
312fi_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_v50.txt'
313res=read_ascii(fi_q2m_oaflx,data_start=1)
314ff=res.field1
315lat=reform(ff(0,*))
316lon=reform(ff(1,*))
317cor_oaf=reform(ff(2,*))
318cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
319bias_oaf=reform(ff(3,*))
320bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
321std_oaf=reform(ff(4,*))
322std_oafl=total(std_oaf)/n_elements(std_oaf)
323rmsd_oaf=reform(ff(5,*))
324rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
325mean_tao=reform(ff(6,*))
326mean_oafl=bias_oaf+mean_tao
327;
328print, ''
329print, 'OAFlux'
330print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
331cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
332;
333splot, mean_tao, mean_oafl, title='Q2m - TAO Vs OAFlux', subtitle='', $
334     charsize=1.1, xtitle='TAO Q2m', ytitle='OAFlux Q2m', small=[2,3,3],/noer, psym=2, $
335     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
336oplot, [11,21], [11,21]
337xyouts, 12,20.2, cstat, charsize=0.9
338xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
339;
340ab=linfit(mean_tao, mean_oafl,yfit=yfit)
341a=float(ab(0))
342b=float(ab(1))
343oplot, mean_tao, yfit, color=250, thick=2
344;
345fi_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_v50.txt'
346res=read_ascii(fi_q2m_ncep,data_start=1)
347ff=res.field1
348lat=reform(ff(0,*))
349lon=reform(ff(1,*))
350cor_nce=reform(ff(2,*))
351cor_ncep=total(cor_nce)/n_elements(cor_nce)
352bias_nce=reform(ff(3,*))
353bias_ncep=total(bias_nce)/n_elements(bias_nce)
354std_nce=reform(ff(4,*))
355std_ncep=total(std_nce)/n_elements(std_nce)
356rmsd_nce=reform(ff(5,*))
357rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
358mean_tao=reform(ff(6,*))
359mean_ncep=bias_nce+mean_tao
360;
361print, ''
362print, 'NCEP2'
363print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
364cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
365;
366splot, mean_tao, mean_ncep, title='Q2m - TAO Vs NCEP2', subtitle='', $
367     charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP2 Q2m', small=[2,3,4],/noer, psym=2, $
368     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
369oplot, [11,21], [11,21]
370xyouts, 12,20.2, cstat, charsize=0.9
371xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
372;
373ab=linfit(mean_tao, mean_ncep,yfit=yfit)
374a=float(ab(0))
375b=float(ab(1))
376oplot, mean_tao, yfit, color=250, thick=2
377;
378fi_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_v50.txt'
379res=read_ascii(fi_q2m_ncep1,data_start=1)
380ff=res.field1
381lat=reform(ff(0,*))
382lon=reform(ff(1,*))
383cor_nce=reform(ff(2,*))
384cor_ncep=total(cor_nce)/n_elements(cor_nce)
385bias_nce=reform(ff(3,*))
386bias_ncep=total(bias_nce)/n_elements(bias_nce)
387std_nce=reform(ff(4,*))
388std_ncep=total(std_nce)/n_elements(std_nce)
389rmsd_nce=reform(ff(5,*))
390rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
391mean_tao=reform(ff(6,*))
392mean_ncep=bias_nce+mean_tao
393;
394print, ''
395print, 'NCEP1'
396print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
397cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
398;
399splot, mean_tao, mean_ncep, title='Q2m - TAO Vs NCEP', subtitle='', $
400     charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP1 Q2m', small=[2,3,5],/noer, psym=2, $
401     xrange=[11,21], yrange=[11,21], xmin=1,ymin=1
402oplot, [11,21], [11,21]
403xyouts, 12,20.2, cstat, charsize=0.9
404xyouts, 12,19.7, 'cor   bias   std   rmsd', charsize=0.9
405;
406ab=linfit(mean_tao, mean_ncep,yfit=yfit)
407a=float(ab(0))
408b=float(ab(1))
409oplot, mean_tao, yfit, color=250, thick=2
410;
411closeps
412;
413end
Note: See TracBrowser for help on using the repository browser.