source: trunk/src/paper01/fig9/lwr_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: 15.0 KB
Line 
1;+
2; .. _lwr_validation_scatter_2000_2007.pro:
3;
4; ====================================
5; lwr_validation_scatter_2000_2007.pro
6; ====================================
7;
8; DESCRIPTION
9; ===========
10;
11; .. graphviz::
12;
13;    digraph lwr_validation_scatter_2000_2007 {
14;
15;       lwr_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/lwr_2000_2007_erai.txt"];
16;       lwr_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lwr_2000_2007_trop.txt"];
17;       lwr_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lwr_2000_2007_oaflx.txt"];
18;       lwr_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lwr_2000_2007_ncep.txt"];
19;       lwr_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lwr_2000_2007_ncep1.txt"];
20;       lwr_ncep1_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/fluxe_ncep1_19890101_20091231.nc"];
21;       lwr_clark [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/lwr_2000_2007_clark.txt"];
22;       lwr_erai_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_fluxes_19930101_20090801_TROP_oafluxgrid.nc"];
23;       lwr_tropflux2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_lwr_19890101_20091231.nc"];
24;       lwr_tropflux3 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_19890101_20091231.nc"];
25;       lwr_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/lwr_oafluxgrid_1985_2007.nc"];
26;       lwr_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/NCEP2_flux_19890101_20090729.nc"];
27;
28;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lwr_validation_scatter_2000_2007.ps"];
29;
30;       lwr_validation_scatter_2000_2007 [shape=box,
31;       fontname=Courier,
32;       color=blue,
33;       URL="http://forge.ipsl.jussieu.fr/tropflux/brolwrer/trunk/src/paper01/fig9/lwr_validation_scatter_2000_2007.pro",
34;       label="${TROPFLUX}/src/paper01/fig9/lwr_validation_scatter_2000_2007.pro"];
35;
36;       {lwr_erai lwr_nceplwr_ncep1 lwr_ncep1_2 lwr_clark lwr_erai_oafluxgrid lwr_tropflux2 lwr_tropflux3 lwr_oafluxgrid lwr_ncep2} -> {lwr_validation_scatter_2000_2007} -> {lwr_tropflux lwr_oaflux lwr_ncep lwr_ncep1 figure}
37;    }
38;
39; SEE ALSO
40; ========
41;
42; :ref:`project_profile.sh`
43;
44; :ref:`project_init.pro`
45; :ref:`cm_project.pro`
46;
47; :func:`x_site_location`
48; :func:`y_site_location`
49;
50; :ref:`read_lw_global_v2.pro`
51; :ref:`statistics_3var_v1.pro`
52;
53; EXAMPLES
54; ========
55;
56; ::
57;
58;  date1 = 19890101L
59;  date2 = 20091231L
60;  lwr_validation_scatter_2000_2007, date1, date2
61;
62; TODO
63; ====
64;
65; mùake it work on cratos : missing data
66;
67; ++ mooring data in graphviz
68;
69; coding rules
70;
71; complete description
72;
73; handle IO error
74;
75; EVOLUTIONS
76; ==========
77;
78; $Id$
79;
80; $URL$
81;
82; - fplod 20110420T104246Z aedon.locean-ipsl.upmc.fr (Darwin)
83;
84;   * remove hard coding path
85;   * add graphviz
86;   * externalize functions
87;
88; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
89;
90;   * minimal header
91;
92;-
93pro lwr_validation_scatter_2000_2007, date1, date2
94@cm_general
95@cm_project
96reinitplt, /z,/invert
97key_portrait = 1
98;
99openps, FILENAME = project_od_env+'lwr_validation_scatter_2000_2007.ps'
100; evaluation is done for 20000101-20071231 period
101;
102; location of moorings
103;
104sitelist=['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', '5n165e', '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;
115sitelist=['0n110w', '0n140w', '0n165e', '0n170w', '0n23w', '0n80.5e', '0n95w', '10s10w', '12n23w', '15n38w', $
116          '15n90e', '2n95w', '2s95w', '5n95w', '5s95w', '8n95w', '8s67e', '8s95w']
117;
118ocean='global'
119;
120da1=20000101
121da2=20071231
122nsmooth=1.
123;   This program will create the following text files with statistics of respective variables
124close,/all
125;
126fi_lwr_erai=project_id_env+'lwr_2000_2007_erai.txt'
127openw,1,fi_lwr_erai
128fi_lwr_trop=project_id_env+'lwr_2000_2007_trop.txt'
129openw,2,fi_lwr_trop
130fi_lwr_oaflx=project_id_env+'lwr_2000_2007_oaflx.txt'
131openw,3,fi_lwr_oaflx
132fi_lwr_ncep=project_id_env+'lwr_2000_2007_ncep.txt'
133openw,4,fi_lwr_ncep
134fi_lwr_ncep1=project_id_env+'lwr_2000_2007_ncep1.txt'
135openw,5,fi_lwr_ncep1
136fi_lwr_clark=project_id_env+'lwr_2000_2007_clark.txt'
137openw,6,fi_lwr_clark
138;
139printf,1, 'x     y      cor    bias     std     rmsd'
140printf,2, 'x     y      cor    bias     std     rmsd'
141printf,3, 'x     y      cor    bias     std     rmsd'
142printf,4, 'x     y      cor    bias     std     rmsd'
143printf,5, 'x     y      cor    bias     std     rmsd'
144printf,6, 'x     y      cor    bias     std     rmsd'
145;
146; first reading the whole ERAI uncorrected and corrected data
147;
148file=project_id_env+'erai_fluxes_19930101_20090801_TROP_oafluxgrid.nc'
149initncdf, file
150unc=read_ncdf('lwr',date1,date2,file=file,/nostr)
151help, unc
152;
153file=project_id_env+'TropFlux_lwr_19890101_20091231.nc"
154initncda, file
155cor=read_ncdf('lwr',date1,date2,file=file,/nostr)
156cor=-1*cor
157help, cor
158;
159file=project_id_env+'lwr_oafluxgrid_1985_2007.nc'
160initncdf, file
161oaf=read_ncdf("lwr", date1, date2, file=file,/nostr)
162help, oaf
163;
164fi=project_id_env+'NCEP2_flux_19890101_20090729.nc'
165initncdf, fi
166nce=read_ncdf("lwr", date1, date2, file=fi,/nostr)
167;  nce=-1*nce
168help, nce
169;
170file=project_id_env+'fluxe_ncep1_19890101_20091231.nc'
171initncdf, file
172nce1=-1*read_ncdf("lwr", date1, date2, file=file,/nostr)
173help, nce1
174;
175file=project_id_env+'TropFlux_19890101_20091231.nc'
176initncdf, file
177clark=-1*read_ncdf("lwr", date1, date2, file=file,/nostr)
178help, clark
179;
180nn=n_elements(sitelist)
181for n=0, nn-1 do begin
182;
183; reading data from mooring
184;
185    site=sitelist(n)
186    csite=site
187    print, csite
188    x=x_site_location(site)
189    y=y_site_location(site)
190    if (y ge 0. and y le 30.) then y=y+360.
191    dx=0.5
192    dy=0.5
193    box=[y-dy, y+dy, x-dx, x+dx]
194    read_lw_global_v2, csite, date1, date2, box, $
195                           lw
196;
197    lwr=lw
198    ind=where(finite(lwr))
199    valid=n_elements(ind)
200;
201    if (valid ge 180. ) then begin
202;
203       extract_flux_tropflux,unc,box, $
204       tropflux
205       uncr=tropflux
206;
207       extract_flux_tropflux,cor,box, $
208       tropflux
209       corr=tropflux
210;
211       extract_flux_tropflux,oaf,box, $
212       tropflux
213       oafl=tropflux
214;
215       extract_flux_tropflux,nce,box, $
216       tropflux
217       ncep=tropflux
218;
219        extract_flux_tropflux,nce1,box, $
220                tropflux
221        ncep1=tropflux
222;
223        extract_flux_tropflux,clark,box, $
224                tropflux
225        clrk=tropflux
226;
227        ind=where(finite(lwr))
228        lwr=lwr(ind)
229        uncr_lwr=uncr(ind)
230        corr_lwr=corr(ind)
231        oafl=oafl(ind)
232        ncep=ncep(ind)
233        clrk=clrk(ind)
234        ncep1=ncep1(ind)
235        mean_tao=total(lwr)/n_elements(ind)
236;
237        statistics_3var_v1, lwr, uncr_lwr, corr_lwr, $
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, f4.2,3x,f6.2,3x,f4.2,3x,f5.2,3x,f6.2)'
241        printf, 2, x, y, cor2, bias2, std2, rmsd2, mean_tao,format='(f6.2, 3x, f6.2, 3x, f4.2,3x,f6.2,3x,f4.2,3x,f5.2,3x,f6.2)'
242;
243        statistics_3var_v1, lwr, 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, f4.2,3x,f6.2,3x,f4.2,3x,f5.2,3x,f6.2)'
246        printf, 4, x, y, cor2, bias2, std2, rmsd2, mean_tao,format='(f6.2, 3x, f6.2, 3x, f4.2,3x,f6.2,3x,f4.2,3x,f5.2,3x,f6.2)'
247;
248        statistics_3var_v1, lwr, ncep1, clrk, $
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, f4.2,3x,f6.2,3x,f4.2,3x,f5.2,3x,f6.2)'
251        printf, 6, x, y, cor2, bias2, std2, rmsd2, mean_tao,format='(f6.2, 3x, f6.2, 3x, f4.2,3x,f6.2,3x,f4.2,3x,f5.2,3x,f6.2)'
252;
253    endif
254endfor
255close,/all
256;
257fi_lwr_erai=project_id_env+'lwr_2000_2007_erai.txt'
258res=read_ascii(fi_lwr_erai,data_start=1)
259ff=res.field1
260cor_erai=reform(ff(2,*))
261bias_erai=reform(ff(3,*))
262std_erai=reform(ff(4,*))
263rmsd_erai=reform(ff(5,*))
264mean_tao=reform(ff(6,*))
265mean_erai=mean_tao+bias_erai
266;
267ind=where(finite(cor_erai))
268cor=total(cor_erai,/nan)/n_elements(ind)
269ind=where(finite(bias_erai))
270bias=total(bias_erai,/nan)/n_elements(ind)
271ind=where(finite(rmsd_erai))
272rmsd=total(rmsd_erai,/nan)/n_elements(ind)
273ind=where(finite(std_erai))
274std=total(std_erai,/nan)/n_elements(ind)
275;
276print, ''
277print, 'ERAI'
278print, cor, bias, std, rmsd
279cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
280;
281splot, mean_tao, mean_erai, charsize=1.1, title='LWR - TAO Vs ERAI', $
282     xrange=[0,100], yrange=[0,100], small=[2,3,1], psym=2, xmin=1, ymin=1
283xyouts, 40,10, cstat, charsize=1.
284xyouts, 40,3, 'cor    bias    std    rmsd', charsize=1.
285;
286x=mean_tao
287y=mean_erai
288ab=linfit(x,y,yfit=yfit)
289a=float(ab(0))
290b=float(ab(1))
291print, a,b
292oplot, x, yfit, thick=2, color=250
293oplot, [0,100], [0,100]
294;
295significance_test, mean_tao, mean_erai
296;
297fi_lwr_trop=project_id_env+'lwr_2000_2007_trop.txt'
298res=read_ascii(fi_lwr_trop,data_start=1)
299ff=res.field1
300cor_trop=reform(ff(2,*))
301bias_trop=reform(ff(3,*))
302std_trop=reform(ff(4,*))
303rmsd_trop=reform(ff(5,*))
304mean_tao=reform(ff(6,*))
305mean_trop=mean_tao+bias_trop
306;
307ind=where(finite(cor_trop))
308cor=total(cor_trop,/nan)/n_elements(ind)
309ind=where(finite(bias_trop))
310bias=total(bias_trop,/nan)/n_elements(ind)
311ind=where(finite(rmsd_trop))
312rmsd=total(rmsd_trop,/nan)/n_elements(ind)
313ind=where(finite(std_trop))
314std=total(std_trop,/nan)/n_elements(ind)
315;
316print, ''
317print, 'TropFlux'
318print, cor, bias, std, rmsd
319cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
320;
321splot, mean_tao, mean_trop, charsize=1.1, title='LWR - TAO Vs TropFlux', $
322     xmin=1,ymin=1,xrange=[0,100], yrange=[0,100], small=[2,3,2],/noer, psym=2
323xyouts, 40,10, cstat, charsize=1.
324xyouts, 40,3, 'cor    bias    std    rmsd', charsize=1.
325;
326x=mean_tao
327y=mean_trop
328ab=linfit(x,y,yfit=yfit)
329a=float(ab(0))
330b=float(ab(1))
331print, a,b
332oplot, x, yfit, thick=2, color=250
333oplot, [0,100], [0,100]
334;
335significance_test, mean_tao, mean_trop
336;
337fi_lwr_oaflx=project_id_env+'lwr_2000_2007_oaflx.txt'
338res=read_ascii(fi_lwr_oaflx,data_start=1)
339ff=res.field1
340cor_oaf=reform(ff(2,*))
341bias_oaf=reform(ff(3,*))
342std_oaf=reform(ff(4,*))
343rmsd_oaf=reform(ff(5,*))
344mean_tao=reform(ff(6,*))
345mean_oaf=mean_tao+bias_oaf
346;
347ind=where(finite(cor_oaf))
348cor=total(cor_oaf,/nan)/n_elements(ind)
349ind=where(finite(bias_oaf))
350bias=total(bias_oaf,/nan)/n_elements(ind)
351ind=where(finite(rmsd_oaf))
352rmsd=total(rmsd_oaf,/nan)/n_elements(ind)
353ind=where(finite(std_oaf))
354std=total(std_oaf,/nan)/n_elements(ind)
355;
356print, ''
357print, 'OAFlux'
358print, cor, bias, std, rmsd
359cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
360;
361splot, mean_tao, mean_oaf, charsize=1.1, title='LWR - TAO Vs OAFlux', $
362     xmin=1,ymin=1,xrange=[0,100], yrange=[0,100], small=[2,3,3],/noer, psym=2
363xyouts, 40,10, cstat, charsize=1.
364xyouts, 40,3, 'cor    bias    std    rmsd', charsize=1.
365;
366x=mean_tao
367y=mean_oaf
368ab=linfit(x,y,yfit=yfit)
369a=float(ab(0))
370b=float(ab(1))
371print, a,b
372oplot, x, yfit, thick=2, color=250
373oplot, [0,100], [0,100]
374;
375significance_test, mean_tao, mean_oaf
376;
377fi_lwr_ncep=project_id_env+'lwr_2000_2007_ncep.txt'
378res=read_ascii(fi_lwr_ncep,data_start=1)
379ff=res.field1
380cor_nce=reform(ff(2,*))
381bias_nce=reform(ff(3,*))
382std_nce=reform(ff(4,*))
383rmsd_nce=reform(ff(5,*))
384mean_tao=reform(ff(6,*))
385mean_nce=mean_tao+bias_nce
386;
387ind=where(finite(cor_nce))
388cor=total(cor_nce,/nan)/n_elements(ind)
389ind=where(finite(bias_nce))
390bias=total(bias_nce,/nan)/n_elements(ind)
391ind=where(finite(rmsd_nce))
392rmsd=total(rmsd_nce,/nan)/n_elements(ind)
393ind=where(finite(std_nce))
394std=total(std_nce,/nan)/n_elements(ind)
395;
396print, ''
397print, 'NCEP2'
398print, cor, bias, std, rmsd
399cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
400;
401splot, mean_tao, mean_nce, charsize=1.1, title='LWR - TAO Vs NCEP2', $
402     xmin=1,ymin=1,xrange=[0,100], yrange=[0,100], small=[2,3,4],/noer, psym=2
403xyouts, 40,10, cstat, charsize=1.
404xyouts, 40,3, 'cor    bias    std    rmsd', charsize=1.
405;
406x=mean_tao
407y=mean_nce
408ab=linfit(x,y,yfit=yfit)
409a=float(ab(0))
410b=float(ab(1))
411print, a,b
412oplot, x, yfit, thick=2, color=250
413oplot, [0,100], [0,100]
414;
415significance_test, mean_tao, mean_nce
416;
417fi_lwr_ncep1=project_id_env+'lwr_2000_2007_ncep1.txt'
418res=read_ascii(fi_lwr_ncep1,data_start=1)
419ff=res.field1
420cor_nce=reform(ff(2,*))
421bias_nce=reform(ff(3,*))
422std_nce=reform(ff(4,*))
423rmsd_nce=reform(ff(5,*))
424mean_tao=reform(ff(6,*))
425mean_nce=mean_tao+bias_nce
426;
427ind=where(finite(cor_nce))
428cor=total(cor_nce,/nan)/n_elements(ind)
429ind=where(finite(bias_nce))
430bias=total(bias_nce,/nan)/n_elements(ind)
431ind=where(finite(rmsd_nce))
432rmsd=total(rmsd_nce,/nan)/n_elements(ind)
433ind=where(finite(std_nce))
434std=total(std_nce,/nan)/n_elements(ind)
435;
436print, ''
437print, 'NCEP1'
438print, cor, bias, std, rmsd
439cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
440;
441splot, mean_tao, mean_nce, charsize=1.1, title='LWR - TAO Vs NCEP1', $
442     xmin=1,ymin=1,xrange=[0,100], yrange=[0,100], small=[2,3,5],/noer, psym=2
443xyouts, 40,10, cstat, charsize=1.
444xyouts, 40,3, 'cor    bias    std    rmsd', charsize=1.
445;
446x=mean_tao
447y=mean_nce
448ab=linfit(x,y,yfit=yfit)
449a=float(ab(0))
450b=float(ab(1))
451print, a,b
452oplot, x, yfit, thick=2, color=250
453oplot, [0,100], [0,100]
454;
455significance_test, mean_tao, mean_nce
456;
457fi_lwr_clark=project_id_env+'lwr_2000_2007_clark.txt'
458res=read_ascii(fi_lwr_clark,data_start=1)
459ff=res.field1
460cor_clark=reform(ff(2,*))
461bias_clark=reform(ff(3,*))
462std_clark=reform(ff(4,*))
463rmsd_clark=reform(ff(5,*))
464mean_tao=reform(ff(6,*))
465mean_clark=mean_tao+bias_clark
466;
467ind=where(finite(cor_clark))
468cor=total(cor_clark,/nan)/n_elements(ind)
469ind=where(finite(bias_clark))
470bias=total(bias_clark,/nan)/n_elements(ind)
471ind=where(finite(rmsd_clark))
472rmsd=total(rmsd_clark,/nan)/n_elements(ind)
473ind=where(finite(std_clark))
474std=total(std_clark,/nan)/n_elements(ind)
475;
476print, ''
477print, 'CLARK LWR'
478print, cor, bias, std, rmsd
479cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
480;
481splot, mean_tao, mean_clark, charsize=1.1, title='LWR - TAO Vs CLARK', $
482     xmin=1,ymin=1,xrange=[0,100], yrange=[0,100], small=[2,3,6],/noer, psym=2
483xyouts, 40,10, cstat, charsize=1.
484xyouts, 40,3, 'cor    bias    std    rmsd', charsize=1.
485;
486x=mean_tao
487y=mean_clark
488ab=linfit(x,y,yfit=yfit)
489a=float(ab(0))
490b=float(ab(1))
491print, a,b
492oplot, x, yfit, thick=2, color=250
493oplot, [0,100], [0,100]
494;
495significance_test, mean_tao, mean_clark
496;
497closeps
498;
499end
Note: See TracBrowser for help on using the repository browser.