;+ ; ; .. _air_validation_scatter_2000_2009_v50.pro: ; ; ======================================== ; air_validation_scatter_2000_2009_v50.pro ; ======================================== ; ; DESCRIPTION ; =========== ; ; .. graphviz:: ; ; digraph air_validation_scatter_2000_2009_v50 { ; ; air_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/air_2000_2009_erai_v50.txt"]; ; ; air_trop [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_trop_v50.txt"]; ; air_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_oaflx_v50.txt"]; ; air_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/air_2000_2009_ncep_v50.txt"]; ; air_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_ncep1_v50.txt"]; ; air_ncep2 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_2000_2009_ncep2_v50.txt"]; ; air_ncep2_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/air_2m_ncep2_oafluxgrid_19890101_20091231.nc"]; ; ; t2m_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/t2m_ncep1_19890101_20091231.nc"]; ; figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/air_validation_scatter_2000_2009_v50.ps"]; ; ; erai_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_t2m_19890101_20091231_oafluxgrid.nc"]; ; ; tropflux_t2m [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_t2m_19890101_20091231_v50.nc"]; ; ; oaflux_basic [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/OAFlux_basic_variables_1985_2009.nc"]; ; ; air_validation_scatter_2000_2009_v50 [shape=box, ; fontname=Courier, ; color=blue, ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/paper01/fig3/air_validation_scatter_2000_2009_v50.pro", ; label="${TROPFLUX}/src/paper01/fig3/air_validation_scatter_2000_2009_v50.pro"]; ; ; {air_erai air_ncep erai_t2m tropflux_t2m oaflux_basic air_ncep2_oafluxgrid t2m_ncep1} -> {air_validation_scatter_2000_2009_v50} -> { air_trop air_oaflux air_ncep1 air_ncep2 figure} ; ; } ; ; SEE ALSO ; ======== ; ; :ref:`project_profile.sh` ; :ref:`project_init.pro` ; :ref:`cm_project.pro` ; ; :func:`x_site_location` ; :func:`y_site_location` ; ; :ref:`read_variables_v2.pro` ; :ref:`statistics_3var_v1.pro` ; ; EXAMPLES ; ======== ; ; :: ; ; IDL> date1=20001001L ; IDL> date2=20091231L ; IDL> air_validation_scatter_2000_2009_v50, date1, date2 ; ; TODO ; ==== ; ; make it work (missing data) ; ; Praveen confirm date selection ; ; coding rules ; ; complete description ; ; externalize function ; ; handle IO error ; ; EVOLUTIONS ; ========== ; ; $Id$ ; ; $URL$ ; ; - fplod 20110412T101323Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * remove hard coding path ; * add graphviz ; ; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * minimal header ; ;- pro air_validation_scatter_2000_2009_v50, date1, date2 ; @cm_project ; reinitplt, /z,/invert key_portrait = 1 ; openps, FILENAME = project_od_env+'air_validation_scatter_2000_2009_v50.ps' ; ; Give the location of mooring for validation of basic meteorological variables ; ; sitelist=['8s67e','12s55e', '8s55e', '8s80.5e', '1.5s80.5e', '0n80.5e', '1.5n80.5e', '1.5s90e', $ '0n90e', '1.5n90e', '4n90e','8n90e','12n90e', '15n90e', '5s95e', $ '8s165e', '8s180w', '8s155w', '8s125w', '8s110w', '8s95w', '5s156e', '5s165e', '5s180w', '5s170w', $ '5s155w', '5s140w', '5s125w', '5s110w', '5s95w', '2s156e', '2s165e', '2s180w', '2s170w', '2s155w', '2s140w', $ '2s125w', '2s110w', '2s95w', '0n147e', '0n156e', '0n165e', '0n180w', '0n170w', '0n155w', '0n140w', '0n125w', $ '0n110w', '0n95w', '2n147e', '2n156e', '2n165e', '2n180w', '2n170w', '2n155w', '2n140w', '2n125w', '2n110w', $ '2n95w', '5n147e', '5n156e', '5n165e', '5n170w', '5n155w', '5n140w', '5n125w', '5n110w', '5n95w', $ '8n156e', '8n165e', '8n180w', '8n170w', '9n140w', '8n125w', '8n110w', '8n95w', $ '0n0e', '0n10w', '0n23w', '0n35w', '10s10w', '12n23w', '12n38w', '14s32w', '15n38w', '19s34w', '20n38w', $ '21n23w', '4n23w', '4n38w', '6s10w', '8n38w', '8s30w'] ; ocean='global' ; nsmooth=1. ; statistics are with 7 day smoothed ; This program will create the following text files with statistics of respective variables close,/all ; fi_air_erai=project_id_env+'air_2000_2009_erai_v50.txt' openw,1,fi_air_erai fi_air_trop=project_id_env+'air_2000_2009_trop_v50.txt' openw,2,fi_air_trop fi_air_oaflx=project_id_env+'air_2000_2009_oaflx_v50.txt' openw,3,fi_air_oaflx fi_air_ncep2=project_id_env+'air_2000_2009_ncep2_v50.txt' openw,4,fi_air_ncep2 fi_air_ncep1=project_id_env+'air_2000_2009_ncep1_v50.txt' openw,5,fi_air_ncep1 ; ; printf,1, 'x y cor bias std rmsd mean_tao' printf,2, 'x y cor bias std rmsd mean_tao' printf,3, 'x y cor bias std rmsd mean_tao' printf,4, 'x y cor bias std rmsd mean_tao' printf,5, 'x y cor bias std rmsd mean_tao' ; ; first reading the whole ERAI uncorrected and corrected data ; file=project_id_env+'erai_t2m_19890101_20091231_oafluxgrid.nc' initncdf, file unc=read_ncdf('t2m',date1,date2,file=file,/nostr) unc=unc-273.15 help, unc ; file=project_id_env+'TropFlux_t2m_19890101_20091231_v50.nc' initncdf, file cor=read_ncdf('t2m',date1,date2,file=file,/nostr) cor=cor-273.15 help, cor ; file=project_id_env+'OAFlux_basic_variables_1985_2009.nc' initncdf, file oaf=read_ncdf("air", date1, date2, file=file,/nostr) help, oaf ; fi=project_id_env+'air_2m_ncep2_oafluxgrid_19890101_20091231.nc' initncdf, fi nce=read_ncdf("air", date1-1, date2, file=fi,/nostr) nce=nce-273.15 help, nce ; file=project_id_env+'t2m_ncep1_19890101_20091231.nc' initncdf, file nce1=read_ncdf("t2m", date1, date2, file=file,/nostr) nce1=nce1-273.15 help, nce1 ; nn=n_elements(sitelist) for n=0, nn-1 do begin ; ; reading data from mooring ; site=sitelist(n) csite=site print, csite x=x_site_location(site) y=y_site_location(site) if (y ge 0. and y le 30.) then y=y+360. dx=0.5 dy=0.5 box=[y-dy, y+dy, x-dx, x+dx] read_variables_v2, csite,date1,date2,nsmooth, $ at, sw,rh,sst,wu,wv,ws,lh ; ; ; air=rh_to_sphum(rh,at,1008) ; at -> air temperature air=at ; air -> sea surface temperature ; lh -> latent heat flux ; rh -> relative humidity ; wu,wv,ws -> wind speed ; ; extracting the corrected and uncorrected ERAI data at the locations nsmooth=1. ; extract_flux_tropflux,unc,box, $ tropflux uncr=tropflux ; extract_flux_tropflux,cor,box, $ tropflux corr=tropflux ; extract_flux_tropflux,oaf,box, $ tropflux oafl=tropflux ; extract_flux_tropflux,nce,box, $ tropflux ncep=tropflux ; extract_flux_tropflux,nce1,box, $ tropflux ncep1=tropflux ; ; ind=where(finite(air)) air=air(ind) uncr_air=uncr(ind) corr_air=corr(ind) oafl=oafl(ind) ncep=ncep(ind) ncep1=ncep1(ind) mean_tao=total(air,/nan)/n_elements(ind) ; statistics_3var_v1, air, uncr_air, corr_air, $ cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2 ; 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)' 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)' ; statistics_3var_v1, air, oafl, ncep, $ cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2 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)' 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)' ; statistics_3var_v1, air, ncep1, ncep, $ cor1, cor2, bias1, bias2, std1, std2, rmsd1, rmsd2 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)' ; endfor close,/all ; fi_air_erai=project_id_env+'air_2000_2009_erai_v50.txt' res=read_ascii(fi_air_erai,data_start=1) ff=res.field1 lat=reform(ff(0,*)) lon=reform(ff(1,*)) cor_era=reform(ff(2,*)) cor_erai=total(cor_era)/n_elements(cor_era) bias_era=reform(ff(3,*)) bias_erai=total(bias_era)/n_elements(bias_era) std_era=reform(ff(4,*)) std_erai=total(std_era)/n_elements(std_era) rmsd_era=reform(ff(5,*)) rmsd_erai=total(rmsd_era)/n_elements(rmsd_era) mean_tao=reform(ff(6,*)) mean_erai=bias_era+mean_tao ; print, '' print, 'ERAI' print, cor_erai, bias_erai, std_erai, rmsd_erai cstat=string(cor_erai, bias_erai, std_erai, rmsd_erai, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)') splot, mean_tao, mean_erai, title='T2m - TAO Vs ERAI', subtitle='', $ charsize=1.1, xtitle='TAO T2m', ytitle='ERAI T2m', small=[2,3,1], psym=2, $ xrange=[22,31], yrange=[22,31], xmin=1,ymin=1 xyouts, 22.3,30.2, cstat, charsize=0.9 xyouts, 22.3,29.5, 'cor bias std rmsd', charsize=0.9 ; oplot, [22,31], [22,31] ab=linfit(mean_tao, mean_erai,yfit=yfit) a=float(ab(0)) b=float(ab(1)) oplot, mean_tao, yfit, color=250, thick=2 ; fi_air_trop=project_id_env+'air_2000_2009_trop_v50.txt' res=read_ascii(fi_air_trop,data_start=1) ff=res.field1 lat=reform(ff(0,*)) lon=reform(ff(1,*)) cor_tro=reform(ff(2,*)) cor_trop=total(cor_tro)/n_elements(cor_tro) bias_tro=reform(ff(3,*)) bias_trop=total(bias_tro)/n_elements(bias_tro) std_tro=reform(ff(4,*)) std_trop=total(std_tro)/n_elements(std_tro) rmsd_tro=reform(ff(5,*)) rmsd_trop=total(rmsd_tro)/n_elements(rmsd_tro) mean_tao=reform(ff(6,*)) mean_trop=bias_tro+mean_tao ; print, '' print, 'TropFlux' print, cor_trop, bias_trop, std_trop, rmsd_trop cstat=string(cor_trop, bias_trop, std_trop, rmsd_trop, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)') ; splot, mean_tao, mean_trop, title='T2m - TAO Vs TropFlux', subtitle='', $ charsize=1.1, xtitle='TAO T2m', ytitle='TropFlux T2m', small=[2,3,2],/noer, psym=2, $ xrange=[22,31], yrange=[22,31], xmin=1,ymin=1 oplot, [22,31], [22,31] xyouts, 22.3,30.2, cstat, charsize=0.9 xyouts, 22.3,29.5, 'cor bias std rmsd', charsize=0.9 ; ab=linfit(mean_tao, mean_trop,yfit=yfit) a=float(ab(0)) b=float(ab(1)) oplot, mean_tao, yfit, color=250, thick=2 ; fi_air_oaflx=project_id_env+'air_2000_2009_oaflx_v50.txt' res=read_ascii(fi_air_oaflx,data_start=1) ff=res.field1 lat=reform(ff(0,*)) lon=reform(ff(1,*)) cor_oaf=reform(ff(2,*)) cor_oafl=total(cor_oaf)/n_elements(cor_oaf) bias_oaf=reform(ff(3,*)) bias_oafl=total(bias_oaf)/n_elements(bias_oaf) std_oaf=reform(ff(4,*)) std_oafl=total(std_oaf)/n_elements(std_oaf) rmsd_oaf=reform(ff(5,*)) rmsd_oafl=total(rmsd_oaf)/n_elements(rmsd_oaf) mean_tao=reform(ff(6,*)) mean_oafl=bias_oaf+mean_tao ; print, '' print, 'OAFlux' print, cor_oafl, bias_oafl, std_oafl, rmsd_oafl cstat=string(cor_oafl, bias_oafl, std_oafl, rmsd_oafl, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)') ; splot, mean_tao, mean_oafl, title='T2m - TAO Vs OAFlux', subtitle='', $ charsize=1.1, xtitle='TAO T2m', ytitle='OAFlux T2m', small=[2,3,3],/noer, psym=2, $ xrange=[22,31], yrange=[22,31], xmin=1,ymin=1 oplot, [22,31], [22,31] xyouts, 22.3,30.2, cstat, charsize=0.9 xyouts, 22.3,29.5, 'cor bias std rmsd', charsize=0.9 ; ab=linfit(mean_tao, mean_oafl,yfit=yfit) a=float(ab(0)) b=float(ab(1)) oplot, mean_tao, yfit, color=250, thick=2 ; fi_air_ncep=project_id_env+'air_2000_2009_ncep_v50.txt' res=read_ascii(fi_air_ncep,data_start=1) ff=res.field1 lat=reform(ff(0,*)) lon=reform(ff(1,*)) cor_nce=reform(ff(2,*)) cor_ncep=total(cor_nce)/n_elements(cor_nce) bias_nce=reform(ff(3,*)) bias_ncep=total(bias_nce)/n_elements(bias_nce) std_nce=reform(ff(4,*)) std_ncep=total(std_nce)/n_elements(std_nce) rmsd_nce=reform(ff(5,*)) rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce) mean_tao=reform(ff(6,*)) mean_ncep=bias_nce+mean_tao ; print, '' print, 'NCEP2' print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)') ; splot, mean_tao, mean_ncep, title='T2m - TAO Vs NCEP2', subtitle='', $ charsize=1.1, xtitle='TAO T2m', ytitle='NCEP2 T2m', small=[2,3,4],/noer, psym=2, $ xrange=[22,31], yrange=[22,31], xmin=1,ymin=1 oplot, [22,31], [22,31] xyouts, 22.3,30.2, cstat, charsize=0.9 xyouts, 22.3,29.5, 'cor bias std rmsd', charsize=0.9 ; ab=linfit(mean_tao, mean_ncep,yfit=yfit) a=float(ab(0)) b=float(ab(1)) oplot, mean_tao, yfit, color=250, thick=2 ; fi_air_ncep1=project_id_env+'air_2000_2009_ncep1_v50.txt' res=read_ascii(fi_air_ncep1,data_start=1) ff=res.field1 lat=reform(ff(0,*)) lon=reform(ff(1,*)) cor_nce=reform(ff(2,*)) cor_ncep=total(cor_nce)/n_elements(cor_nce) bias_nce=reform(ff(3,*)) bias_ncep=total(bias_nce)/n_elements(bias_nce) std_nce=reform(ff(4,*)) std_ncep=total(std_nce)/n_elements(std_nce) rmsd_nce=reform(ff(5,*)) rmsd_ncep=total(rmsd_nce)/n_elements(rmsd_nce) mean_tao=reform(ff(6,*)) mean_ncep=bias_nce+mean_tao ; print, '' print, 'NCEP1' print, cor_ncep, bias_ncep, std_ncep, rmsd_ncep cstat=string(cor_ncep, bias_ncep, std_ncep, rmsd_ncep, format='(f4.2,1x,f6.2,1x,f4.2,1x,f4.2)') ; splot, mean_tao, mean_ncep, title='T2m - TAO Vs NCEP_NCAR', subtitle='', $ charsize=1.1, xtitle='TAO T2m', ytitle='NCEP', small=[2,3,5],/noer, psym=2, $ xrange=[22,31], yrange=[22,31], xmin=1,ymin=1 oplot, [22,31], [22,31] xyouts, 22.3,30.2, cstat, charsize=0.9 xyouts, 22.3,29.5, 'cor bias std rmsd', charsize=0.9 ; ab=linfit(mean_tao, mean_ncep,yfit=yfit) a=float(ab(0)) b=float(ab(1)) oplot, mean_tao, yfit, color=250, thick=2 ; closeps ; return end function x_site_location, site n1=strpos(site, 's') if (n1 gt -1) then begin ns=-1. x=strmid(site, 0, n1) x=float(x)*ns endif else begin n1=strpos(site, 'n') x=strmid(site, 0, n1) ny=1. x=float(x)*ny endelse return, float(x) end function y_site_location, site n1=strpos(site, 'e') if (n1 gt -1) then begin n=strpos(site, 's') if (n gt -1) then begin y=strmid(site, n+1, n1-n-1) endif else begin n=strpos(site, 'n') y=strmid(site, n+1, n1-n-1) endelse ; endif else begin n1=strpos(site, 'w') n=strpos(site, 's') if (n gt -1) then begin y=strmid(site, n+1, n1-n-1) y=180+(180-float(y)) endif else begin n=strpos(site, 'n') y=strmid(site, n+1, n1-n-1) y=180+(180-float(y)) endelse endelse ; return,float(y) ; end