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
RevLine 
[43]1;+
[46]2; .. _lhf_validation_scatter_2000_2009.pro:
[43]3;
4; ====================================
5; lhf_validation_scatter_2000_2009.pro
6; ====================================
7;
[46]8; DESCRIPTION
[43]9; ===========
10;
[46]11; .. graphviz::
12;
13;    digraph lhf_validation_scatter_2000_2009 {
[85]14;
[50]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"];
[46]25;
[50]26;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/lhf_validation_scatter_2000_2009.ps"];
[46]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;
[43]37; SEE ALSO
38; ========
39;
[50]40; :ref:`project_profile.sh`
41; :ref:`project_init.pro`
42; :ref:`cm_project.pro`
[43]43;
[46]44; :func:`x_site_location`
45; :func:`y_site_location`
46;
47; :ref:`read_variables_v2.pro`
48; :ref:`statistics_3var_v1.pro`
49;
[43]50; EXAMPLES
51; ========
52;
53; ::
54;
[180]55;  date1 = 19890101L
56;  date2 = 20091231L
57;  lhf_validation_scatter_2000_2009, date1, date2
[43]58;
[46]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;
[43]72; EVOLUTIONS
73; ==========
74;
75; $Id$
76;
[85]77; $URL$
78;
[46]79; - fplod 20110420T102937Z aedon.locean-ipsl.upmc.fr (Darwin)
80;
81;   * remove hard coding path
82;   * add graphviz
83;   * externalize functions
84;
[43]85; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
86;
87;   * minimal header
88;
89;-
[41]90pro lhf_validation_scatter_2000_2009,date1,date2
[46]91@cm_general
[50]92@cm_project
[41]93reinitplt, /z,/invert
94key_portrait = 1
[97]95;
[85]96openps, FILENAME = project_od_env+'lhf_validation_scatter_2000_2009.ps'
[97]97;
98; evaluation is done for 20000101 - 20091231 period
99; location of moorings
100;
[41]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']
[97]111;
[41]112ocean='global'
[97]113;
114;   This program will create the following text files with statistics of respective variables
[41]115close,/all
[97]116;
[50]117fi_lhf_erai=project_id_env+'lhf_2000_2009_erai_v52.txt'
[41]118openw,1,fi_lhf_erai
[50]119fi_lhf_trop=project_id_env+'lhf_2000_2009_trop_v52.txt'
[41]120openw,2,fi_lhf_trop
[50]121fi_lhf_oaflx=project_id_env+'lhf_2000_2009_oaflx_v52.txt'
[41]122openw,3,fi_lhf_oaflx
[50]123fi_lhf_ncep=project_id_env+'lhf_2000_2009_ncep_v52.txt'
[41]124openw,4,fi_lhf_ncep
[50]125fi_lhf_ncep1=project_id_env+'lhf_2000_2009_ncep1_v52.txt'
[41]126openw,5,fi_lhf_ncep1
[97]127;
[41]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'
[97]132;
133; first reading the whole ERAI uncorrected and corrected data
134;
[50]135file=project_id_env+'erai_lhf_19890101_20091231_oafluxgrid.nc'
[41]136initncdf, file
[43]137unc=read_ncdf('lhf',date1,date2,file=file,/nostr)
[41]138help, unc
[97]139;
[50]140file=project_id_env+"TropFlux_19890101_20091231.nc"
[41]141initncdf, file
142cor=read_ncdf('lhf',date1,date2,file=file,/nostr)
143cor=-1*cor
144help, cor
[97]145;
[50]146file=project_id_env+'lhf_oafluxgrid_1985_2009.nc'
[41]147initncdf, file
148oaf=read_ncdf("lhf", date1, date2, file=file,/nostr)
149help, oaf
[97]150;
[50]151fi=project_id_env+'lhf_ncep2_oafluxgrid_19890101_20091231.nc'
[41]152initncdf, fi
[43]153nce=read_ncdf("lhf", date1, date2, file=fi,/nostr)
[41]154help, nce
[97]155;
[50]156file=project_id_env+'fluxe_ncep1_19890101_20091231.nc'
[41]157initncdf, file
[43]158nce1=-1*read_ncdf("lhf", date1, date2, file=file,/nostr)
[41]159help, nce1
[97]160;
[41]161nsmooth=1.
162nn=n_elements(sitelist)
163for n=0, nn-1 do begin
[97]164;
165; reading data from mooring
166;
167    site=sitelist(n)
[94]168    csite=site
[41]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.
[97]173    dx=0.5
174    dy=0.5
[94]175    box=[y-dy, y+dy, x-dx, x+dx]
[41]176    read_variables_v2, csite,date1,date2,nsmooth, $
177         at, sw,rh,sst,wu,wv,ws,lh
[97]178;
179    lhf=lh
180    ind=where(finite(lhf))
[94]181    valid=n_elements(ind)
[97]182;
[41]183    if (valid ge 180. ) then begin
[97]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;
[41]201        extract_flux_tropflux,nce1,box, $
202                tropflux
203        ncep1=tropflux
[97]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)
[94]211        ncep1=ncep1(ind)
[41]212        mean_tao=total(lhf,/nan)/n_elements(lhf)
[97]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;
[41]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)'
[97]228;
[41]229    endif
230endfor
[97]231;
[41]232close,/all
[97]233;
[50]234fi_lhf_erai=project_id_env+'lhf_2000_2009_erai_v52.txt'
[41]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
[97]243;
244ind=where(finite(cor_erai))
[94]245cor=total(cor_erai,/nan)/n_elements(ind)
[97]246ind=where(finite(bias_erai))
[94]247bias=total(bias_erai,/nan)/n_elements(ind)
[97]248ind=where(finite(rmsd_erai))
[94]249rmsd=total(rmsd_erai,/nan)/n_elements(ind)
[97]250ind=where(finite(std_erai))
[94]251std=total(std_erai,/nan)/n_elements(ind)
[97]252;
[41]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)')
[97]257;
[41]258splot, mean_tao, mean_erai, charsize=1.1, title='LHF - TAO Vs ERAI', $
[43]259     xrange=[20,200], yrange=[20,200], small=[2,3,1], psym=2
[41]260xyouts, 50,25, cstat, charsize=1.
261xyouts, 50,10, 'cor    bias    std    rmsd', charsize=1.
[97]262;
263x=mean_tao
[94]264y=mean_erai
[41]265ab=linfit(x,y,yfit=yfit)
[97]266a=float(ab(0))
267b=float(ab(1))
[94]268print, a,b
[41]269oplot, x, yfit, thick=2, color=250
270oplot, [20,200], [20,200]
[97]271;
[50]272fi_lhf_trop=project_id_env+'lhf_2000_2009_trop_v52.txt'
[41]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
[97]281;
282ind=where(finite(cor_trop))
[94]283cor=total(cor_trop,/nan)/n_elements(ind)
[97]284ind=where(finite(bias_trop))
[94]285bias=total(bias_trop,/nan)/n_elements(ind)
[97]286ind=where(finite(rmsd_trop))
[94]287rmsd=total(rmsd_trop,/nan)/n_elements(ind)
[97]288ind=where(finite(std_trop))
[94]289std=total(std_trop,/nan)/n_elements(ind)
[97]290;
[41]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)')
[97]295;
[41]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
[97]298x=mean_tao
[94]299y=mean_trop
[41]300xyouts, 50,25, cstat, charsize=1.
301xyouts, 50,10, 'cor    bias    std    rmsd', charsize=1.
[97]302;
[41]303ab=linfit(x,y,yfit=yfit)
[97]304a=float(ab(0))
305b=float(ab(1))
[94]306print, a,b
[41]307oplot, x, yfit, thick=2, color=250
308oplot, [20,200], [20,200]
[97]309;
[50]310fi_lhf_oaflx=project_id_env+'lhf_2000_2009_oaflx_v52.txt'
[41]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
[97]319;
320ind=where(finite(cor_oaf))
[94]321cor=total(cor_oaf,/nan)/n_elements(ind)
[97]322ind=where(finite(bias_oaf))
[94]323bias=total(bias_oaf,/nan)/n_elements(ind)
[97]324ind=where(finite(rmsd_oaf))
[94]325rmsd=total(rmsd_oaf,/nan)/n_elements(ind)
[97]326ind=where(finite(std_oaf))
[94]327std=total(std_oaf,/nan)/n_elements(ind)
[97]328;
[41]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)')
[97]333;
[41]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.
[97]338;
339x=mean_tao
[94]340y=mean_oaf
[41]341ab=linfit(x,y,yfit=yfit)
[97]342a=float(ab(0))
343b=float(ab(1))
[94]344print, a,b
[41]345oplot, x, yfit, thick=2, color=250
346oplot, [20,200], [20,200]
[97]347;
[50]348fi_lhf_ncep=project_id_env+'lhf_2000_2009_ncep_v52.txt'
[41]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
[97]357;
358ind=where(finite(cor_nce))
[94]359cor=total(cor_nce,/nan)/n_elements(ind)
[97]360ind=where(finite(bias_nce))
[94]361bias=total(bias_nce,/nan)/n_elements(ind)
[97]362ind=where(finite(rmsd_nce))
[94]363rmsd=total(rmsd_nce,/nan)/n_elements(ind)
[97]364ind=where(finite(std_nce))
[94]365std=total(std_nce,/nan)/n_elements(ind)
[97]366;
[41]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)')
[97]371;
[41]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.
[97]376;
377x=mean_tao
[94]378y=mean_nce
[41]379ab=linfit(x,y,yfit=yfit)
[97]380a=float(ab(0))
381b=float(ab(1))
[94]382print, a,b
[41]383oplot, x, yfit, thick=2, color=250
384oplot, [20,200], [20,200]
[97]385;
[50]386fi_lhf_ncep1=project_id_env+'lhf_2000_2009_ncep1_v52.txt'
[41]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
[97]395;
396ind=where(finite(cor_nce))
[94]397cor=total(cor_nce,/nan)/n_elements(ind)
[97]398ind=where(finite(bias_nce))
[94]399bias=total(bias_nce,/nan)/n_elements(ind)
[97]400ind=where(finite(rmsd_nce))
[94]401rmsd=total(rmsd_nce,/nan)/n_elements(ind)
[97]402ind=where(finite(std_nce))
[94]403std=total(std_nce,/nan)/n_elements(ind)
[97]404;
[41]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)')
[97]409;
[41]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.
[97]414;
415x=mean_tao
[94]416y=mean_nce
[41]417ab=linfit(x,y,yfit=yfit)
[97]418a=float(ab(0))
419b=float(ab(1))
[94]420print, a,b
[41]421oplot, x, yfit, thick=2, color=250
422oplot, [20,200], [20,200]
[97]423;
[41]424closeps
[97]425;
[41]426end
Note: See TracBrowser for help on using the repository browser.