source: trunk/src/paper01/fig9/swr_validation_scatter_2000_2007.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: 14.8 KB
Line 
1;+
2; .. _swr_validation_scatter_2000_2007.pro:
3;
4; ====================================
5; swr_validation_scatter_2000_2007.pro
6; ====================================
7;
8; DESCRIPTION
9; ===========
10;
11; .. graphviz::
12;
13;    digraph swr_validation_scatter_2000_2007 {
14;
15;       swr_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/swr_2000_2007_erai_v50.txt"];
16;       swr_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_2000_2007_trop_v50.txt"];
17;       swr_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_2000_2007_oaflx_v50.txt"];
18;       swr_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_2000_2007_ncep_v50.txt"];
19;       swr_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_2000_2007_ncep1_v50.txt"];
20;       swr_olr [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_2000_2007_olr_v50.txt"];
21;       swr_ncep1_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/fluxe_ncep1_19890101_20091231.nc"];
22;       swr_erai_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_fluxes_20000101_20090801_TROP_oafluxgrid.nc"];
23;       swr_tropflux2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_swr_19890101_20091231_DT_v51.nc"];
24;       swr_tropflux3 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_19890101_20091231.nc"];
25;       swr_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/swr_oafluxgrid_1985_2007.nc"];
26;       swr_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/swr_ncep2_oaflxgrid_19890101_20091231.nc"];
27;
28;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_validation_scatter_2000_2007.ps"];
29;
30;       swr_validation_scatter_2000_2007 [shape=box,
31;       fontname=Courier,
32;       color=blue,
33;       URL="http://forge.ipsl.jussieu.fr/tropflux/broswrer/trunk/src/paper01/fig9/swr_validation_scatter_2000_2007.pro",
34;       label="${TROPFLUX}/src/paper01/fig9/swr_validation_scatter_2000_2007.pro"];
35;
36;       {swr_erai swr_ncep1_2 swr_erai_oafluxgrid swr_tropflux2 swr_tropflux3 swr_oafluxgrid swr_ncep2} -> {swr_validation_scatter_2000_2007} -> {swr_tropflux swr_oaflux swr_ncep swr_olr swr_ncep1 figure}
37;    }
38;
39; SEE ALSO
40; ========
41;
42; :ref:`project_profile.sh`
43; :ref:`project_init.pro`
44; :ref:`cm_project.pro`
45;
46; :func:`x_site_location`
47; :func:`y_site_location`
48;
49; :ref:`read_global_sw_v50.pro`
50; :ref:`statistics_3var_v1.pro`
51;
52; EXAMPLES
53; ========
54;
55; ::
56;
57;  date1 = 19890101L
58;  date2 = 20091231L
59;  swr_validation_scatter_2000_2007, date1, date2
60;
61; TODO
62; ====
63;
64; make it work on cratos : missing data
65;
66; ++ mooring data in graphviz
67;
68; coding rules
69;
70; complete description
71;
72; handle IO error
73;
74; EVOLUTIONS
75; ==========
76;
77; $Id$
78;
79; $URL$
80;
81; - fplod 20110420T105004Z aedon.locean-ipsl.upmc.fr (Darwin)
82;
83;   * remove hard coding path
84;   * add graphviz
85;   * externalize functions
86;
87; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
88;
89;   * minimal header
90;
91;-
92pro swr_validation_scatter_2000_2007, date1, date2
93@cm_genral
94@cm_project
95reinitplt, /z,/invert
96key_portrait = 1
97;
98openps, FILENAME = project_od_env+'swr_validation_scatter_2000_2007.ps'
99;
100; evaluation is done for 20000101-20071231 period
101;
102; location of mooring
103;
104sitelist=['5n165e','8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
105           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $
106           '8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
107          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
108          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
109          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
110          '2n95w', '5n147e', '5n156e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
111          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $
112          '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
113          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
114;
115ocean='global'
116;
117;da1=20000101
118;da2=20071231
119nsmooth=1.
120;   This program will create the following text files with statistics of respective variables
121close,/all
122;
123fi_swr_erai=project_id_env+'swr_2000_2007_erai_v50.txt'
124openw,1,fi_swr_erai
125fi_swr_trop=project_id_env+'swr_2000_2007_trop_v50.txt'
126openw,2,fi_swr_trop
127fi_swr_oaflx=project_id_env+'swr_2000_2007_oaflx_v50.txt'
128openw,3,fi_swr_oaflx
129fi_swr_ncep=project_id_env+'swr_2000_2007_ncep_v50.txt'
130openw,4,fi_swr_ncep
131fi_swr_ncep1=project_id_env+'swr_2000_2007_ncep1_v50.txt'
132openw,5,fi_swr_ncep1
133fi_swr_olr=project_id_env+'swr_2000_2007_olr_v50.txt'
134openw,6,fi_swr_olr
135;
136printf,1, 'x     y      cor    bias     std     rmsd      mean_tao'
137printf,2, 'x     y      cor    bias     std     rmsd      mean_tao'
138printf,3, 'x     y      cor    bias     std     rmsd      mean_tao'
139printf,4, 'x     y      cor    bias     std     rmsd      mean_tao'
140printf,5, 'x     y      cor    bias     std     rmsd      mean_tao'
141printf,6, 'x     y      cor    bias     std     rmsd      mean_tao'
142;
143; first reading the whole ERAI uncorrected and corrected data
144;
145file=project_id_env+'erai_fluxes_20000101_20090801_TROP_oafluxgrid.nc'
146initncdf, file
147unc=read_ncdf('swr',date1,date2,file=file,/nostr)
148unc=-1*unc
149help, unc
150;
151file=project_id_env+'TropFlux_swr_19890101_20071231_DT_v51.nc'
152initncdf, file
153cor=read_ncdf('swr',date1,date2,file=file,/nostr)
154help, cor
155;
156file=project_id_env+'swr_oafluxgrid_1985_2007.nc'
157initncdf, file
158oaf=read_ncdf("swr", date1, date2, file=file,/nostr)
159help, oaf
160;
161fi=project_id_env+'swr_ncep2_oaflxgrid_19890101_20091231.nc'
162initncdf, fi
163nce=read_ncdf("swr", date1, date2, file=fi,/nostr)
164nce=0.94*nce
165help, nce
166;
167file=project_id_env+'fluxe_ncep1_19890101_20091231.nc'
168initncdf, file
169nce1=read_ncdf("swr", date1, date2, file=file,/nostr)
170help, nce1
171;
172file=project_id_env+'TropFlux_swr_19890101_20091231_NRT_v50.nc'
173initncdf, file
174sw_olr=read_ncdf("sw", date1-1, date2, file=file,/nostr)
175help, sw_olr
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;
191    read_global_sw_v50, csite, date1, date2, box, $
192                           sw
193;
194    swr=sw
195    ind=where(finite(swr))
196    valid=n_elements(ind)
197;
198    if (valid ge 180. ) then begin
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        extract_flux_tropflux,sw_olr,box, $
221                tropflux
222        olr=tropflux
223;
224        ind=where(finite(swr))
225        swr=swr(ind)
226        uncr_swr=uncr(ind)
227        corr_swr=corr(ind)
228        oafl=oafl(ind)
229        ncep=ncep(ind)
230        ncep1=ncep1(ind)
231        olr_sw=olr(ind)
232        mean_tao=total(swr,/nan)/n_elements(swr)
233;
234        statistics_3var_v1, swr, uncr_swr, corr_swr, $
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, f4.2,3x,f7.2,3x,f4.2,3x,f5.2,3x,f6.2)'
238        printf, 2, x, y, cor2, bias2, std2, rmsd2, mean_tao, format='(f6.2, 3x, f6.2, 3x, f4.2,3x,f7.2,3x,f4.2,3x,f5.2,3x,f6.2)'
239;
240        statistics_3var_v1, swr, 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, f4.2,3x,f7.2,3x,f4.2,3x,f5.2,3x,f6.2)'
243        printf, 4, x, y, cor2, bias2, std2, rmsd2, mean_tao,format='(f6.2, 3x, f6.2, 3x, f4.2,3x,f7.2,3x,f4.2,3x,f5.2,3x,f6.2)'
244;
245        statistics_3var_v1, swr, ncep1, olr_sw, $
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, f4.2,3x,f7.2,3x,f4.2,3x,f5.2,3x,f6.2)'
248        printf, 6, x, y, cor2, bias2, std2, rmsd2, mean_tao,format='(f6.2, 3x, f6.2, 3x, f4.2,3x,f7.2,3x,f4.2,3x,f5.2,3x,f6.2)'
249;
250    endif
251endfor
252;
253close,/all
254;
255fi_swr_erai=project_id_env+'swr_2000_2007_erai_v50.txt'
256res=read_ascii(fi_swr_erai,data_start=1)
257ff=res.field1
258cor_erai=reform(ff(2,*))
259bias_erai=reform(ff(3,*))
260std_erai=reform(ff(4,*))
261rmsd_erai=reform(ff(5,*))
262mean_tao=reform(ff(6,*))
263mean_erai=mean_tao+bias_erai
264;
265ind=where(finite(cor_erai))
266cor=total(cor_erai,/nan)/n_elements(ind)
267ind=where(finite(bias_erai))
268bias=total(bias_erai,/nan)/n_elements(ind)
269ind=where(finite(rmsd_erai))
270rmsd=total(rmsd_erai,/nan)/n_elements(ind)
271ind=where(finite(std_erai))
272std=total(std_erai,/nan)/n_elements(ind)
273;
274print, ''
275print, 'ERAI'
276print, cor, bias, std, rmsd
277cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
278;
279splot, mean_tao, mean_erai, charsize=1.1, title='SWR - TAO Vs ERAI', $
280     xrange=[100,300], yrange=[100,300], small=[2,3,1], psym=2, xmin=1, ymin=1
281xyouts, 180,175, cstat, charsize=1.
282xyouts, 180,160, 'cor    bias    std    rmsd', charsize=1.
283;
284x=mean_tao
285y=mean_erai
286ab=linfit(x,y,yfit=yfit)
287a=float(ab(0))
288b=float(ab(1))
289print, a,b
290oplot, x, yfit, thick=2, color=250
291oplot, [100,300], [100,300]
292;
293fi_swr_trop=project_id_env+'swr_2000_2007_trop_v50.txt'
294res=read_ascii(fi_swr_trop,data_start=1)
295ff=res.field1
296cor_trop=reform(ff(2,*))
297bias_trop=reform(ff(3,*))
298std_trop=reform(ff(4,*))
299rmsd_trop=reform(ff(5,*))
300mean_tao=reform(ff(6,*))
301mean_trop=mean_tao+bias_trop
302;
303ind=where(finite(cor_trop))
304cor=total(cor_trop,/nan)/n_elements(ind)
305ind=where(finite(bias_trop))
306bias=total(bias_trop,/nan)/n_elements(ind)
307ind=where(finite(rmsd_trop))
308rmsd=total(rmsd_trop,/nan)/n_elements(ind)
309ind=where(finite(std_trop))
310std=total(std_trop,/nan)/n_elements(ind)
311;
312print, ''
313print, 'TropFlux'
314print, cor, bias, std, rmsd
315cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
316;
317splot, mean_tao, mean_trop, charsize=1.1, title='SWR - TAO Vs TropFlux_DT', $
318     xmin=1,ymin=1,xrange=[100,300], yrange=[100,300], small=[2,3,2],/noer, psym=2
319xyouts, 180,175, cstat, charsize=1.
320xyouts, 180,160, 'cor    bias    std    rmsd', charsize=1.
321;
322x=mean_tao
323y=mean_trop
324ab=linfit(x,y,yfit=yfit)
325a=float(ab(0))
326b=float(ab(1))
327print, a,b
328oplot, x, yfit, thick=2, color=250
329oplot, [100,300], [100,300]
330;
331fi_swr_oaflx=project_id_env+'swr_2000_2007_oaflx_v50.txt'
332res=read_ascii(fi_swr_oaflx,data_start=1)
333ff=res.field1
334cor_oaf=reform(ff(2,*))
335bias_oaf=reform(ff(3,*))
336std_oaf=reform(ff(4,*))
337rmsd_oaf=reform(ff(5,*))
338mean_tao=reform(ff(6,*))
339mean_oaf=mean_tao+bias_oaf
340;
341ind=where(finite(cor_oaf))
342cor=total(cor_oaf,/nan)/n_elements(ind)
343ind=where(finite(bias_oaf))
344bias=total(bias_oaf,/nan)/n_elements(ind)
345ind=where(finite(rmsd_oaf))
346rmsd=total(rmsd_oaf,/nan)/n_elements(ind)
347ind=where(finite(std_oaf))
348std=total(std_oaf,/nan)/n_elements(ind)
349;
350print, ''
351print, 'OAFlux'
352print, cor, bias, std, rmsd
353cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
354;
355splot, mean_tao, mean_oaf, charsize=1.1, title='SWR - TAO Vs OAFlux', $
356     xmin=1,ymin=1,xrange=[100,300], yrange=[100,300], small=[2,3,3],/noer, psym=2
357xyouts, 180,175, cstat, charsize=1.
358xyouts, 180,160, 'cor    bias    std    rmsd', charsize=1.
359;
360x=mean_tao
361y=mean_oaf
362ab=linfit(x,y,yfit=yfit)
363a=float(ab(0))
364b=float(ab(1))
365print, a,b
366oplot, x, yfit, thick=2, color=250
367oplot, [100,300], [100,300]
368;
369fi_swr_ncep=project_id_env+'swr_2000_2007_ncep_v50.txt'
370res=read_ascii(fi_swr_ncep,data_start=1)
371ff=res.field1
372cor_nce=reform(ff(2,*))
373bias_nce=reform(ff(3,*))
374std_nce=reform(ff(4,*))
375rmsd_nce=reform(ff(5,*))
376mean_tao=reform(ff(6,*))
377mean_nce=mean_tao+bias_nce
378;
379ind=where(finite(cor_nce))
380cor=total(cor_nce,/nan)/n_elements(ind)
381ind=where(finite(bias_nce))
382bias=total(bias_nce,/nan)/n_elements(ind)
383ind=where(finite(rmsd_nce))
384rmsd=total(rmsd_nce,/nan)/n_elements(ind)
385ind=where(finite(std_nce))
386std=total(std_nce,/nan)/n_elements(ind)
387;
388print, ''
389print, 'NCEP2'
390print, cor, bias, std, rmsd
391cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
392;
393splot, mean_tao, mean_nce, charsize=1.1, title='SWR - TAO Vs NCEP2', $
394     xmin=1,ymin=1,xrange=[100,300], yrange=[100,300], small=[2,3,4],/noer, psym=2
395xyouts, 180,175, cstat, charsize=1.
396xyouts, 180,160, 'cor    bias    std    rmsd', charsize=1.
397;
398x=mean_tao
399y=mean_nce
400ab=linfit(x,y,yfit=yfit)
401a=float(ab(0))
402b=float(ab(1))
403print, a,b
404oplot, x, yfit, thick=2, color=250
405oplot, [100,300], [100,300]
406;
407fi_swr_ncep1=project_id_env+'swr_2000_2007_ncep1_v50.txt'
408res=read_ascii(fi_swr_ncep1,data_start=1)
409ff=res.field1
410cor_nce=reform(ff(2,*))
411bias_nce=reform(ff(3,*))
412std_nce=reform(ff(4,*))
413rmsd_nce=reform(ff(5,*))
414mean_tao=reform(ff(6,*))
415mean_nce=mean_tao+bias_nce
416;
417ind=where(finite(cor_nce))
418cor=total(cor_nce,/nan)/n_elements(ind)
419ind=where(finite(bias_nce))
420bias=total(bias_nce,/nan)/n_elements(ind)
421ind=where(finite(rmsd_nce))
422rmsd=total(rmsd_nce,/nan)/n_elements(ind)
423ind=where(finite(std_nce))
424std=total(std_nce,/nan)/n_elements(ind)
425;
426print, ''
427print, 'NCEP1'
428print, cor, bias, std, rmsd
429cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
430;
431splot, mean_tao, mean_nce, charsize=1.1, title='SWR - TAO Vs NCEP1', $
432     xmin=1,ymin=1,xrange=[100,300], yrange=[100,300], small=[2,3,5],/noer, psym=2
433xyouts, 180,175, cstat, charsize=1.
434xyouts, 180,160, 'cor    bias    std    rmsd', charsize=1.
435;
436x=mean_tao
437y=mean_nce
438ab=linfit(x,y,yfit=yfit)
439a=float(ab(0))
440b=float(ab(1))
441print, a,b
442oplot, x, yfit, thick=2, color=250
443oplot, [100,300], [100,300]
444;
445fi_swr_olr=project_id_env+'swr_2000_2007_olr_v50.txt'
446res=read_ascii(fi_swr_olr,data_start=1)
447ff=res.field1
448cor_olr=reform(ff(2,*))
449bias_olr=reform(ff(3,*))
450std_olr=reform(ff(4,*))
451rmsd_olr=reform(ff(5,*))
452mean_tao=reform(ff(6,*))
453mean_olr=mean_tao+bias_olr
454;
455ind=where(finite(cor_olr))
456cor=total(cor_olr,/nan)/n_elements(ind)
457ind=where(finite(bias_olr))
458bias=total(bias_olr,/nan)/n_elements(ind)
459ind=where(finite(rmsd_olr))
460rmsd=total(rmsd_olr,/nan)/n_elements(ind)
461ind=where(finite(std_olr))
462std=total(std_olr,/nan)/n_elements(ind)
463;
464print, ''
465print, 'SWR_olr'
466print, cor, bias, std, rmsd
467cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
468;
469splot, mean_tao, mean_olr, charsize=1.1, title='SWR - TAO Vs SWR_olr', $
470     xmin=1,ymin=1,xrange=[100,300], yrange=[100,300], small=[2,3,6],/noer, psym=2
471xyouts, 180,175, cstat, charsize=1.
472xyouts, 180,160, 'cor    bias    std    rmsd', charsize=1.
473;
474x=mean_tao
475y=mean_olr
476ab=linfit(x,y,yfit=yfit)
477a=float(ab(0))
478b=float(ab(1))
479print, a,b
480oplot, x, yfit, thick=2, color=250
481oplot, [100,300], [100,300]
482;
483closeps
484;
485end
Note: See TracBrowser for help on using the repository browser.