Index: /trunk/tools/obs-sim_Comparison.bash
===================================================================
--- /trunk/tools/obs-sim_Comparison.bash	(revision 2016)
+++ /trunk/tools/obs-sim_Comparison.bash	(revision 2017)
@@ -53,9 +53,9 @@
 
 # files from scratch
-if test; then ${fscratch} = 'true'; fscratch=true
+if test ${fscratch} = 'true'; then fscratch=true
 else fscratch=false; fi
 
 # figures from scratch
-if test; then ${gscratch} = 'true'; gscratch=true
+if test ${gscratch} = 'true'; then gscratch=true
 else gscratch=false; fi
 
@@ -435,5 +435,5 @@
     if ${gscratch}; then rm ${ofign} >& /dev/null; fi
     if test ! -f ${ofign}; then
-      echo "  Wind Rose on: "${timeS}
+      echo "    Wind Rose on: "$(echo ${timeS} | tr '!' ' ')
       python ${pyHOME}/drawing.py -o draw_WindRose -S ${values} -v ua,va -f ${filen} >& /dev/null
       if test $? -ne 0; then
@@ -477,5 +477,5 @@
     if ${gscratch}; then rm ${ofign} >& /dev/null; fi
     if test ! -f ${ofign}; then
-      echo "  Sounding on: "$(echo ${timeS} | tr '!' ' ')
+      echo "    Sounding on: "$(echo ${timeS} | tr '!' ' ')
       python ${pyHOME}/drawing.py -o draw_SkewT -S ${values} -v ta,tda,pres -f ${filen} >& /dev/null
       if test $? -ne 0; then
@@ -520,5 +520,5 @@
   if ${gscratch}; then rm ${ofign} >& /dev/null; fi
   if test ! -f ${ofign}; then
-    echo "  Sounding on: "$(echo ${timeS} | tr '!' ' ')
+    echo "    Sounding on: "$(echo ${timeS} | tr '!' ' ')
     python ${pyHOME}/drawing.py -o draw_multi_SkewT -S ${tatda_evol_values} -f ${tatda_evol_files} >& /dev/null
     if test $? -ne 0; then
@@ -567,5 +567,5 @@
     if ${gscratch}; then rm ${ofign} >& /dev/null; fi
     if test ! -f ${ofign}; then
-      echo "  Sounding on: "$(echo ${dateS} | tr '!' ' ')
+      echo "    Sounding on: "$(echo ${dateS} | tr '!' ' ')
       python ${pyHOME}/drawing.py -o draw_multi_SkewT -S ${values} -f ${compfiles} >& /dev/null
       if test $? -ne 0; then
@@ -620,4 +620,5 @@
   if ${gscratch}; then rm ${ofign} >& /dev/null; fi
   if test ! -f ${ofign}; then
+    echo "    Sounding comparison on : "${sndstid}" by "${expl}
     python ${pyHOME}/drawing.py -o draw_2D_shad_contdisc_time -f ${cfiles} -S ${cvalues}
     if test $? -ne 0; then
@@ -672,4 +673,5 @@
     if ${gscratch}; then rm ${ofign} >& /dev/null; fi
     if test ! -f ${ofign}; then
+      echo "    Time-Series comparison on : "${sti}" for "${sfcv}
       python ${pyHOME}/drawing.py -o draw_lines_time -f ${files} -S ${values} -v ${sfcv}
       if test $? -ne 0; then
@@ -735,4 +737,5 @@
     if ${gscratch}; then rm ${ofign} >& /dev/null; fi
     if test ! -f ${ofign}; then
+      echo "    Map comparison on : "$(echo ${timeS} | tr '!' ' ')" by "${expl}" for "${sfcv}
       python ${pyHOME}/drawing.py -o draw_2D_shad_contdisc -f ${cfiles} -S ${cvalues}
       if test $? -ne 0; then
@@ -871,4 +874,5 @@
   iost=`expr ${iost} + 1`
 done
+sndstids=${oststids}
 
 # surface data
