source: trunk/src/paper01/fig7/air_validation_scatter_2000_2009_basin.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.7 KB
RevLine 
[43]1;+
[46]2; .. _air_validation_scatter_2000_2009_basin.pro:
[43]3;
[46]4; ==========================================
5; air_validation_scatter_2000_2009_basin.pro
6; ==========================================
7;
[43]8; DESCRIPTION
9; ===========
10;
[46]11; .. graphviz::
12;
13;    digraph air_validation_scatter_2000_2009_basin {
[88]14;
[50]15;       air_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/air_2000_2009_erai_*.txt"];
16;       air_tropflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_trop_*.txt"];
17;       air_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_oaflx_*.txt"];
18;       air_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_ncep2_*.txt"];
19;       air_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_ncep1_*.txt"];
20;       t2m_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_t2m_19890101_20091231_oafluxgrid.nc"];
[46]21;
[50]22;       figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_validation_scatter_2000_2009_basin.ps"];
[46]23;
24;       air_validation_scatter_2000_2009_basin [shape=box,
25;       fontname=Courier,
26;       color=blue,
27;       URL="http://forge.ipsl.jussieu.fr/tropflux/broairer/trunk/src/paper01/fig7/air_validation_scatter_2000_2009_basin.pro",
28;       label="${TROPFLUX}/src/paper01/fig7/air_validation_scatter_2000_2009_basin.pro"];
29;
30;       {air_tropflux t2m_erai} -> {air_validation_scatter_2000_2009_basin} -> {air_oaflux air_erai air_ncep2 air_ncep1 figure}
31;    }
32;
[43]33; SEE ALSO
34; ========
35;
[50]36; :ref:`project_profile.sh`
37; :ref:`project_init.pro`
38; :ref:`cm_project.pro`
[43]39;
[46]40; :func:`x_site_location`
41; :func:`y_site_location`
42;
43; :ref:`read_variables_v2.pro`
44; :ref:`statistics_3var_v1.pro`
45;
[43]46; EXAMPLES
47; ========
48;
49; ::
50;
[180]51;  date1 = 19890101L
52;  date2 = 20091231L
53;  air_validation_scatter_2000_2009_basin, date1, date2
[43]54;
[46]55; TODO
56; ====
57;
58; make it work on cratos : pb restore
59;
60; ++ mooring data in graphviz
61;
62; coding rules
63;
64; complete description
65;
66; handle IO error
67;
[43]68; EVOLUTIONS
69; ==========
70;
71; $Id$
72;
[85]73; $URL$
74;
[46]75; - fplod 20110420T093206Z aedon.locean-ipsl.upmc.fr (Darwin)
76;
77;   * remove hard coding path
78;   * add graphviz
79;   * externalize functions
80;   * change name of procedure according to filename
81;
[43]82; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin)
83;
84;   * minimal header
85;
86;-
[46]87pro air_validation_scatter_2000_2009_basin, date1, date2
88@cm_general
[50]89@cm_project
[41]90reinitplt, /z,/invert
91key_portrait = 1
[97]92;
[85]93openps, FILENAME = project_od_env+'air_validation_scatter_2000_2009_'+ocean+'.ps'
[97]94;
95; Give the location of mooring for validation of basic meteorological variables
96;
[41]97sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
98           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $
99           '8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
100          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
101          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
102          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
103          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
104          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $
105          '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
106          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
[97]107;
[41]108ocean='global'
[97]109;
[41]110sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $
111           '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e']
112ocean='IO'
[97]113;
[41]114;sitelist=['8s165e', '8s180w',  '8s155w', '8s125w', '8s110w', '8s95w',  '5s156e', '5s165e', '5s180w', '5s170w', $
115;          '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $
116;          '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $
117;          '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $
118;          '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $
119;          '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w']
120;ocean='Pac'
[97]121;
[41]122;sitelist=['0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $
123;          '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w']
124;ocean='AO'
[97]125;
[41]126;sitelist=['8s165e', '8s180w',  '8s155w','5s156e', '5s165e', '5s180w', '5s170w','2s156e', '2s165e', '2s180w', $
127;          '2s170w','0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '2n147e', '2n156e', '2n165e', '2n180w', $
128;          '2n170w', '5n147e', '5n156e', '5n165e', '5n170w', '8n156e', '8n165e', '8n180w', '8n170w', '9n140w',$
129;          '8n125w', '8n110w', '8n95w']
130;ocean='Pac_warmpool'
[97]131;
[41]132;sitelist=['8s125w', '8s110w', '8s95w','5s155w', '5s140w', '5s125w', '5s110w', '5s95w','2s155w', '2s140w', $
133;          '2s125w', '2s110w', '2s95w', '0n155w', '0n140w', '0n125w', '0n110w', '0n95w', '2n155w', '2n140w', $
134;         '2n125w', '2n110w', '2n95w',  '5n155w', '5n140w', '5n125w', '5n110w', '5n95w']
135;ocean='Pac_coldtongue'
[97]136;
[41]137;sitelist=['0n0e','0n35w', '4n23w', '4n38w', '8n38w']
138;ocean='AO_warmpool'
[97]139;
[41]140;sitelist=['0n10w','0n23w','10s10w','12n23w','12n38w','14s32w','15n38w', '19s34w','20n38w', $
141;          '21n23w', '6s10w', '8s30w']
142;ocean='AO_coldtongue'
[97]143;
144nsmooth=1.    ; statistics are with 7 day smoothed
145;   This program will create the following text files with statistics of respective variables
[41]146close,/all
[97]147;
[50]148fi_air_erai=project_id_env+'air_2000_2009_erai_'+ocean+'.txt'
[41]149openw,1,fi_air_erai
[50]150fi_air_trop=project_id_env+'air_2000_2009_trop_'+ocean+'.txt'
[41]151openw,2,fi_air_trop
[50]152fi_air_oaflx=project_id_env+'air_2000_2009_oaflx_'+ocean+'.txt'
[41]153openw,3,fi_air_oaflx
[50]154fi_air_ncep2=project_id_env+'air_2000_2009_ncep2_'+ocean+'.txt'
[41]155openw,4,fi_air_ncep2
[50]156fi_air_ncep1=project_id_env+'air_2000_2009_ncep1_'+ocean+'.txt'
[41]157openw,5,fi_air_ncep1
[97]158;
[41]159printf,1, 'x     y      cor    bias     std     rmsd    mean_tao'
160printf,2, 'x     y      cor    bias     std     rmsd    mean_tao'
161printf,3, 'x     y      cor    bias     std     rmsd    mean_tao'
162printf,4, 'x     y      cor    bias     std     rmsd    mean_tao'
163printf,5, 'x     y      cor    bias     std     rmsd    mean_tao'
[97]164;
165; first reading the whole ERAI uncorrected and corrected data
166;
[50]167file=project_id_env+'erai_t2m_19890101_20091231_oafluxgrid.nc'
[41]168initncdf, file
[97]169unc=read_ncdf('t2m',date1,date2,file=file,/nostr)
[94]170unc=unc-273.15
[41]171help, unc
[97]172;
[41]173;save, unc, cor, oaf, nce, nce1, filename="airt_unc_cor_oaf_nce_nce1_2000_2009_global.idl"
174restore, file="/Users/pkb/work/MY_SAXO/airt_unc_cor_oaf_nce_nce1_2000_2009_global.idl"
175help, unc, cor, oaf, nce, nce1
[97]176;
[41]177nn=n_elements(sitelist)
178for n=0, nn-1 do begin
[97]179;
180; reading data from mooring
181;
182    site=sitelist(n)
[94]183csite=site
[41]184    print, csite
185    x=x_site_location(site)
186    y=y_site_location(site)
187    if (y ge 0. and y le 30.) then y=y+360.
[97]188    dx=0.5
189    dy=0.5
[94]190    box=[y-dy, y+dy, x-dx, x+dx]
[41]191    read_variables_v2, csite,date1,date2,nsmooth, $
192         at, sw,rh,sst,wu,wv,ws,lh
[97]193;    air=rh_to_sphum(rh,at,1008)               ;        at  ->  air temperature
194    air=at                                               ;        air ->  sea surface temperature
195                                                ;        lh  ->  latent heat flux
196                                                ;        rh  ->  relative humidity
197                                                ;   wu,wv,ws ->  wind speed
198;
199;  extracting the corrected and uncorrected ERAI data at the locations
[41]200    nsmooth=1.
[97]201;
[41]202    extract_flux_tropflux,unc,box, $
203        tropflux
204    uncr=tropflux
[97]205;
[43]206     extract_flux_tropflux,cor,box, $
[41]207        tropflux
208     corr=tropflux
[97]209;
[41]210     extract_flux_tropflux,oaf,box, $
211        tropflux
212     oafl=tropflux
[97]213;
[41]214     extract_flux_tropflux,nce,box, $
215        tropflux
216     ncep=tropflux
[97]217;
[41]218     extract_flux_tropflux,nce1,box, $
219        tropflux
220     ncep1=tropflux
[97]221;
222    ind=where(finite(air))
223    air=air(ind)
224    uncr_air=uncr(ind)
[94]225    corr_air=corr(ind)
[97]226    oafl=oafl(ind)
227    ncep=ncep(ind)
[94]228    ncep1=ncep1(ind)
[41]229    mean_tao=total(air,/nan)/n_elements(ind)
[97]230;
[41]231    statistics_3var_v1, air, uncr_air, corr_air, $
232         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
[97]233;
[41]234    printf, 1, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
235    printf, 2, x, y, cor2, bias2, std2, rmsd2, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
[97]236;
[41]237    statistics_3var_v1, air, oafl, ncep, $
238         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
239    printf, 3, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
240    printf, 4, x, y, cor2, bias2, std2, rmsd2, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f6.2,3x,f4.2,3x,f4.2,3x,f6.2)'
[97]241;
[41]242    statistics_3var_v1, air, ncep1, ncep, $
243         cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2
244    printf, 5, x, y, cor1, bias1, std1, rmsd1, mean_tao, format='(f6.2, 3x, f6.2, 3x, f5.2,3x,f5.2,3x,f4.2,3x,f4.2,3x,f6.2)'
[97]245;
[41]246endfor
[43]247close,/all
[97]248;
[50]249fi_air_erai=project_id_env+'air_2000_2009_erai_'+ocean+'.txt'
[41]250res=read_ascii(fi_air_erai,data_start=1)
251ff=res.field1
252lat=reform(ff(0,*))
253lon=reform(ff(1,*))
[97]254cor_era=reform(ff(2,*))
[94]255cor_erai=total(cor_era)/n_elements(cor_era)
[97]256bias_era=reform(ff(3,*))
[94]257bias_erai=total(bias_era)/n_elements(bias_era)
[97]258std_era=reform(ff(4,*))
[94]259std_erai=total(std_era)/n_elements(std_era)
[97]260rmsd_era=reform(ff(5,*))
[94]261rmsd_erai=total(rmsd_era)/n_elements(rmsd_era)
[97]262mean_tao=reform(ff(6,*))
[94]263mean_erai=bias_era+mean_tao
[97]264;
[41]265print, ''
266print, 'ERAI'
267print, cor_erai, bias_erai, std_erai, rmsd_erai
268cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
269splot, mean_tao, mean_erai, title='T2m - TAO Vs ERAI', subtitle='', $
270     charsize=1.1, xtitle='TAO T2m', ytitle='ERAI T2m', small=[2,3,1], psym=2, $
271     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
272xyouts, 22.3,30.2, cstat, charsize=0.9
273xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
[97]274;
[41]275oplot, [22,31], [22,31]
276ab=linfit(mean_tao, mean_erai,yfit=yfit)
[97]277a=float(ab(0))
[94]278b=float(ab(1))
[41]279oplot, mean_tao, yfit, color=250, thick=2
[97]280;
[50]281fi_air_trop=project_id_env+'air_2000_2009_trop_'+ocean+'.txt'
[41]282res=read_ascii(fi_air_trop,data_start=1)
283ff=res.field1
284lat=reform(ff(0,*))
285lon=reform(ff(1,*))
[97]286cor_tro=reform(ff(2,*))
[94]287cor_trop=total(cor_tro)/n_elements(cor_tro)
[97]288bias_tro=reform(ff(3,*))
[94]289bias_trop=total(bias_tro)/n_elements(bias_tro)
[97]290std_tro=reform(ff(4,*))
[94]291std_trop=total(std_tro)/n_elements(std_tro)
[97]292rmsd_tro=reform(ff(5,*))
[94]293rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro)
[97]294mean_tao=reform(ff(6,*))
[94]295mean_trop=bias_tro+mean_tao
[97]296;
[41]297print, ''
298print, 'TropFlux'
299print, cor_trop, bias_trop, std_trop, rmsd_trop
300cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
[97]301;
[41]302splot, mean_tao, mean_trop, title='T2m - TAO Vs TropFlux', subtitle='', $
303     charsize=1.1, xtitle='TAO T2m', ytitle='TropFlux T2m', small=[2,3,2],/noer, psym=2, $
304     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
305oplot, [22,31], [22,31]
306xyouts, 22.3,30.2, cstat, charsize=0.9
307xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
[97]308;
[41]309ab=linfit(mean_tao, mean_trop,yfit=yfit)
[97]310a=float(ab(0))
[94]311b=float(ab(1))
[41]312oplot, mean_tao, yfit, color=250, thick=2
[97]313;
[50]314fi_air_oaflx=project_id_env+'air_2000_2009_oaflx_'+ocean+'.txt'
[41]315res=read_ascii(fi_air_oaflx,data_start=1)
316ff=res.field1
317lat=reform(ff(0,*))
318lon=reform(ff(1,*))
[97]319cor_oaf=reform(ff(2,*))
[94]320cor_oafl=total(cor_oaf)/n_elements(cor_oaf)
[97]321bias_oaf=reform(ff(3,*))
[94]322bias_oafl=total(bias_oaf)/n_elements(bias_oaf)
[97]323std_oaf=reform(ff(4,*))
[94]324std_oafl=total(std_oaf)/n_elements(std_oaf)
[97]325rmsd_oaf=reform(ff(5,*))
[94]326rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf)
[97]327mean_tao=reform(ff(6,*))
[94]328mean_oafl=bias_oaf+mean_tao
[97]329;
[41]330print, ''
331print, 'OAFlux'
332print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl
333cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
[97]334;
[41]335splot, mean_tao, mean_oafl, title='T2m - TAO Vs OAFlux', subtitle='', $
336     charsize=1.1, xtitle='TAO T2m', ytitle='OAFlux T2m', small=[2,3,3],/noer, psym=2, $
337     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
338oplot, [22,31], [22,31]
339xyouts, 22.3,30.2, cstat, charsize=0.9
340xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
[97]341;
[41]342ab=linfit(mean_tao, mean_oafl,yfit=yfit)
[97]343a=float(ab(0))
[94]344b=float(ab(1))
[41]345oplot, mean_tao, yfit, color=250, thick=2
[97]346;
[50]347fi_air_ncep=project_id_env+'air_2000_2009_ncep2_'+ocean+'.txt'
[41]348res=read_ascii(fi_air_ncep,data_start=1)
349ff=res.field1
350lat=reform(ff(0,*))
351lon=reform(ff(1,*))
[97]352cor_nce=reform(ff(2,*))
[94]353cor_ncep=total(cor_nce)/n_elements(cor_nce)
[97]354bias_nce=reform(ff(3,*))
[94]355bias_ncep=total(bias_nce)/n_elements(bias_nce)
[97]356std_nce=reform(ff(4,*))
[94]357std_ncep=total(std_nce)/n_elements(std_nce)
[97]358rmsd_nce=reform(ff(5,*))
[94]359rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
[97]360mean_tao=reform(ff(6,*))
[94]361mean_ncep=bias_nce+mean_tao
[97]362;
[41]363print, ''
364print, 'NCEP2'
365print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
366cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
[97]367;
[41]368splot, mean_tao, mean_ncep, title='T2m - TAO Vs NCEP2', subtitle='', $
369     charsize=1.1, xtitle='TAO T2m', ytitle='NCEP2 T2m', small=[2,3,4],/noer, psym=2, $
370     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
371oplot, [22,31], [22,31]
372xyouts, 22.3,30.2, cstat, charsize=0.9
373xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
[97]374;
[41]375ab=linfit(mean_tao, mean_ncep,yfit=yfit)
[97]376a=float(ab(0))
[94]377b=float(ab(1))
[41]378oplot, mean_tao, yfit, color=250, thick=2
[97]379;
[50]380fi_air_ncep1=project_id_env+'air_2000_2009_ncep1_'+ocean+'.txt'
[41]381res=read_ascii(fi_air_ncep1,data_start=1)
382ff=res.field1
383lat=reform(ff(0,*))
384lon=reform(ff(1,*))
[97]385cor_nce=reform(ff(2,*))
[94]386cor_ncep=total(cor_nce)/n_elements(cor_nce)
[97]387bias_nce=reform(ff(3,*))
[94]388bias_ncep=total(bias_nce)/n_elements(bias_nce)
[97]389std_nce=reform(ff(4,*))
[94]390std_ncep=total(std_nce)/n_elements(std_nce)
[97]391rmsd_nce=reform(ff(5,*))
[94]392rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce)
[97]393mean_tao=reform(ff(6,*))
[94]394mean_ncep=bias_nce+mean_tao
[97]395;
[41]396print, ''
397print, 'NCEP1'
398print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep
399cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)')
[97]400;
[41]401splot, mean_tao, mean_ncep, title='T2m - TAO Vs NCEP_NCAR', subtitle='', $
402     charsize=1.1, xtitle='TAO T2m', ytitle='NCEP', small=[2,3,5],/noer, psym=2, $
403     xrange=[22,31], yrange=[22,31], xmin=1,ymin=1
404oplot, [22,31], [22,31]
405xyouts, 22.3,30.2, cstat, charsize=0.9
406xyouts, 22.3,29.5, 'cor   bias   std   rmsd', charsize=0.9
[97]407;
[41]408ab=linfit(mean_tao, mean_ncep,yfit=yfit)
[97]409a=float(ab(0))
[94]410b=float(ab(1))
[41]411oplot, mean_tao, yfit, color=250, thick=2
[97]412;
[41]413closeps
[97]414;
[41]415end
Note: See TracBrowser for help on using the repository browser.