source: trunk/src/paper01/fig3/ws_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: 15.0 KB
Line 
1;+
2; .. _ws_validation_scatter_2000_2009_v50.pro:
3;
4; =======================================
5; ws_validation_scatter_2000_2009_v50.pro
6; =======================================
7;
8; DESCRIPTION
9; ===========
10;
11; .. graphviz::
12;
13;    digraph ws_validation_scatter_2000_2009_v50 {
14;
15;       ws_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/ws_2000_2009_erai_v50.txt"];
16;       ws_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/ws_2000_2009_trop_v50.txt"];
17;       ws_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/ws_2000_2009_oaflx_v50.txt"];
18;       ws_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/ws_2000_2009_ncep_v50.txt"];
19;       ws_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/ws_2000_2009_ncep1_v50.txt"];
20;       ws_erai_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_ws_19890101_20091231_oafluxgrid.nc"];
21;       ws_tropflux_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_ws_19890101_20091231_v20.nc"];
22;       oaflux_basic [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/OAFlux_basic_variables_1985_2009.nc"];
23;       uwind_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/uwind_ncep2_oafluxgrid_19890101_20091231.nc"];
24;       vwind_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/bwind_ncep2_oafluxgrid_19890101_20091231.nc"];
25;       ws_tmi [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/zonal_wind_speed_oafluxgrid_30N30S.nc"];
26;
27;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/ws_validation_scatter_2000_2009_v50.ps"];
28;
29;       ws_validation_scatter_2000_2009_v50 [shape=box,
30;       fontname=Courier,
31;       color=blue,
32;       URL="http://forge.ipsl.jussieu.fr/tropflux/broswrer/trunk/src/paper01/fig3/ws_validation_scatter_2000_2009_v50.pro",
33;       label="${TROPFLUX}/src/paper01/fig3/ws_validation_scatter_2000_2009_v50.pro"];
34;
35;       {ws_erai ws_erai_oafluxgrid ws_tropflux_2 oaflux_basic ws_ncep2 ws_tmi_2 ws_ncep1_2} -> {ws_validation_scatter_2000_2009_v50} -> {ws_tropflux ws_oaflux ws_tmi ws_ncep ws_ncep1 figure}
36;    }
37;
38; SEE ALSO
39; ========
40;
41; :ref:`project_profile.sh`
42; :ref:`project_init.pro`
43; :ref:`cm_project.pro`
44;
45; :func:`x_site_location`
46; :func:`y_site_location`
47;
48; :ref:`read_variables_v2.pro`
49; :ref:`statistics_3var_v1.pro`
50;
51; EXAMPLES
52; ========
53;
54; ::
55;
56;  date1 = 19890101L
57;  date2 = 20091231L
58;  ws_validation_scatter_2000_2009_v50, date1, date2
59;
60; TODO
61; ====
62;
63; make it work on cratos : missing data
64;
65; ++ mooring data in graphviz
66;
67; coding rules
68;
69; complete description
70;
71; handle IO error
72;
73; EVOLUTIONS
74; ==========
75;
76; $Id$
77;
78; $URL$
79;
80; - fplod 20110420T132401Z aedon.locean-ipsl.upmc.fr (Darwin)
81;
82;   * remove hard coding path
83;   * add graphviz
84;   * externalize functions
85;
86; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
87;
88;   * minimal header
89;
90;-
91pro ws_validation_scatter_2000_2009_v50, date1, date2
92@cm_general
93@cm_project
94reinitplt, /z,/invert
95key_portrait = 1
96;
97openps, FILENAME = project_od_env+'ws_validation_scatter_2000_2009_v50.ps'
98;
99; Give the location of mooring for validation of basic meteorological variables
100;
101sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
102           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $
103           '8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
104          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
105          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
106          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
107          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
108          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $
109          '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
110          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
111;
112ocean='global'
113;
114da1=10000101
115da2=10081231
116nsmooth=1.    ; statistics are with 7 day smoothed
117;   This program will create the following text files with statistics of respective variables
118close,/all
119;
120fi_ws_erai=project_id_env+'ws_2000_2009_erai_v50.txt'
121openw,1,fi_ws_erai
122fi_ws_trop=project_id_env+'ws_2000_2009_trop_v50.txt'
123openw,2,fi_ws_trop
124fi_ws_oaflx=project_id_env+'ws_2000_2009_oaflx_v50.txt'
125openw,3,fi_ws_oaflx
126fi_ws_ncep=project_id_env+'ws_2000_2009_ncep_v50.txt'
127openw,4,fi_ws_ncep
128fi_ws_tmi=project_id_env+'ws_2000_2009_tmi_v50.txt'
129openw,5,fi_ws_tmi
130fi_ws_ncep1=project_id_env+'ws_2000_2009_ncep1_v50.txt'
131openw,6,fi_ws_ncep1
132;
133printf,1, 'x     y      cor    bias     std     rmsd      mean_tao'
134printf,2, 'x     y      cor    bias     std     rmsd      mean_tao'
135printf,3, 'x     y      cor    bias     std     rmsd      mean_tao'
136printf,4, 'x     y      cor    bias     std     rmsd      mean_tao'
137printf,5, 'x     y      cor    bias     std     rmsd      mean_tao'
138printf,6, 'x     y      cor    bias     std     rmsd      mean_tao'
139;
140; first reading the whole ERAI uncorrected and corrected data
141;
142file=project_id_env+'erai_ws_19890101_20091231_oafluxgrid.nc'
143initncdf, file
144u=read_ncdf('u10',date1,date2,file=file,/nostr)
145v=read_ncdf('v10',date1,date2,file=file,/nostr)
146unc=sqrt(u*u+v*v)
147help, unc
148;
149file=project_id_env+'TropFlux_ws_19890101_20091231_v20.nc'
150initncdf, file
151cor=read_ncdf('ws',date1,date2,file=file,/nostr)
152help, cor
153;
154file=project_id_env+'OAFlux_basic_variables_1985_2009.nc'
155initncdf, file
156oaf=read_ncdf("wind", date1, date2, file=file,/nostr)
157help, oaf
158;
159fi=project_id_env+'uwind_ncep2_oafluxgrid_19890101_20091231.nc'
160initncdf, fi
161u=read_ncdf("u", date1-1, date2, file=fi,/nostr)
162fi=project_id_env+'vwind_ncep2_oafluxgrid_19890101_20091231.nc'
163initncdf, fi
164v=read_ncdf("v", date1-1, date2, file=fi,/nostr)
165nce=sqrt(u*u+v*v)
166help, nce
167;
168fi=project_id_env+'zonal_wind_speed_oafluxgrid_30N30S.nc'
169initncdf, fi
170u=read_ncdf("u", date1, date2, file=fi,/nostr)
171fi=project_id_env+'meridional_wind_speed_oafluxgrid_30N30S.nc'
172initncdf, fi
173v=read_ncdf("v", date1, date2, file=fi,/nostr)
174ws_tmi=sqrt(u*u+v*v)
175help, ws_tmi
176;
177file=project_id_env+'wind_ncep1_19890101_20091231.nc'
178initncdf, file
179u=read_ncdf("u", date1, date2, file=file,/nostr)
180v=read_ncdf("v", date1, date2, file=file,/nostr)
181nce1=sqrt(u*u+v*v)
182help, nce1
183;
184nn=n_elements(sitelist)
185for n=0, nn-1 do begin
186;
187; reading data from mooring
188;
189    site=sitelist(n)
190    csite=site
191    print, csite
192    x=x_site_location(site)
193    y=y_site_location(site)
194    if (y ge 0. and y le 30.) then y=y+360.
195    dx=0.5
196    dy=0.5
197    box=[y-dy, y+dy, x-dx, x+dx]
198    read_variables_v2, csite,date1,date2,nsmooth, $
199         at, sw,rh,sst,wu,wv,ws, lh
200;
201    ws=alog(10./0.000152)/alog(4./0.000152)*ws
202;
203;  extracting the corrected and uncorrected ERAI data at the locations
204    nsmooth=1.
205;
206    extract_flux_tropflux,unc,box, $
207        tropflux
208    uncr=tropflux
209;
210     extract_flux_tropflux,cor,box, $
211        tropflux
212     corr=tropflux
213;
214     extract_flux_tropflux,oaf,box, $
215        tropflux
216     oafl=tropflux
217;
218     extract_flux_tropflux,nce,box, $
219        tropflux
220     ncep=tropflux
221;
222     extract_flux_tropflux,ws_tmi,box, $
223        tropflux
224     tmi=tropflux
225;
226     extract_flux_tropflux,nce1,box, $
227        tropflux
228     ncep1=tropflux
229;
230    ind=where(finite(ws))
231    ws=ws(ind)
232    uncr_ws=uncr(ind)
233    corr_ws=corr(ind)
234    oafl=oafl(ind)
235    ncep=ncep(ind)
236    tmi=tmi(ind)
237    ncep1=ncep1(ind)
238;
239    mean_tao=total(ws)/n_elements(ws)
240;
241    statistics_3var_v1, ws, uncr_ws, corr_ws, $
242         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
243;
244    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,f5.2)'
245    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,f5.2)'
246;
247    statistics_3var_v1, ws, oafl, ncep, $
248         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
249    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,f5.2)'
250    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,f5.2)'
251;
252    statistics_3var_v1, ws, tmi, ncep1, $
253         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
254    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,f5.2)'
255    printf, 6, 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,f5.2)'
256;
257endfor
258close,/all
259fi_ws_erai=project_id_env+'ws_2000_2009_erai_v50.txt'
260res=read_ascii(fi_ws_erai,data_start=1)
261ff=res.field1
262lat=reform(ff(0,*))
263lon=reform(ff(1,*))
264cor_era=reform(ff(2,*))
265cor_erai=total(cor_era)/n_elements(cor_era)
266bias_era=reform(ff(3,*))
267bias_erai=total(bias_era)/n_elements(bias_era)
268std_era=reform(ff(4,*))
269std_erai=total(std_era)/n_elements(std_era)
270rmsd_era=reform(ff(5,*))
271rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
272mean_tao=reform(ff(6,*))
273mean_erai=bias_era+mean_tao
274;
275print, ''
276print, 'ERAI'
277print, cor_erai, bias_erai, std_erai, rmsd_erai
278cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
279splot, mean_tao, mean_erai, title='WS - TAO Vs ERAI', subtitle='', $
280     charsize=1.1, xtitle='TAO WS', ytitle='ERAI WS', small=[2,3,1], psym=2, $
281     xrange=[2,10], yrange=[2,10], xmin=1,ymin=1
282xyouts, 2.5,9.4, cstat, charsize=0.9
283xyouts, 2.5,8.5, 'cor   bias   std   rmsd', charsize=0.9
284;
285oplot, [2,10], [2,10]
286ab=linfit(mean_tao, mean_erai,yfit=yfit)
287a=float(ab(0))
288b=float(ab(1))
289oplot, mean_tao, yfit, color=250, thick=2
290;
291fi_ws_trop=project_id_env+'ws_2000_2009_trop_v50.txt'
292res=read_ascii(fi_ws_trop,data_start=1)
293ff=res.field1
294lat=reform(ff(0,*))
295lon=reform(ff(1,*))
296cor_tro=reform(ff(2,*))
297cor_trop=total(cor_tro)/n_elements(cor_tro)
298bias_tro=reform(ff(3,*))
299bias_trop=total(bias_tro)/n_elements(bias_tro)
300std_tro=reform(ff(4,*))
301std_trop=total(std_tro)/n_elements(std_tro)
302rmsd_tro=reform(ff(5,*))
303rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
304mean_tao=reform(ff(6,*))
305mean_trop=bias_tro+mean_tao
306;
307print, ''
308print, 'TropFlux'
309print, cor_trop, bias_trop, std_trop, rmsd_trop
310cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
311;
312splot, mean_tao, mean_trop, title='WS - TAO Vs TropFlux', subtitle='', $
313     charsize=1.1, xtitle='TAO WS', ytitle='TropFlux WS', small=[2,3,2],/noer, psym=2, $
314     xrange=[2,10], yrange=[2,10], xmin=1,ymin=1
315oplot, [2,10], [2,10]
316xyouts, 2.5,9.4, cstat, charsize=0.9
317xyouts, 2.5,8.5, 'cor   bias   std   rmsd', charsize=0.9
318;
319ab=linfit(mean_tao, mean_trop,yfit=yfit)
320a=float(ab(0))
321b=float(ab(1))
322oplot, mean_tao, yfit, color=250, thick=2
323;
324fi_ws_oaflx=project_id_env+'ws_2000_2009_oaflx_v50.txt'
325res=read_ascii(fi_ws_oaflx,data_start=1)
326ff=res.field1
327lat=reform(ff(0,*))
328lon=reform(ff(1,*))
329cor_oaf=reform(ff(2,*))
330cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
331bias_oaf=reform(ff(3,*))
332bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
333std_oaf=reform(ff(4,*))
334std_oafl=total(std_oaf)/n_elements(std_oaf)
335rmsd_oaf=reform(ff(5,*))
336rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
337mean_tao=reform(ff(6,*))
338mean_oafl=bias_oaf+mean_tao
339;
340print, ''
341print, 'OAFlux'
342print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
343cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
344;
345splot, mean_tao, mean_oafl, title='WS - TAO Vs OAFlux', subtitle='', $
346     charsize=1.1, xtitle='TAO WS', ytitle='OAFlux WS', small=[2,3,3],/noer, psym=2, $
347     xrange=[2,10], yrange=[2,10], xmin=1,ymin=1
348oplot, [2,10], [2,10]
349xyouts, 2.5,9.4, cstat, charsize=0.9
350xyouts, 2.5,8.5, 'cor   bias   std   rmsd', charsize=0.9
351;
352ab=linfit(mean_tao, mean_oafl,yfit=yfit)
353a=float(ab(0))
354b=float(ab(1))
355oplot, mean_tao, yfit, color=250, thick=2
356;
357fi_ws_ncep=project_id_env+'ws_2000_2009_ncep_v50.txt'
358res=read_ascii(fi_ws_ncep,data_start=1)
359ff=res.field1
360lat=reform(ff(0,*))
361lon=reform(ff(1,*))
362cor_nce=reform(ff(2,*))
363cor_ncep=total(cor_nce)/n_elements(cor_nce)
364bias_nce=reform(ff(3,*))
365bias_ncep=total(bias_nce)/n_elements(bias_nce)
366std_nce=reform(ff(4,*))
367std_ncep=total(std_nce)/n_elements(std_nce)
368rmsd_nce=reform(ff(5,*))
369rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
370mean_tao=reform(ff(6,*))
371mean_ncep=bias_nce+mean_tao
372;
373print, ''
374print, 'NCEP2'
375print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
376cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
377;
378splot, mean_tao, mean_ncep, title='WS - TAO Vs NCEP2', subtitle='', $
379     charsize=1.1, xtitle='TAO WS', ytitle='NCEP2 WS', small=[2,3,4],/noer, psym=2, $
380     xrange=[2,10], yrange=[2,10], xmin=1,ymin=1
381oplot, [2,10], [2,10]
382xyouts, 2.5,9.4, cstat, charsize=0.9
383xyouts, 2.5,8.5, 'cor   bias   std   rmsd', charsize=0.9
384;
385ab=linfit(mean_tao, mean_ncep,yfit=yfit)
386a=float(ab(0))
387b=float(ab(1))
388oplot, mean_tao, yfit, color=250, thick=2
389;
390fi_ws_tmi=project_id_env+'ws_2000_2009_tmi_v50.txt'
391res=read_ascii(fi_ws_tmi,data_start=1)
392ff=res.field1
393lat=reform(ff(0,*))
394lon=reform(ff(1,*))
395cor_tm=reform(ff(2,*))
396cor_tmi=total(cor_tm)/n_elements(cor_tm)
397bias_tm=reform(ff(3,*))
398bias_tmi=total(bias_tm)/n_elements(bias_tm)
399std_tm=reform(ff(4,*))
400std_tmi=total(std_tm)/n_elements(std_tm)
401rmsd_tm=reform(ff(5,*))
402rmsd_tmi=total(rmsd_tm)/n_elements(rmsd_tm)
403mean_tao=reform(ff(6,*))
404mean_tmi=bias_tm+mean_tao
405;
406print, ''
407print, 'Qscat'
408print, cor_tmi, bias_tmi, std_tmi, rmsd_tmi
409cstat=string(cor_tmi, bias_tmi, std_tmi, rmsd_tmi, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
410;
411splot, mean_tao, mean_tmi, title='WS - TAO Vs Qscat', subtitle='', $
412     charsize=1.1, xtitle='TAO WS', ytitle='TMI WS', small=[2,3,5],/noer, psym=2, $
413     xrange=[2,10], yrange=[2,10], xmin=1,ymin=1
414oplot, [2,10], [2,10]
415xyouts, 2.5,9.4, cstat, charsize=0.9
416xyouts, 2.5,8.5, 'cor   bias   std   rmsd', charsize=0.9
417;
418ab=linfit(mean_tao, mean_tmi,yfit=yfit)
419a=float(ab(0))
420b=float(ab(1))
421oplot, mean_tao, yfit, color=250, thick=2
422;
423fi_ws_ncep1=project_id_env+'ws_2000_2009_ncep1_v50.txt'
424res=read_ascii(fi_ws_ncep1,data_start=1)
425ff=res.field1
426lat=reform(ff(0,*))
427lon=reform(ff(1,*))
428cor_nce=reform(ff(2,*))
429cor_ncep=total(cor_nce)/n_elements(cor_nce)
430bias_nce=reform(ff(3,*))
431bias_ncep=total(bias_nce)/n_elements(bias_nce)
432std_nce=reform(ff(4,*))
433std_ncep=total(std_nce)/n_elements(std_nce)
434rmsd_nce=reform(ff(5,*))
435rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
436mean_tao=reform(ff(6,*))
437mean_ncep=bias_nce+mean_tao
438;
439print, ''
440print, 'NCEP'
441print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
442cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
443;
444splot, mean_tao, mean_ncep, title='WS - TAO Vs NCEP', subtitle='', $
445     charsize=1.1, xtitle='TAO WS', ytitle='NCEP WS', small=[2,3,6],/noer, psym=2, $
446     xrange=[2,10], yrange=[2,10], xmin=1,ymin=1
447oplot, [2,10], [2,10]
448xyouts, 2.5,9.4, cstat, charsize=0.9
449xyouts, 2.5,8.5, 'cor   bias   std   rmsd', charsize=0.9
450;
451ab=linfit(mean_tao, mean_ncep,yfit=yfit)
452a=float(ab(0))
453b=float(ab(1))
454oplot, mean_tao, yfit, color=250, thick=2
455;
456closeps
457;
458end
Note: See TracBrowser for help on using the repository browser.