;+ ; ; .. _q2m_validation_scatter_2000_2009_v50.pro: ; ; ======================================== ; q2m_validation_scatter_2000_2009_v50.pro ; ======================================== ; ; DESCRIPTION ; =========== ; ; .. graphviz:: ; ; digraph q2m_validation_scatter_2000_2009_v50 { ; ; q2m_erai [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/q2m_2000_2009_erai_v50.txt"]; ; ; q2m_trop [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_trop_v50.txt"]; ; q2m_oaflux [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_oaflx_v50.txt"]; ; q2m_ncep [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_ncep_v50.txt"]; ; q2m_ncep1 [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_2000_2009_ncep1_v50.txt"]; ; ; erai_q2m_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/erai_t2m_19890101_20091231_oafluxgrid.nc"]; ; ; tropflux_q2m [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/TropFlux_q2m_19890101_20091231_v50.nc"]; ; ; oaflux_basic [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/OAFlux_basic_variables_1985_2009.nc"]; ; ; sphum_ncep2_oafluxgrid [shape=ellipse,fontname=Courier,label="${PROJECT_ID}/sphum_ncep2_oafluxgrid_19890101_20091231.nc"]; ; ; q2m_validation_scatter_2000_2009_v50 [shape=box, ; fontname=Courier, ; color=blue, ; URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/paper01/fig3/q2m_validation_scatter_2000_2009_v50.pro", ; label="${TROPFLUX}/src/paper01/fig3/q2m_validation_scatter_2000_2009_v50.pro"]; ; ; figure [shape=ellipse,fontname=Courier,label="${PROJECT_OD}/q2m_validation_scatter_2000_2009_v50.ps"]; ; ; {q2m_erai erai_q2m_oafluxgrid tropflux_q2m oaflux_basic sphum_ncep2_oafluxgrid} -> {q2m_validation_scatter_2000_2009_v50} -> {q2m_trop q2m_oaflux q2m_ncep q2m_ncep1 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> q2m_validation_scatter_2000_2009_v50, date1, date2 ; ; TODO ; ==== ; ; make it work (missing data) ; ; Praveen confirm date selection ; ; coding rules ; ; complete description ; ; handle IO error ; ; EVOLUTIONS ; ========== ; ; $Id$ ; ; $URL$ ; ; - pinsard 2011-04-20T15:17:57Z loholt1.ipsl.polytechnique.fr (Linux) ; ; * typo ; * externalize function ; ; - fplod 20110412T104125Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * remove hard coding path ; * add graphviz ; ; - fplod 20110411T142955Z aedon.locean-ipsl.upmc.fr (Darwin) ; ; * minimal header ; ;- pro q2m_validation_scatter_2000_2009_v50, date1, date2 @cm_project reinitplt, /z,/invert key_portrait = 1 openps, FILENAME = project_od_env+'q2m_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_q2m_erai=project_id_env+'q2m_2000_2009_erai_v50.txt' openw,1,fi_q2m_erai fi_q2m_trop=project_id_env+'q2m_2000_2009_trop_v50.txt' openw,2,fi_q2m_trop fi_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_v50.txt' openw,3,fi_q2m_oaflx fi_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_v50.txt' openw,4,fi_q2m_ncep fi_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_v50.txt' openw,5,fi_q2m_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_q2m_19890101_20091231_oafluxgrid.nc' initncdf, file unc=read_ncdf('q2m',date1,date2,file=file,/nostr) help, unc file=project_id_env+'TropFlux_q2m_19890101_20091231_v20.nc' initncdf, file cor=read_ncdf('q2m',date1,date2,file=file,/nostr) help, cor file=project_id_env+'OAFlux_basic_variables_1985_2009.nc' initncdf, file oaf=read_ncdf("sphum", date1, date2, file=file,/nostr) help, oaf fi=project_id_env+'sphum_ncep2_oafluxgrid_19890101_20091231.nc' initncdf, fi nce=read_ncdf("shum", date1-1, date2, file=fi,/nostr) nce=nce*1000 help, nce file=project_id_env+'q2m_ncep1_19890101_20091231.nc' initncdf, file nce1=read_ncdf("q2m", date1, date2, file=file,/nostr) nce1=nce1*1000 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 q2m=rh_to_sphum(rh,at,1008) ;; at -> q2m temperature ; q2m=at ;; q2m -> 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(q2m)) & q2m=q2m(ind) & uncr_q2m=uncr(ind) & corr_q2m=corr(ind) oafl=oafl(ind) & ncep=ncep(ind) & ncep1=ncep1(ind) mean_tao=total(q2m,/nan)/n_elements(ind) statistics_3var_v1, q2m, uncr_q2m, corr_q2m, $ 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, q2m, 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, q2m, 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_q2m_erai=project_id_env+'q2m_2000_2009_erai_v50.txt' res=read_ascii(fi_q2m_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='Q2m - TAO Vs ERAI', subtitle='', $ charsize=1.1, xtitle='TAO Q2m', ytitle='ERAI Q2m', small=[2,3,1], psym=2, $ xrange=[11,21], yrange=[11,21], xmin=1,ymin=1 xyouts, 12,20.2, cstat, charsize=0.9 xyouts, 12,19.7, 'cor bias std rmsd', charsize=0.9 oplot, [11,21], [11,21] 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_q2m_trop=project_id_env+'q2m_2000_2009_trop_v50.txt' res=read_ascii(fi_q2m_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='Q2m - TAO Vs TropFlux', subtitle='', $ charsize=1.1, xtitle='TAO Q2m', ytitle='TropFlux Q2m', small=[2,3,2],/noer, psym=2, $ xrange=[11,21], yrange=[11,21], xmin=1,ymin=1 oplot, [11,21], [11,21] xyouts, 12,20.2, cstat, charsize=0.9 xyouts, 12,19.7, '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_q2m_oaflx=project_id_env+'q2m_2000_2009_oaflx_v50.txt' res=read_ascii(fi_q2m_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='Q2m - TAO Vs OAFlux', subtitle='', $ charsize=1.1, xtitle='TAO Q2m', ytitle='OAFlux Q2m', small=[2,3,3],/noer, psym=2, $ xrange=[11,21], yrange=[11,21], xmin=1,ymin=1 oplot, [11,21], [11,21] xyouts, 12,20.2, cstat, charsize=0.9 xyouts, 12,19.7, '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_q2m_ncep=project_id_env+'q2m_2000_2009_ncep_v50.txt' res=read_ascii(fi_q2m_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='Q2m - TAO Vs NCEP2', subtitle='', $ charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP2 Q2m', small=[2,3,4],/noer, psym=2, $ xrange=[11,21], yrange=[11,21], xmin=1,ymin=1 oplot, [11,21], [11,21] xyouts, 12,20.2, cstat, charsize=0.9 xyouts, 12,19.7, '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_q2m_ncep1=project_id_env+'q2m_2000_2009_ncep1_v50.txt' res=read_ascii(fi_q2m_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='Q2m - TAO Vs NCEP', subtitle='', $ charsize=1.1, xtitle='TAO Q2m', ytitle='NCEP1 Q2m', small=[2,3,5],/noer, psym=2, $ xrange=[11,21], yrange=[11,21], xmin=1,ymin=1 oplot, [11,21], [11,21] xyouts, 12,20.2, cstat, charsize=0.9 xyouts, 12,19.7, '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 end