source: trunk/src/paper01/fig3/ws_validation_scatter_2000_2009_v50.pro @ 70

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

replace TROPFLUX by PROJECT

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