@@ -955,4 +959,5 @@
   iost=`expr ${iost} + 1`
 done
+sfcstids=${oststids}
 
 ###
@@ -988,6 +993,4 @@
 fi
 
-exit
-
 ###
 ## Soundings figures
@@ -1008,5 +1011,9 @@
       echo python ${pyHOME}/diagnostics.py -f ${sndf} -d 'time@time,pres@pres' -v 'uavaFROMwswd|ws@wd'
       exit
-    fi 
+    fi
+    echo " * Getting ua,va winds from station "${stid}": " >> ${ofileins}
+    echo python ${pyHOME}/diagnostics.py -f ${sndf} -d "'"time@time,pres@pres"'"     \
+      -v "'"uavaFROMwswd|ws@wd"'" >> ${ofileins}
+    echo " " >> ${ofileins}    
     mv diagnostics.nc ${ouavasndf}
   fi
@@ -1085,5 +1092,4 @@
     col2=`expr ${col2} - ${ddcol}`
 
-    #exit
     it=`expr ${it} + 1`
   done
@@ -1095,4 +1101,5 @@
 # End of soundings
 done
+exit
 
 # snd-sims comparison
@@ -1139,6 +1146,10 @@
       expc=`echo ${exp} | tr ',' ' ' | awk '{print $4}'`
 
-      simjoinselvars=${odir}'/simout_vars_'${expl}'.nc'
-      simdiagsf=${odir}'/simout_snddiags_'${expl}'.nc'
+      #simjoinselvars=${odir}'/simout_vars_'${expl}'.nc'
+      #simdiagsf=${odir}'/simout_snddiags_'${expl}'.nc'
+      #simfiles=`ls -1 ${simdir}/${expf}/${simH}*${simM}*${simT}`
+      simjoinselvars=`ls -1 ${simdir}/${expf}/${simH}*${simM}*${simT} | head -n 1`
+      simdiagsf=${odir}'/simout_sndvars_'${stid}'_'${expl}'.nc'
+      simsndptf=${odir}'/simout_sndvars_'${stid}'_'${expl}'.nc'
 
       gridsndv=`python ${pyHOME}/nc_var.py -o get_point -f ${simjoinselvars}         \
@@ -1154,23 +1165,4 @@
       fi
 
-      # Getting values at the sounding point
-      simsndptf=${odir}'/simout_vars_sndpt_'${stid}'_'${expl}'.nc'
-      if ${fscratch}; then rm ${simsndptf} >& /dev/null; fi
-      if test ! -f ${simsndptf}; then
-        values='time,0,-1,1@bottom_top,0,-1,1@south_north,'${ysnd}','${ysnd}',1@'
-        values=${values}'west_east,'${xsnd}','${xsnd}',1'
-        python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${simdiagsf}       \
-          -S ${values} -v all
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${simdiagsf}\
-            -S "'"${values}"'" -v all
-          exit
-        fi
-        ofilen=`ls -rt1 ${odir} | tail -n 1`
-        mv ${odir}/${ofilen} ${simsndptf}
-      fi
-
       # Time information from simulation
       simdimt=`python ${pyHOME}/nc_var.py -o itime -S CFtime, -v time                \
@@ -1186,4 +1178,5 @@
         -S ${otimev}';'${tunits} -v time | tr ' ' '@'`
       timestep=`echo ${timestepv} | tr '@' ' ' | awk '{print $1}'`
+      timestepdiff=`echo ${timestepv} | tr '@' ' ' | awk '{print $2}'`
       if test $? -ne 0; then
         echo ${errmsg}
@@ -1249,5 +1242,4 @@
     fivals=${fivals}${compfiles}'@'${dateS}'@'${ofigdir}'@'${datefS}'@'${ofigdir}'@'
     fivals=${fivals}'SkewT-logP_obs-sim_step'
-
     multi_SkewT_logP_plot ${fivals}
 
@@ -1263,4 +1255,6 @@
 # End of soundings stations
 done
+
+exit
 
 ###
