Index: /trunk/tools/obs-sim_Comparison.bash
===================================================================
--- /trunk/tools/obs-sim_Comparison.bash	(revision 2012)
+++ /trunk/tools/obs-sim_Comparison.bash	(revision 2013)
@@ -823,6 +823,6 @@
         awk '{print $3"_"$4}'`
 
-      simostptf=${odir}'/simout_vars_'${prn}'pt_'${stid}'_'${expl}'_'${fdate}'.nc'
-      simostdiagsf=${odir}'/simout_'${prn}'diags_'${stid}'_'${expl}'_'${fdate}'.nc'
+      simsndptf=${odir}'/simout_vars_'${prn}'pt_'${stid}'_'${expl}'_'${fdate}'.nc'
+      simsnddiagsf=${odir}'/simout_'${prn}'diags_'${stid}'_'${expl}'_'${fdate}'.nc'
 
       fvals=${ostlon}'#'${ostlat}'#'${simf}'#XLONG#XLAT#'${wrfdiags}'#'
@@ -866,4 +866,89 @@
   iost=`expr ${iost} + 1`
 done
+
+# surface data
+iost=1
+obstype='surface'
+prn='sfc'
+listfiles=${sfcfiles}
+wrfdiags=${wrfsfcdiags}
+simdiagd=${simsfcdiagd}
+for ostf in ${listfiles}; do
+
+  stid=`python $pyHOME/nc_var.py -o varout -f ${ostf} -S 'time:0' -v id | grep NC \
+    | awk '{printf("%d",$2)}'`
+  ostlon=`python $pyHOME/nc_var.py -o varout -f ${ostf} -S 'time:0' -v lon | grep NC \
+    | awk '{print $2}'`
+  ostlat=`python $pyHOME/nc_var.py -o varout -f ${ostf} -S 'time:0' -v lat | grep NC \
+    | awk '{print $2}'`
+  ostheight=`python $pyHOME/nc_var.py -o varout -f ${ostf} -S 'time:0' -v height |   \
+    grep NC | awk '{print $2}'`
+
+  if test ${iost} -eq 1; then 
+    oststids=${stid}'@'${ostf}
+    echo ${prn}","${stid}","${ostlon}","${ostlat}","${ostheight} > ${wdir}/stations.inf
+  else 
+    oststids=${oststids}':'${stid}'@'${ostf}
+    echo ${prn}","${stid}","${ostlon}","${ostlat}","${ostheight} >> ${wdir}/stations.inf
+  fi
+
+  iexp=1
+  for exp in ${exps}; do
+    expf=`echo ${exp} | tr ',' ' ' | awk '{print $1}'`
+    expl=`echo ${exp} | tr ',' ' ' | awk '{print $2}'`
+    expn=`echo ${exp} | tr ',' ' ' | awk '{print $3}'`
+    expc=`echo ${exp} | tr ',' ' ' | awk '{print $4}'`
+
+    simfiles=`ls -1 ${simdir}/${expf}/${simH}*${simM}*${simT}`
+
+    for simf in ${simfiles}; do
+      simfn=`basename ${simf}`
+      fdate=`echo ${simfn} | tr '.' ' ' | awk '{print $1}' | tr '_' ' ' |            \
+        awk '{print $3"_"$4}'`
+
+      simsfcptf=${odir}'/simout_vars_'${prn}'pt_'${stid}'_'${expl}'_'${fdate}'.nc'
+      simsfcdiagsf=${odir}'/simout_'${prn}'diags_'${stid}'_'${expl}'_'${fdate}'.nc'
+
+      fvals=${ostlon}'#'${ostlat}'#'${simf}'#XLONG#XLAT#'${wrfdiags}'#'
+      fvals=${fvals}${wrfsfcnondiags}'#'${simdiagd}
+      get_WRFsurface_data ${fvals}
+
+    # end of files
+    done
+
+    # Concatenating files
+    ofile=${odir}/simout_${prn}vars_${stid}_${expl}.nc
+    if ${fscratch}; then rm ${ofile} >& /dev/null; fi
+    if test ! -f ${ofile}; then
+      Nconfc=`ls -1 ${odir}/simout_${prn}diags_*${stid}*${expl}*.nc | wc -l | awk '{print $1}'`
+      if test ${Nconfc} -gt 1; then 
+        values=${odir}',Time,time'
+        HMT='simout_'${prn}'diags_,'${stid}'_'${expn},'nc'
+        python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}      \
+         -f ${HMT} -v all
+        if test $? -ne 0; then
+          echo ${errmsg}
+          echo "  python failed!!"
+          echo python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}\
+          -f ${HMT} -v all
+          exit
+        fi
+        echo " * Concatenating "${obstype}" data at point: "${ostlon}", "${ostlat} >> ${ofileins}
+        echo python  ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S \
+          "'"${values}"'" -f ${HMT} -v all >> ${ofileins}
+        echo " " >> ${ofileins}
+        mv netcdf_fold_concatenated_HMT.nc ${ofile}
+      else
+        ffilen=`ls -1 ${odir}/simout_${prn}diags_*${stid}*${expl}*.nc`
+        cp ${ffilen} ${ofile}
+      fi
+    fi
+    iexp=`expr ${iexp} + 1`
+  # end of experiments
+  done
+
+  iost=`expr ${iost} + 1`
+done
+
 exit
 
Index: /trunk/tools/obs_simComparison.conf
===================================================================
--- /trunk/tools/obs_simComparison.conf	(revision 2012)
+++ /trunk/tools/obs_simComparison.conf	(revision 2013)
@@ -23,6 +23,4 @@
 # Header of the name of the soundings file 
 sndHf = UWyoming_snd_
-#snddimt=6
-#sndstn='Ezeiza'
 
 # Initial color value for the SkewT-logP evolution (rgb based, 'red' for ta; 'blue' for tda)
@@ -87,5 +85,8 @@
 # Name of the surface diagnostics to compute 
 #wrfsfcdiags=wds:wss:WRFpsl_ecmwf:clt:WRFtdas
-wrfsfcdiags=T2:wds:wss:WRFtdas
+wrfsfcdiags=wds:wss:WRFtdas
+
+# Name of the non-diagnostics surface variables to add
+wrfsfcnondiags=T2
 
 # Figures output directory
