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
RevLine 
[43]1;+
[46]2; .. _swr_validation_scatter_2000_2007.pro:
[43]3;
4; ====================================
5; swr_validation_scatter_2000_2007.pro
6; ====================================
7;
8; DESCRIPTION
9; ===========
10;
[46]11; .. graphviz::
12;
13;    digraph swr_validation_scatter_2000_2007 {
[85]14;
[50]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"];
[46]27;
[50]28;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/swr_validation_scatter_2000_2007.ps"];
[46]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;
[43]39; SEE ALSO
40; ========
41;
[50]42; :ref:`project_profile.sh`
43; :ref:`project_init.pro`
44; :ref:`cm_project.pro`
[43]45;
[46]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;
[43]52; EXAMPLES
53; ========
54;
55; ::
56;
[180]57;  date1 = 19890101L
58;  date2 = 20091231L
59;  swr_validation_scatter_2000_2007, date1, date2
[43]60;
[46]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;
[43]74; EVOLUTIONS
75; ==========
76;
77; $Id$
78;
[85]79; $URL$
80;
[46]81; - fplod 20110420T105004Z aedon.locean-ipsl.upmc.fr (Darwin)
82;
83;   * remove hard coding path
84;   * add graphviz
85;   * externalize functions
86;
[43]87; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
88;
89;   * minimal header
90;
91;-
92pro swr_validation_scatter_2000_2007, date1, date2
[46]93@cm_genral
[50]94@cm_project
[41]95reinitplt, /z,/invert
96key_portrait = 1
[97]97;
[85]98openps, FILENAME = project_od_env+'swr_validation_scatter_2000_2007.ps'
[97]99;
100; evaluation is done for 20000101-20071231 period
101;
102; location of mooring
103;
[41]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']
[97]114;
[41]115ocean='global'
[97]116;
117;da1=20000101
[94]118;da2=20071231
[43]119nsmooth=1.
[97]120;   This program will create the following text files with statistics of respective variables
[41]121close,/all
[97]122;
[50]123fi_swr_erai=project_id_env+'swr_2000_2007_erai_v50.txt'
[41]124openw,1,fi_swr_erai
[50]125fi_swr_trop=project_id_env+'swr_2000_2007_trop_v50.txt'
[41]126openw,2,fi_swr_trop
[50]127fi_swr_oaflx=project_id_env+'swr_2000_2007_oaflx_v50.txt'
[41]128openw,3,fi_swr_oaflx
[50]129fi_swr_ncep=project_id_env+'swr_2000_2007_ncep_v50.txt'
[41]130openw,4,fi_swr_ncep
[50]131fi_swr_ncep1=project_id_env+'swr_2000_2007_ncep1_v50.txt'
[41]132openw,5,fi_swr_ncep1
[50]133fi_swr_olr=project_id_env+'swr_2000_2007_olr_v50.txt'
[41]134openw,6,fi_swr_olr
[97]135;
[41]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'
[97]142;
143; first reading the whole ERAI uncorrected and corrected data
144;
[50]145file=project_id_env+'erai_fluxes_20000101_20090801_TROP_oafluxgrid.nc'
[41]146initncdf, file
[97]147unc=read_ncdf('swr',date1,date2,file=file,/nostr)
[94]148unc=-1*unc
[41]149help, unc
[97]150;
[50]151file=project_id_env+'TropFlux_swr_19890101_20071231_DT_v51.nc'
[41]152initncdf, file
153cor=read_ncdf('swr',date1,date2,file=file,/nostr)
154help, cor
[97]155;
[50]156file=project_id_env+'swr_oafluxgrid_1985_2007.nc'
[41]157initncdf, file
158oaf=read_ncdf("swr", date1, date2, file=file,/nostr)
159help, oaf
[97]160;
[50]161fi=project_id_env+'swr_ncep2_oaflxgrid_19890101_20091231.nc'
[41]162initncdf, fi
[97]163nce=read_ncdf("swr", date1, date2, file=fi,/nostr)
[94]164nce=0.94*nce
[41]165help, nce
[97]166;
[50]167file=project_id_env+'fluxe_ncep1_19890101_20091231.nc'
[41]168initncdf, file
169nce1=read_ncdf("swr", date1, date2, file=file,/nostr)
170help, nce1
[97]171;
[50]172file=project_id_env+'TropFlux_swr_19890101_20091231_NRT_v50.nc'
[41]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
[97]178;
179; reading data from mooring
180;
181    site=sitelist(n)
[94]182    csite=site
[41]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.
[97]187    dx=0.5
188    dy=0.5
[94]189    box=[y-dy, y+dy, x-dx, x+dx]
[97]190;
[41]191    read_global_sw_v50, csite, date1, date2, box, $
192                           sw
[97]193;
194    swr=sw
195    ind=where(finite(swr))
[94]196    valid=n_elements(ind)
[97]197;
[41]198    if (valid ge 180. ) then begin
[97]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;
[41]216        extract_flux_tropflux,nce1,box, $
217                tropflux
218        ncep1=tropflux
[97]219;
[41]220        extract_flux_tropflux,sw_olr,box, $
221                tropflux
222        olr=tropflux
[97]223;
224        ind=where(finite(swr))
225        swr=swr(ind)
226        uncr_swr=uncr(ind)
227        corr_swr=corr(ind)
228        oafl=oafl(ind)
[94]229        ncep=ncep(ind)
[97]230        ncep1=ncep1(ind)
[94]231        olr_sw=olr(ind)
232        mean_tao=total(swr,/nan)/n_elements(swr)
[97]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;
[41]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)'
[97]249;
[41]250    endif
251endfor
[97]252;
[41]253close,/all
[97]254;
[50]255fi_swr_erai=project_id_env+'swr_2000_2007_erai_v50.txt'
[41]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
[97]264;
265ind=where(finite(cor_erai))
[94]266cor=total(cor_erai,/nan)/n_elements(ind)
[97]267ind=where(finite(bias_erai))
[94]268bias=total(bias_erai,/nan)/n_elements(ind)
[97]269ind=where(finite(rmsd_erai))
[94]270rmsd=total(rmsd_erai,/nan)/n_elements(ind)
[97]271ind=where(finite(std_erai))
[94]272std=total(std_erai,/nan)/n_elements(ind)
[97]273;
[41]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)')
[97]278;
[41]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.
[97]283;
284x=mean_tao
[94]285y=mean_erai
[41]286ab=linfit(x,y,yfit=yfit)
[97]287a=float(ab(0))
288b=float(ab(1))
[94]289print, a,b
[41]290oplot, x, yfit, thick=2, color=250
291oplot, [100,300], [100,300]
[97]292;
[50]293fi_swr_trop=project_id_env+'swr_2000_2007_trop_v50.txt'
[41]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
[97]302;
303ind=where(finite(cor_trop))
[94]304cor=total(cor_trop,/nan)/n_elements(ind)
[97]305ind=where(finite(bias_trop))
[94]306bias=total(bias_trop,/nan)/n_elements(ind)
[97]307ind=where(finite(rmsd_trop))
[94]308rmsd=total(rmsd_trop,/nan)/n_elements(ind)
[97]309ind=where(finite(std_trop))
[94]310std=total(std_trop,/nan)/n_elements(ind)
[97]311;
[41]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)')
[97]316;
[41]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.
[97]321;
322x=mean_tao
[94]323y=mean_trop
[41]324ab=linfit(x,y,yfit=yfit)
[97]325a=float(ab(0))
326b=float(ab(1))
[94]327print, a,b
[41]328oplot, x, yfit, thick=2, color=250
329oplot, [100,300], [100,300]
[97]330;
[50]331fi_swr_oaflx=project_id_env+'swr_2000_2007_oaflx_v50.txt'
[41]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
[97]340;
341ind=where(finite(cor_oaf))
[94]342cor=total(cor_oaf,/nan)/n_elements(ind)
[97]343ind=where(finite(bias_oaf))
[94]344bias=total(bias_oaf,/nan)/n_elements(ind)
[97]345ind=where(finite(rmsd_oaf))
[94]346rmsd=total(rmsd_oaf,/nan)/n_elements(ind)
[97]347ind=where(finite(std_oaf))
[94]348std=total(std_oaf,/nan)/n_elements(ind)
[97]349;
[41]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)')
[97]354;
[41]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.
[97]359;
360x=mean_tao
[94]361y=mean_oaf
[41]362ab=linfit(x,y,yfit=yfit)
[97]363a=float(ab(0))
364b=float(ab(1))
[94]365print, a,b
[41]366oplot, x, yfit, thick=2, color=250
367oplot, [100,300], [100,300]
[97]368;
[50]369fi_swr_ncep=project_id_env+'swr_2000_2007_ncep_v50.txt'
[41]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
[97]378;
379ind=where(finite(cor_nce))
[94]380cor=total(cor_nce,/nan)/n_elements(ind)
[97]381ind=where(finite(bias_nce))
[94]382bias=total(bias_nce,/nan)/n_elements(ind)
[97]383ind=where(finite(rmsd_nce))
[94]384rmsd=total(rmsd_nce,/nan)/n_elements(ind)
[97]385ind=where(finite(std_nce))
[94]386std=total(std_nce,/nan)/n_elements(ind)
[97]387;
[41]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)')
[97]392;
[41]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.
[97]397;
398x=mean_tao
[94]399y=mean_nce
[41]400ab=linfit(x,y,yfit=yfit)
[97]401a=float(ab(0))
402b=float(ab(1))
[94]403print, a,b
[41]404oplot, x, yfit, thick=2, color=250
405oplot, [100,300], [100,300]
[97]406;
[50]407fi_swr_ncep1=project_id_env+'swr_2000_2007_ncep1_v50.txt'
[41]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
[97]416;
417ind=where(finite(cor_nce))
[94]418cor=total(cor_nce,/nan)/n_elements(ind)
[97]419ind=where(finite(bias_nce))
[94]420bias=total(bias_nce,/nan)/n_elements(ind)
[97]421ind=where(finite(rmsd_nce))
[94]422rmsd=total(rmsd_nce,/nan)/n_elements(ind)
[97]423ind=where(finite(std_nce))
[94]424std=total(std_nce,/nan)/n_elements(ind)
[97]425;
[41]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)')
[97]430;
[41]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.
[97]435;
436x=mean_tao
[94]437y=mean_nce
[41]438ab=linfit(x,y,yfit=yfit)
[97]439a=float(ab(0))
440b=float(ab(1))
[94]441print, a,b
[41]442oplot, x, yfit, thick=2, color=250
443oplot, [100,300], [100,300]
[97]444;
[50]445fi_swr_olr=project_id_env+'swr_2000_2007_olr_v50.txt'
[41]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
[97]454;
455ind=where(finite(cor_olr))
[94]456cor=total(cor_olr,/nan)/n_elements(ind)
[97]457ind=where(finite(bias_olr))
[94]458bias=total(bias_olr,/nan)/n_elements(ind)
[97]459ind=where(finite(rmsd_olr))
[94]460rmsd=total(rmsd_olr,/nan)/n_elements(ind)
[97]461ind=where(finite(std_olr))
[94]462std=total(std_olr,/nan)/n_elements(ind)
[97]463;
[41]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)')
[97]468;
[41]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.
[97]473;
474x=mean_tao
[94]475y=mean_olr
[41]476ab=linfit(x,y,yfit=yfit)
[97]477a=float(ab(0))
478b=float(ab(1))
[94]479print, a,b
[41]480oplot, x, yfit, thick=2, color=250
481oplot, [100,300], [100,300]
[97]482;
[41]483closeps
[97]484;
[41]485end
Note: See TracBrowser for help on using the repository browser.