Index: trunk/src/paper01/fig7/ws_validation_scatter_2000_2009_basin.pro
===================================================================
--- trunk/src/paper01/fig7/ws_validation_scatter_2000_2009_basin.pro	(revision 43)
+++ trunk/src/paper01/fig7/ws_validation_scatter_2000_2009_basin.pro	(revision 46)
@@ -1,5 +1,5 @@
 ;+
 ;
-; .. _ws_validation_scatter_2000_2009_basin.pro
+; .. _ws_validation_scatter_2000_2009_basin.pro:
 ;
 ; =========================================
@@ -10,8 +10,40 @@
 ; ===========
 ;
+; .. graphviz::
+;
+;    digraph ws_validation_scatter_2000_2009_basin {
+;       graph [
+;       rankdir="LR",
+;       ]
+;       ws_erai [shape=ellipse,fontname=Courier,label="${TROPFLUX_ID}/ws_2000_2009_erai_*.txt"];
+;       ws_tropflux [shape=ellipse,fontname=Courier,label="${TROPFLUX_OD}/ws_2000_2009_trop_*.txt"];
+;       ws_oaflux [shape=ellipse,fontname=Courier,label="${TROPFLUX_OD}/ws_2000_2009_oaflx_*.txt"];
+;       ws_ncep [shape=ellipse,fontname=Courier,label="${TROPFLUX_OD}/ws_2000_2009_ncep_*.txt"];
+;       ws_ncep1 [shape=ellipse,fontname=Courier,label="${TROPFLUX_OD}/ws_2000_2009_ncep1_*.txt"];
+;       ws_tmi [shape=ellipse,fontname=Courier,label="${TROPFLUX_OD}/ws_2000_2009_tmi_*.txt"];
+;
+;       figure [shape=ellipse,fontname=Courier,label="${TROPFLUX_OD}/ws_validation_scatter_2000_2009_basin.ps"];
+;
+;       ws_validation_scatter_2000_2009_basin [shape=box,
+;       fontname=Courier,
+;       color=blue,
+;       URL="http://forge.ipsl.jussieu.fr/tropflux/browser/trunk/src/paper01/fig7/ws_validation_scatter_2000_2009_basin.pro",
+;       label="${TROPFLUX}/src/paper01/fig7/ws_validation_scatter_2000_2009_basin.pro"];
+;
+;       {ws_erai} -> {ws_validation_scatter_2000_2009_basin} -> {ws_tropflux ws_oaflux ws_ncep ws_ncep1 ws_tmi figure}
+;    }
+;
 ; SEE ALSO
 ; ========
 ;
 ; :ref:`tropflux_profile.sh`
+; :ref:`tropflux_init.pro`
+; :ref:`cm_tropflux.pro`
+;
+; :func:`x_site_location`
+; :func:`y_site_location`
+;
+; :ref:`read_variables_v2.pro`
+; :ref:`statistics_3var_v1.pro`
 ;
 ; EXAMPLES
@@ -21,7 +53,22 @@
 ;
 ;  IDL> @tropflux_init
-;  IDL> date1=++
-;  IDL> date2=++
+;  IDL> date1=19890101L
+;  IDL> date2=20091231L
 ;  IDL> ws_validation_scatter_2000_2009_basin, date1, date2
+;
+; TODO
+; ====
+;
+; make it work on cratos : pb restore, missing data
+;
+; ++ mooring data in graphviz
+;
+; coding rules
+;
+; get rid of spwan
+;
+; complete description
+;
+; handle IO error
 ;
 ; EVOLUTIONS
@@ -36,15 +83,10 @@
 ;-
 pro ws_validation_scatter_2000_2009_basin,date1,date2
-@common
-
+@cm_general
+@cm_tropflux
 reinitplt, /z,/invert
 key_portrait = 1
 
 openps, FILENAME = 'idl.ps'
-;; Before running this program, you have to compile the following subrutines
-;;   1.  .r read_era_total
-;;   2.  .r read_variables_v2
-;;   3.  .r read_era_box
-
 ;; Give the location of mooring for validation of basic meteorological variables
 
@@ -101,15 +143,15 @@
 close,/all
 
-fi_ws_erai='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_erai_'+ocean+'.txt'
+fi_ws_erai=tropflux_id_env+'ws_2000_2009_erai_'+ocean+'.txt'
 openw,1,fi_ws_erai
-fi_ws_trop='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_trop_'+ocean+'.txt'
+fi_ws_trop=tropflux_id_env+'ws_2000_2009_trop_'+ocean+'.txt'
 openw,2,fi_ws_trop
-fi_ws_oaflx='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_oaflx_'+ocean+'.txt'
+fi_ws_oaflx=tropflux_id_env+'ws_2000_2009_oaflx_'+ocean+'.txt'
 openw,3,fi_ws_oaflx
-fi_ws_ncep='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_ncep_'+ocean+'.txt'
+fi_ws_ncep=tropflux_id_env+'ws_2000_2009_ncep_'+ocean+'.txt'
 openw,4,fi_ws_ncep
-fi_ws_tmi='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_tmi_'+ocean+'.txt'
+fi_ws_tmi=tropflux_id_env+'ws_2000_2009_tmi_'+ocean+'.txt'
 openw,5,fi_ws_tmi
-fi_ws_ncep1='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_ncep1_'+ocean+'.txt'
+fi_ws_ncep1=tropflux_id_env+'ws_2000_2009_ncep1_'+ocean+'.txt'
 openw,6,fi_ws_ncep1
 
@@ -125,5 +167,5 @@
 ;; date1=20000101 & date2=20090931
 
