source: trunk/src/paper01/fig8/lhf_validation_scatter_2000_2009.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: 12.8 KB
Line 
1;+
2; .. _lhf_validation_scatter_2000_2009.pro:
3;
4; ====================================
5; lhf_validation_scatter_2000_2009.pro
6; ====================================
7;
8; DESCRIPTION
9; ===========
10;
11; .. graphviz::
12;
13;    digraph lhf_validation_scatter_2000_2009 {
14;
15;       lhf_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/lhf_2000_2009_erai_v52.txt"];
16;       lhf_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lhf_2000_2009_trop_v52.txt"];
17;       lhf_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lhf_2000_2009_oaflx_v52.txt"];
18;       lhf_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lhf_2000_2009_ncep_v52.txt"];
19;       lhf_ncep2_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/lhf_ncep2_oafluxgrid_19890101_20091231.nc"];
20;       lhf_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lhf_2000_2009_ncep1_v52.txt"];
21;       lhf_ncep1_2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/fluxe_ncep1_19890101_20091231.nc"];
22;       lhf_erai_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_lhf_19890101_20091231_oafluxgrid.nc"];
23;       lhf_tropflux2 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_19890101_20091231.nc"];
24;       lhf_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/lhf_oafluxgrid_1985_2009.nc"];
25;
26;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lhf_validation_scatter_2000_2009.ps"];
27;
28;       lhf_validation_scatter_2000_2009 [shape=box,
29;       fontname=Courier,
30;       color=blue,
31;       URL="http://forge.ipsl.jussieu.fr/tropflux/brolhfer/trunk/src/paper01/fig7/lhf_validation_scatter_2000_2009.pro",
32;       label="${TROPFLUX}/src/paper01/fig7/lhf_validation_scatter_2000_2009.pro"];
33;
34;       {lhf_erai lhf_ncep2_oafluxgrid lhf_ncep1_2 lhf_erai_oafluxgrid lhf_tropflux2 lhf_oafluxgrid} -> {lhf_validation_scatter_2000_2009} -> {lhf_tropflux lhf_oaflux lhf_ncep lhf_ncep1 figure}
35;    }
36;
37; SEE ALSO
38; ========
39;
40; :ref:`project_profile.sh`
41; :ref:`project_init.pro`
42; :ref:`cm_project.pro`
43;
44; :func:`x_site_location`
45; :func:`y_site_location`
46;
47; :ref:`read_variables_v2.pro`
48; :ref:`statistics_3var_v1.pro`
49;
50; EXAMPLES
51; ========
52;
53; ::
54;
55;  date1 = 19890101L
56;  date2 = 20091231L
57;  lhf_validation_scatter_2000_2009, date1, date2
58;
59; TODO
60; ====
61;
62; make it work on cratos : missing data
63;
64; ++ mooring data in graphviz
65;
66; coding rules
67;
68; complete description
69;
70; handle IO error
71;
72; EVOLUTIONS
73; ==========
74;
75; $Id$
76;
77; $URL$
78;
79; - fplod 20110420T102937Z aedon.locean-ipsl.upmc.fr (Darwin)
80;
81;   * remove hard coding path
82;   * add graphviz
83;   * externalize functions
84;
85; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
86;
87;   * minimal header
88;
89;-
90pro lhf_validation_scatter_2000_2009,date1,date2
91@cm_general
92@cm_project
93reinitplt, /z,/invert
94key_portrait = 1
95;
96openps, FILENAME = project_od_env+'lhf_validation_scatter_2000_2009.ps'
97;
98; evaluation is done for 20000101 - 20091231 period
99; location of moorings
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;
114;   This program will create the following text files with statistics of respective variables
115close,/all
116;
117fi_lhf_erai=project_id_env+'lhf_2000_2009_erai_v52.txt'
118openw,1,fi_lhf_erai
119fi_lhf_trop=project_id_env+'lhf_2000_2009_trop_v52.txt'
120openw,2,fi_lhf_trop
121fi_lhf_oaflx=project_id_env+'lhf_2000_2009_oaflx_v52.txt'
122openw,3,fi_lhf_oaflx
123fi_lhf_ncep=project_id_env+'lhf_2000_2009_ncep_v52.txt'
124openw,4,fi_lhf_ncep
125fi_lhf_ncep1=project_id_env+'lhf_2000_2009_ncep1_v52.txt'
126openw,5,fi_lhf_ncep1
127;
128printf,1, 'x     y      cor    bias     std     rmsd      mean_tao'
129printf,2, 'x     y      cor    bias     std     rmsd      mean_tao'
130printf,3, 'x     y      cor    bias     std     rmsd      mean_tao'
131printf,4, 'x     y      cor    bias     std     rmsd      mean_tao'
132;
133; first reading the whole ERAI uncorrected and corrected data
134;
135file=project_id_env+'erai_lhf_19890101_20091231_oafluxgrid.nc'
136initncdf, file
137unc=read_ncdf('lhf',date1,date2,file=file,/nostr)
138help, unc
139;
140file=project_id_env+"TropFlux_19890101_20091231.nc"
141initncdf, file
142cor=read_ncdf('lhf',date1,date2,file=file,/nostr)
143cor=-1*cor
144help, cor
145;
146file=project_id_env+'lhf_oafluxgrid_1985_2009.nc'
147initncdf, file
148oaf=read_ncdf("lhf", date1, date2, file=file,/nostr)
149help, oaf
150;
151fi=project_id_env+'lhf_ncep2_oafluxgrid_19890101_20091231.nc'
152initncdf, fi
153nce=read_ncdf("lhf", date1, date2, file=fi,/nostr)
154help, nce
155;
156file=project_id_env+'fluxe_ncep1_19890101_20091231.nc'
157initncdf, file
158nce1=-1*read_ncdf("lhf", date1, date2, file=file,/nostr)
159help, nce1
160;
161nsmooth=1.
162nn=n_elements(sitelist)
163for n=0, nn-1 do begin
164;
165; reading data from mooring
166;
167    site=sitelist(n)
168    csite=site
169    print, csite
170    x=x_site_location(site)
171    y=y_site_location(site)
172    if (y ge 0. and y le 30.) then y=y+360.
173    dx=0.5
174    dy=0.5
175    box=[y-dy, y+dy, x-dx, x+dx]
176    read_variables_v2, csite,date1,date2,nsmooth, $
177         at, sw,rh,sst,wu,wv,ws,lh
178;
179    lhf=lh
180    ind=where(finite(lhf))
181    valid=n_elements(ind)
182;
183    if (valid ge 180. ) then begin
184;
185        extract_flux_tropflux,unc,box, $
186        tropflux
187        uncr=tropflux
188;
189        extract_flux_tropflux,cor,box, $
190        tropflux
191        corr=tropflux
192;
193        extract_flux_tropflux,oaf,box, $
194        tropflux
195        oafl=tropflux
196;
197        extract_flux_tropflux,nce,box, $
198        tropflux
199        ncep=tropflux
200;
201        extract_flux_tropflux,nce1,box, $
202                tropflux
203        ncep1=tropflux
204;
205        ind=where(finite(lhf))
206        lhf=lhf(ind)
207        uncr_lhf=uncr(ind)
208        corr_lhf=corr(ind)
209        oafl=oafl(ind)
210        ncep=ncep(ind)
211        ncep1=ncep1(ind)
212        mean_tao=total(lhf,/nan)/n_elements(lhf)
213;
214        statistics_3var_v1, lhf, uncr_lhf, corr_lhf, $
215        cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
216;
217        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)'
218        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)'
219;
220        statistics_3var_v1, lhf, oafl, ncep, $
221        cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
222        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)'
223        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)'
224;
225        statistics_3var_v1, lhf, ncep1, ncep, $
226                cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
227        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)'
228;
229    endif
230endfor
231;
232close,/all
233;
234fi_lhf_erai=project_id_env+'lhf_2000_2009_erai_v52.txt'
235res=read_ascii(fi_lhf_erai,data_start=1)
236ff=res.field1
237cor_erai=reform(ff(2,*))
238bias_erai=reform(ff(3,*))
239std_erai=reform(ff(4,*))
240rmsd_erai=reform(ff(5,*))
241mean_tao=reform(ff(6,*))
242mean_erai=mean_tao+bias_erai
243;
244ind=where(finite(cor_erai))
245cor=total(cor_erai,/nan)/n_elements(ind)
246ind=where(finite(bias_erai))
247bias=total(bias_erai,/nan)/n_elements(ind)
248ind=where(finite(rmsd_erai))
249rmsd=total(rmsd_erai,/nan)/n_elements(ind)
250ind=where(finite(std_erai))
251std=total(std_erai,/nan)/n_elements(ind)
252;
253print, ''
254print, 'ERAI'
255print, cor, bias, std, rmsd
256cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
257;
258splot, mean_tao, mean_erai, charsize=1.1, title='LHF - TAO Vs ERAI', $
259     xrange=[20,200], yrange=[20,200], small=[2,3,1], psym=2
260xyouts, 50,25, cstat, charsize=1.
261xyouts, 50,10, 'cor    bias    std    rmsd', charsize=1.
262;
263x=mean_tao
264y=mean_erai
265ab=linfit(x,y,yfit=yfit)
266a=float(ab(0))
267b=float(ab(1))
268print, a,b
269oplot, x, yfit, thick=2, color=250
270oplot, [20,200], [20,200]
271;
272fi_lhf_trop=project_id_env+'lhf_2000_2009_trop_v52.txt'
273res=read_ascii(fi_lhf_trop,data_start=1)
274ff=res.field1
275cor_trop=reform(ff(2,*))
276bias_trop=reform(ff(3,*))
277std_trop=reform(ff(4,*))
278rmsd_trop=reform(ff(5,*))
279mean_tao=reform(ff(6,*))
280mean_trop=mean_tao+bias_trop
281;
282ind=where(finite(cor_trop))
283cor=total(cor_trop,/nan)/n_elements(ind)
284ind=where(finite(bias_trop))
285bias=total(bias_trop,/nan)/n_elements(ind)
286ind=where(finite(rmsd_trop))
287rmsd=total(rmsd_trop,/nan)/n_elements(ind)
288ind=where(finite(std_trop))
289std=total(std_trop,/nan)/n_elements(ind)
290;
291print, ''
292print, 'TropFlux'
293print, cor, bias, std, rmsd
294cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
295;
296splot, mean_tao, mean_trop, charsize=1.1, title='LHF - TAO Vs TropFlux', $
297     xrange=[20,200], yrange=[20,200], small=[2,3,2],/noer, psym=2
298x=mean_tao
299y=mean_trop
300xyouts, 50,25, cstat, charsize=1.
301xyouts, 50,10, 'cor    bias    std    rmsd', charsize=1.
302;
303ab=linfit(x,y,yfit=yfit)
304a=float(ab(0))
305b=float(ab(1))
306print, a,b
307oplot, x, yfit, thick=2, color=250
308oplot, [20,200], [20,200]
309;
310fi_lhf_oaflx=project_id_env+'lhf_2000_2009_oaflx_v52.txt'
311res=read_ascii(fi_lhf_oaflx,data_start=1)
312ff=res.field1
313cor_oaf=reform(ff(2,*))
314bias_oaf=reform(ff(3,*))
315std_oaf=reform(ff(4,*))
316rmsd_oaf=reform(ff(5,*))
317mean_tao=reform(ff(6,*))
318mean_oaf=mean_tao+bias_oaf
319;
320ind=where(finite(cor_oaf))
321cor=total(cor_oaf,/nan)/n_elements(ind)
322ind=where(finite(bias_oaf))
323bias=total(bias_oaf,/nan)/n_elements(ind)
324ind=where(finite(rmsd_oaf))
325rmsd=total(rmsd_oaf,/nan)/n_elements(ind)
326ind=where(finite(std_oaf))
327std=total(std_oaf,/nan)/n_elements(ind)
328;
329print, ''
330print, 'OAFlux'
331print, cor, bias, std, rmsd
332cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
333;
334splot, mean_tao, mean_oaf, charsize=1.1, title='LHF - TAO Vs OAFlux', $
335     xrange=[20,200], yrange=[20,200], small=[2,3,3],/noer, psym=2
336xyouts, 50,25, cstat, charsize=1.
337xyouts, 50,10, 'cor    bias    std    rmsd', charsize=1.
338;
339x=mean_tao
340y=mean_oaf
341ab=linfit(x,y,yfit=yfit)
342a=float(ab(0))
343b=float(ab(1))
344print, a,b
345oplot, x, yfit, thick=2, color=250
346oplot, [20,200], [20,200]
347;
348fi_lhf_ncep=project_id_env+'lhf_2000_2009_ncep_v52.txt'
349res=read_ascii(fi_lhf_ncep,data_start=1)
350ff=res.field1
351cor_nce=reform(ff(2,*))
352bias_nce=reform(ff(3,*))
353std_nce=reform(ff(4,*))
354rmsd_nce=reform(ff(5,*))
355mean_tao=reform(ff(6,*))
356mean_nce=mean_tao+bias_nce
357;
358ind=where(finite(cor_nce))
359cor=total(cor_nce,/nan)/n_elements(ind)
360ind=where(finite(bias_nce))
361bias=total(bias_nce,/nan)/n_elements(ind)
362ind=where(finite(rmsd_nce))
363rmsd=total(rmsd_nce,/nan)/n_elements(ind)
364ind=where(finite(std_nce))
365std=total(std_nce,/nan)/n_elements(ind)
366;
367print, ''
368print, 'NCEP2'
369print, cor, bias, std, rmsd
370cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
371;
372splot, mean_tao, mean_nce, charsize=1.1, title='LHF - TAO Vs NCEP2', $
373     xrange=[20,200], yrange=[20,200], small=[2,3,4],/noer, psym=2
374xyouts, 50,25, cstat, charsize=1.
375xyouts, 50,10, 'cor    bias    std    rmsd', charsize=1.
376;
377x=mean_tao
378y=mean_nce
379ab=linfit(x,y,yfit=yfit)
380a=float(ab(0))
381b=float(ab(1))
382print, a,b
383oplot, x, yfit, thick=2, color=250
384oplot, [20,200], [20,200]
385;
386fi_lhf_ncep1=project_id_env+'lhf_2000_2009_ncep1_v52.txt'
387res=read_ascii(fi_lhf_ncep1,data_start=1)
388ff=res.field1
389cor_nce=reform(ff(2,*))
390bias_nce=reform(ff(3,*))
391std_nce=reform(ff(4,*))
392rmsd_nce=reform(ff(5,*))
393mean_tao=reform(ff(6,*))
394mean_nce=mean_tao+bias_nce
395;
396ind=where(finite(cor_nce))
397cor=total(cor_nce,/nan)/n_elements(ind)
398ind=where(finite(bias_nce))
399bias=total(bias_nce,/nan)/n_elements(ind)
400ind=where(finite(rmsd_nce))
401rmsd=total(rmsd_nce,/nan)/n_elements(ind)
402ind=where(finite(std_nce))
403std=total(std_nce,/nan)/n_elements(ind)
404;
405print, ''
406print, 'NCEP1'
407print, cor, bias, std, rmsd
408cstat=string(cor, bias, std, rmsd, format='(f4.2,2x,f6.2,2x,f4.2,1x,f6.2)')
409;
410splot, mean_tao, mean_nce, charsize=1.1, title='LHF - TAO Vs NCEP1', $
411     xrange=[20,200], yrange=[20,200], small=[2,3,5],/noer, psym=2
412xyouts, 50,25, cstat, charsize=1.
413xyouts, 50,10, 'cor    bias    std    rmsd', charsize=1.
414;
415x=mean_tao
416y=mean_nce
417ab=linfit(x,y,yfit=yfit)
418a=float(ab(0))
419b=float(ab(1))
420print, a,b
421oplot, x, yfit, thick=2, color=250
422oplot, [20,200], [20,200]
423;
424closeps
425;
426end
Note: See TracBrowser for help on using the repository browser.