-file='/Volumes/Iomega_HDD/TropFlux/input_uncor/erai_ws_19890101_20091231_oafluxgrid.nc'
+file=tropflux_id_env+'erai_ws_19890101_20091231_oafluxgrid.nc'
 initncdf, file
 u=read_ncdf('u10',date1,date2,file=file,/nostr)
@@ -132,40 +174,4 @@
 ;help, unc
 
-;file='/Volumes/Iomega_HDD/TropFlux/input_cor/full_cor/TropFlux_ws_19890101_20091231_v20.nc'
-;initncdf, file
-;cor=read_ncdf('ws',date1,date2,file=file,/nostr)
-;help, cor
-
-;file='/Volumes/Iomega_HDD/work/flux_reconstruction/OAFLX_GRID/OAFlux_basic_variables_1985_2009.nc'
-;initncdf, file
-;oaf=read_ncdf("wind", date1, date2, file=file,/nostr)
-;help, oaf
-
-;fi='/Volumes/Iomega_HDD/flux_reconstruction/ncep2/uwind_ncep2_oafluxgrid_19890101_20091231.nc'
-;initncdf, fi
-;u=read_ncdf("u", date1-1, date2, file=fi,/nostr)
-;fi='/Volumes/Iomega_HDD/flux_reconstruction/ncep2/vwind_ncep2_oafluxgrid_19890101_20091231.nc'
-;initncdf, fi
-;v=read_ncdf("v", date1-1, date2, file=fi,/nostr)
-;nce=sqrt(u*u+v*v)
-;help, nce
-
-;dir='/Volumes/Iomega_HDD/work/flux_reconstruction/gridded_data/'
-;fi=dir+'zonal_wind_speed_oafluxgrid_30N30S.nc'
-;initncdf, fi
-;u=read_ncdf("u", date1, date2, file=fi,/nostr)
-;fi=dir+'meridional_wind_speed_oafluxgrid_30N30S.nc'
-;initncdf, fi
-;v=read_ncdf("v", date1, date2, file=fi,/nostr)
-;ws_tmi=sqrt(u*u+v*v)
-;help, ws_tmi
-
-;file='/Volumes/Iomega_HDD/flux_reconstruction/ncep/wind_ncep1_19890101_20091231.nc'
-;initncdf, file
-;u=read_ncdf("u", date1, date2, file=file,/nostr)
-;v=read_ncdf("v", date1, date2, file=file,/nostr)
-;nce1=sqrt(u*u+v*v)
-;help, nce1
-
 ;save, unc, cor, oaf, nce, ws_tmi, nce1, filename="ws_era_trop_oaf_nce_qscat_2000_2009_global.idl"
 restore, file="/Users/pkb/work/MY_SAXO/ws_era_trop_oaf_nce_qscat_2000_2009_global.idl"
@@ -173,6 +179,4 @@
 
 nn=n_elements(sitelist)
-date1=date1
-date2=date2
 for n=0, nn-1 do begin
 
@@ -240,5 +244,5 @@
 endfor
 close,/all
-fi_ws_erai='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_erai_'+ocean+'.txt'
+fi_ws_erai=tropflux_id_env+'ws_2000_2009_erai_'+ocean+'.txt'
 res=read_ascii(fi_ws_erai,data_start=1)
 ff=res.field1
@@ -266,5 +270,5 @@
 oplot, mean_tao, yfit, color=250, thick=2
 
-fi_ws_trop='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_trop_'+ocean+'.txt'
+fi_ws_trop=tropflux_id_env+'ws_2000_2009_trop_'+ocean+'.txt'
 res=read_ascii(fi_ws_trop,data_start=1)
 ff=res.field1
@@ -293,5 +297,5 @@
 oplot, mean_tao, yfit, color=250, thick=2
 
-fi_ws_oaflx='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_oaflx_'+ocean+'.txt'
+fi_ws_oaflx=tropflux_id_env+'ws_2000_2009_oaflx_'+ocean+'.txt'
 res=read_ascii(fi_ws_oaflx,data_start=1)
 ff=res.field1
@@ -322,5 +326,5 @@
 
 
-fi_ws_ncep='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_ncep_'+ocean+'.txt'
+fi_ws_ncep=tropflux_id_env+'ws_2000_2009_ncep_'+ocean+'.txt'
 res=read_ascii(fi_ws_ncep,data_start=1)
 ff=res.field1
@@ -349,5 +353,5 @@
 oplot, mean_tao, yfit, color=250, thick=2
 
-fi_ws_tmi='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_tmi_'+ocean+'.txt'
+fi_ws_tmi=tropflux_id_env+'ws_2000_2009_tmi_'+ocean+'.txt'
 res=read_ascii(fi_ws_tmi,data_start=1)
 ff=res.field1
@@ -377,5 +381,5 @@
 
 
-fi_ws_ncep1='/Users/pkb/work/MY_SAXO/flux_automat/ws_2000_2009_ncep1_'+ocean+'.txt'
+fi_ws_ncep1=tropflux_id_env+'ws_2000_2009_ncep1_'+ocean+'.txt'
 res=read_ascii(fi_ws_ncep1,data_start=1)
 ff=res.field1
@@ -406,46 +410,6 @@
 closeps
 
-fig='ws_validation_scatter_2000_2009_'+ocean+'.ps'
-spawn, 'mv '+psdir+'idl.ps '+cpsdir+fig
-spawn, 'gv '+cpsdir+fig
-return
+fig=tropflux_od_env+'ws_validation_scatter_2000_2009_'+ocean+'.ps'
+spawn, 'mv '+psdir+'idl.ps '+fig
+spawn, 'gv '+fig
 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
