Index: /trunk/tools/obs-sim_Comparison_ONLYfigures.bash
===================================================================
--- /trunk/tools/obs-sim_Comparison_ONLYfigures.bash	(revision 2112)
+++ /trunk/tools/obs-sim_Comparison_ONLYfigures.bash	(revision 2113)
@@ -1,4 +1,4 @@
 #!/bin/bash
-# Shell script to compare observations with simulations using PyNCplot
+# Shell script to compare observations with simulations using PyNCplot figures 'ONLY'
 # 
 #   observations: different files from create_OBSnetcdf.py and/or UWyoming_snd_nc.py
@@ -52,7 +52,5 @@
 echo "END upload -- end UPLOAD -- END upload -- end UPLOAD"
 
-# files from scratch
-if test ${fscratch} = 'true'; then fscratch=true
-else fscratch=false; fi
+fscratch=false
 
 # figures from scratch
@@ -144,530 +142,4 @@
   else
     false
-  fi
-}
-
-function get_WRFsounding_data(){
-# Function to get the data to compute analysis in a sounding point
-#   stlon= longitude value of the station
-#   stlat= latitude value of the station
-#   filen= name of the file
-#   lonvarn= name of the longitude variable
-#   latvarn= name of the latitude variable
-#   snddiagnames= diagnostics to compute (as ':' separated list)
-#   snddiagd= name of the dimensions and dimension variables to use for diagnostics
-
-  funcvals=$1
-
-  stlon=`echo ${funcvals} | tr '#' ' ' | awk '{print $1}'`
-  stlat=`echo ${funcvals} | tr '#' ' ' | awk '{print $2}'`
-  filen=`echo ${funcvals} | tr '#' ' ' | awk '{print $3}'`
-  lonvarn=`echo ${funcvals} | tr '#' ' ' | awk '{print $4}'`
-  latvarn=`echo ${funcvals} | tr '#' ' ' | awk '{print $5}'`
-  snddiagnames=`echo ${funcvals} | tr '#' ' ' | awk '{print $6}'`
-  snddiagd=`echo ${funcvals} | tr '#' ' ' | awk '{print $7}'`
-
-  vals=${lonvarn}':'${latvarn}':Time|0'
-  gridsndv=`python ${pyHOME}/nc_var.py -o get_point -f ${filen} -S ${vals}           \
-    -v ${stlon},${stlat} | tr ' ' '!'`
-  echo "* get grid point: "${stlon}", "${stlat} >> ${ofileins}
-  echo python ${pyHOME}/nc_var.py -o get_point -f ${filen} -S "'"${vals}"'"          \
-    -v ${stlon},${stlat} >> ${ofileins}
-  echo " " >> ${ofileins}
-
-  xsnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $1}' | tr ',' ' ' |              \
-   awk '{print $1}'`
-  ysnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $1}' | tr ',' ' ' |              \
-  awk '{print $2}'`
-  dsnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $2}'`
-
-  xsnd1=`expr ${xsnd} + 1`
-  ysnd1=`expr ${ysnd} + 1`
-
-  # Getting values
-  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@south_north_stag,'${ysnd}','
-    values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1:False'
-    python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}               \
-      -S ${values} -v all
-    if test $? -ne 0; then
-      echo ${errmsg}
-      echo "  python failed!!"
-      echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}        \
-        -S "'"${values}"'" -v all
-      exit
-    fi
-    echo "* get values at snd point: "${stlon}", "${stlat} >> ${ofileins}
-    echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}          \
-      -S "'"${values}"'" -v all >> ${ofileins}
-    echo " " >> ${ofileins}
-
-    yslc='south_north_B'${ysnd}'-E'${ysnd}'-I1'
-    ystslc='south_north_stag_B'${ysnd}'-E'${ysnd1}'-I1'
-    xslc='west_east_B'${xsnd}'-E'${xsnd}'-I1'
-    xstslc='west_east_stag_B'${xsnd}'-E'${xsnd1}'-I1'
-
-    Hfilen=`basename ${filen}`
-    Dfilen=`dirname ${filen}`
-    Hhfilen=`echo ${Hfilen} | tr '.' ' ' | awk '{print $1}'`
-
-    ofilen='newfile_multidims.nc'
-    mv ${ofilen} ${simsndptf}
-  fi
-    
-  # Computing sounding diagnostics
-  diagns=`echo ${snddiagnames} | tr ':' ' '`
-
-  idiag=1
-  for diagn in ${diagns}; do
-    diagv=`cat $pyHOME/diagnostics.inf | grep ${diagn}',' | tr ',' ' ' |             \
-      awk '{print $2"|"$3}'`
-    if test ${idiag} -eq 1; then
-      snddiagvals=${diagv}
-    else
-      snddiagvals=${snddiagvals}','${diagv}
-    fi
-    idiag=`expr ${idiag} + 1`
-  done
-
-  if ${fscratch}; then rm ${simsnddiagsf}; fi
-  if test ! -f ${simsnddiagsf}; then
-    python ${pyHOME}/diagnostics.py -f ${simsndptf} -d ${snddiagd} -v ${snddiagvals}
-    if test $? -ne 0; then
-      echo ${errmsg}
-      echo "  python failed!!"
-      echo python ${pyHOME}/diagnostics.py -f ${simsndptf} -d "'"${snddiagd}"'" -v   \
-        "'"${snddiagvals}"'"
-      exit
-    fi
-    echo "* computing diagnostics at snd point: "${stlon}", "${stlat} >> ${ofileins}
-    echo python ${pyHOME}/diagnostics.py -f "'"${simsndptf}"'" -d "'"${snddiagd}"'"  \
-      -v "'"${snddiagvals}"'" >> ${ofileins}
-    echo " " >> ${ofileins}
-
-    mv diagnostics.nc ${simsnddiagsf}
-    if $(isin_list ${snddiagnames} WRFt); then
-      #To deg
-      python ${pyHOME}/nc_var.py -o valmod -S subc,273.15 -f ${simsnddiagsf} -v ta
-    fi
-    if $(isin_list ${snddiagnames} WRFp); then
-      #To Pa
-      python ${pyHOME}/nc_var.py -o valmod -S divc,100. -f ${simsnddiagsf} -v pres
-    fi
-  fi
-}
-
-function get_WRFsurface_data(){
-# Function to get the data to compute analysis in a surface point
-#   stlon= longitude value of the station
-#   stlat= latitude value of the station
-#   filen= name of the file
-#   lonvarn= name of the longitude variable
-#   latvarn= name of the latitude variable
-#   sfcdiagnames= diagnostics to compute (as ':' separated list)
-#   nondiagvs= ':' list of variables which are not from a diagnostics ('None' for 
-#     without)
-#   sfcdiagd= name of the dimensions and dimension variables to use for diagnostics
-
-  funcvals=$1
-
-  stlon=`echo ${funcvals} | tr '#' ' ' | awk '{print $1}'`
-  stlat=`echo ${funcvals} | tr '#' ' ' | awk '{print $2}'`
-  filen=`echo ${funcvals} | tr '#' ' ' | awk '{print $3}'`
-  lonvarn=`echo ${funcvals} | tr '#' ' ' | awk '{print $4}'`
-  latvarn=`echo ${funcvals} | tr '#' ' ' | awk '{print $5}'`
-  sfcdiagnames=`echo ${funcvals} | tr '#' ' ' | awk '{print $6}'`
-  nondiagvs=`echo ${funcvals} | tr '#' ' ' | awk '{print $7}'`
-  sfcdiagd=`echo ${funcvals} | tr '#' ' ' | awk '{print $8}'`
-
-  vals=${lonvarn}':'${latvarn}':Time|0'
-  gridsndv=`python ${pyHOME}/nc_var.py -o get_point -f ${filen} -S ${vals}           \
-    -v ${stlon},${stlat} | tr ' ' '!'`
-  echo "* get grid point: "${stlon}", "${stlat} >> ${ofileins}
-  echo python ${pyHOME}/nc_var.py -o get_point -f ${filen} -S "'"${vals}"'"          \
-    -v ${stlon},${stlat} >> ${ofileins}
-  echo " " >> ${ofileins}
-  xsnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $1}' | tr ',' ' ' |              \
-   awk '{print $1}'`
-  ysnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $1}' | tr ',' ' ' |              \
-  awk '{print $2}'`
-  dsnd=`echo ${gridsndv} | tr '!' ' ' | awk '{print $2}'`
-
-  xsnd1=`expr ${xsnd} + 1`
-  ysnd1=`expr ${ysnd} + 1`
-
-  # Getting values
-  if ${fscratch}; then rm ${simsfcptf} >& /dev/null; fi
-  if test ! -f ${simsfcptf}; then
-    values='Time,0,-1,1@south_north,'${ysnd}','${ysnd}',1@'
-    values=${values}'west_east,'${xsnd}','${xsnd}',1@south_north_stag,'${ysnd}','
-    values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1:False'
-    python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}               \
-      -S ${values} -v all
-    if test $? -ne 0; then
-      echo ${errmsg}
-      echo "  python failed!!"
-      echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}        \
-        -S "'"${values}"'" -v all
-      exit
-    fi
-  echo "* get values at sfc point: "${stlon}", "${stlat} >> ${ofileins}
-  echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}            \
-      -S "'"${values}"'" -v all >> ${ofileins}
-  echo " " >> ${ofileins}
-    yslc='south_north_B'${ysnd}'-E'${ysnd}'-I1'
-    ystslc='south_north_stag_B'${ysnd}'-E'${ysnd1}'-I1'
-    xslc='west_east_B'${xsnd}'-E'${xsnd}'-I1'
-    xstslc='west_east_stag_B'${xsnd}'-E'${xsnd1}'-I1'
-
-    ofilen='newfile_multidims.nc'
-    mv ${ofilen} ${simsfcptf}
-  fi
-    
-  # Computing sfc diagnostics
-  diagns=`echo ${sfcdiagnames} | tr ':' ' '`
-
-  idiag=1
-  for diagn in ${diagns}; do
-    diagv=`cat $pyHOME/diagnostics.inf | grep WRF | grep ${diagn}',' | tr ',' ' ' |  \
-      awk '{print $2"|"$3}'`
-    if test ${idiag} -eq 1; then
-      sfcdiagvals=${diagv}
-    else
-      sfcdiagvals=${sfcdiagvals}','${diagv}
-    fi
-    idiag=`expr ${idiag} + 1`
-  done
-
-  if ${fscratch}; then rm ${simsfcdiagsf}; fi
-  if test ! -f ${simsfcdiagsf}; then
-    python ${pyHOME}/diagnostics.py -f ${simsfcptf} -d ${sfcdiagd} -v ${sfcdiagvals}
-    if test $? -ne 0; then
-      echo ${errmsg}
-      echo "  python failed!!"
-      echo python ${pyHOME}/diagnostics.py -f ${simsfcptf} -d "'"${sfcdiagd}"'"      \
-        -v "'"${sfcdiagvals}"'"
-      exit
-    fi
-    echo "* diagnostics at sfc point: "${stlon}", "${stlat} >> ${ofileins}
-    echo python ${pyHOME}/diagnostics.py -f ${simsfcptf} -d "'"${sfcdiagd}"'"        \
-      -v "'"${sfcdiagvals}"'" >> ${ofileins}
-    echo " " >> ${ofileins}
-    mv diagnostics.nc ${simsfcdiagsf}
-    if $(isin_list ${sfcdiagnames} wds); then
-      #To rad
-      python ${pyHOME}/nc_var.py -o valmod -S mulc,0.0174532925199 -f ${simsfcdiagsf}\
-        -v wds
-      python ${pyHOME}/nc_var.py -o varaddattr -S 'units|rad' -f ${simsfcdiagsf} -v wds
-    fi
-
-    #Adding non-diagnostic variables
-    if test ! ${nondiagvs} = 'None'; then
-      varsadd=`echo ${nondiagvs} | tr ':' ' '`
-      for vadd in ${varsadd}; do
-        python ${pyHOME}/nc_var.py -o fvaradd -S ${simsfcptf},${vadd}                \
-          -f ${simsfcdiagsf}
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcptf},${vadd}"'"   \
-            -f ${simsfcdiagsf}
-          exit
-          rm ${simsfcdiagsf}
-        fi
-        echo "* adding variable '"${vadd}"' at sfc point: "${stlon}", "${stlat} >>   \
-          ${ofileins}
-        echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcptf},${vadd}"'"     \
-          -f ${simsfcdiagsf} >> ${ofileins}
-        echo " " >> ${ofileins}
-        # CF varname
-        CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} |           \
-          tr ':' ' ' | awk '{print $1}'`
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python $pyHOME/generic.py -o variables_values -S ${vadd}
-          exit
-          rm ${simsfcdiagsf}
-        fi
-        python $pyHOME/nc_var.py -o chvarname -S ${CFvarn} -f ${simsfcdiagsf}        \
-          -v ${vadd}
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python ${pyHOME}/nc_var.py -o chvarname -S ${CFvarn}                  \
-            -f ${simsfcdiagsf} -v ${vadd}
-          exit
-          rm ${simsfcdiagsf}
-        fi
-      done
-    fi
-  fi
-}
-
-function get_WRFsfc2D_data(){
-# Function to get the data to compute analysis in a surface map
-#   filen= name of the file
-#   sfcdiagnames= diagnostics to compute (as ':' separated list)
-#   nondiagvs= ':' list of variables which are not from a diagnostics ('None' for 
-#     without)
-#   sfcmapdiagd= name of the dimensions and dimension variables to use for diagnostics
-
-  funcvals=$1
-
-  filen=`echo ${funcvals} | tr '#' ' ' | awk '{print $1}'`
-  sfcdiagnames=`echo ${funcvals} | tr '#' ' ' | awk '{print $2}'`
-  nondiagvs=`echo ${funcvals} | tr '#' ' ' | awk '{print $3}'`
-  sfcmapdiagd=`echo ${funcvals} | tr '#' ' ' | awk '{print $4}'`
-
-  # Computing sfc diagnostics
-  diagns=`echo ${sfcdiagnames} | tr ':' ' '`
-
-  # getting that variables only required for the diagnostics
-  vardiags=''
-  idiag=1
-  for diagn in ${diagns}; do
-    diagv=`cat $pyHOME/diagnostics.inf | grep WRF | grep ${diagn}',' | tr ',' ' ' |  \
-      awk '{print $2"|"$3}'`
-    if test ${idiag} -eq 1; then
-      sfcdiagvals=${diagv}
-      vardiags=`echo ${diagv} | tr '|' ' ' | awk '{print $2}' | tr '@' ':'`
-    else
-      sfcdiagvals=${sfcdiagvals}','${diagv}
-      vardiag=`echo ${diagv} | tr '|' ' ' | awk '{print $2}' | tr '@' ' '`
-      for vd in ${vardiag}; do
-        if ! $(isin_list ${vardiags} ${vd}); then vardiags=${vardiags}':'${vd}; fi
-      done
-    fi
-    idiag=`expr ${idiag} + 1`
-  done
-
-  # Inlcuding non-diagnostics
-  if test ! ${nondiagvs} = 'None'; then
-    nvns=`echo ${nondiagvs} | tr ':' ' '`
-    for vn in ${nvns}; do
-      if ! $(isin_list ${vardiags} ${vn}); then vardiags=${vardiags}':'${vn}; fi
-    done
-    if ! $(isin_list ${vardiags} 'time'); then vardiags=${vardiags}':time'; fi
-  fi
-  vardiag=`echo ${vardiags} | tr ':' ','`
-  
-  # Getting values
-  if ${fscratch}; then rm ${simsfcmapf} >& /dev/null; fi
-  if test ! -f ${simsfcmapf}; then
-    values='Time,0,-1,1@south_north,0,-1,1@west_east,0,-1,1@south_north_stag,0,-1,1@'
-    values=${values}'west_east_stag,0,-1,1:False'
-    python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}               \
-      -S ${values} -v ${vardiag}
-    if test $? -ne 0; then
-      echo ${errmsg}
-      echo "  python failed!!"
-      echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}        \
-        -S "'"${values}"'"  -v ${vardiag}
-      exit
-    fi
-    echo "* get values for 2D map diagnostics: " >> ${ofileins}
-    echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}          \
-      -S "'"${values}"'" -v ${vardiag} >> ${ofileins}
-    echo " " >> ${ofileins}
-
-    ofilen='newfile_multidims.nc'
-    mv ${ofilen} ${simsfcmapf}
-  fi
-
-  if ${fscratch}; then rm ${simsfcmapdiagsf}; fi
-  if test ! -f ${simsfcmapdiagsf}; then
-    python ${pyHOME}/diagnostics.py -f ${simsfcmapf} -d ${sfcmapdiagd}               \
-      -v ${sfcdiagvals}
-    if test $? -ne 0; then
-      echo ${errmsg}
-      echo "  python failed!!"
-      echo python ${pyHOME}/diagnostics.py -f ${simsfcmapf} -d "'"${sfcmapdiagd}"'"  \
-        -v "'"${sfcdiagvals}"'"
-      exit
-    fi
-    echo "* diagnostics for sfc 2D map: " >> ${ofileins}
-    echo python ${pyHOME}/diagnostics.py -f ${simsfcmapf} -d "'"${sfcmapdiagd}"'"    \
-      -v "'"${sfcdiagvals}"'" >> ${ofileins}
-    echo " " >> ${ofileins}
-    mv diagnostics.nc ${simsfcmapdiagsf}
-    if $(isin_list ${sfcdiagnames} wds); then
-      #To rad
-      python ${pyHOME}/nc_var.py -o valmod -S mulc,0.0174532925199                   \
-        -f ${simsfcmapdiagsf} -v wds
-      python ${pyHOME}/nc_var.py -o varaddattr -S 'units|rad' -f ${simsfcmapdiagsf}  \
-        -v wds
-    fi
-
-    #Adding non-diagnostic variables
-    if test ! ${nondiagvs} = 'None'; then
-      varsadd=`echo ${nondiagvs} | tr ':' ' '`
-      for vadd in ${varsadd}; do
-        python ${pyHOME}/nc_var.py -o fvaradd -S ${simsfcmapf},${vadd}               \
-          -f ${simsfcmapdiagsf}
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcmapf},${vadd}"'"  \
-            -f ${simsfcmapdiagsf}
-          exit
-          rm ${simsfcmapdiagsf}
-        fi
-        echo "* adding variable '"${vadd}"' at sfc map: " >> ${ofileins}
-        echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcmapf},${vadd}"'"    \
-          -f ${simsfcmapdiagsf} >> ${ofileins}
-        echo " " >> ${ofileins}
-        # CF varname
-        CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} |           \
-          tr ':' ' ' | awk '{print $1}'`
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python $pyHOME/generic.py -o variables_values -S ${vadd}
-          exit
-          rm ${simsfcmapdiagsf}
-        fi
-        python $pyHOME/nc_var.py -o chvarname -S ${CFvarn} -f ${simsfcmapdiagsf}     \
-          -v ${vadd}
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python ${pyHOME}/nc_var.py -o chvarname -S ${CFvarn}                  \
-            -f ${simsfcmapdiagsf} -v ${vadd}
-          exit
-          rm ${simsfcmapdiagsf}
-        fi
-      done
-    fi
-  fi
-}
-
-function get_WRFCDXsfc2D_data(){
-# Function to get the data from WRFCDX to compute analysis in a surface map
-#   filen= name of the file
-#   sfcdiagnames= diagnostics to compute (as ':' separated list)
-#   nondiagvs= ':' list of variables which are not from a diagnostics ('None' for 
-#     without)
-#   sfcmapdiagd= name of the dimensions and dimension variables to use for diagnostics
-
-  funcvals=$1
-
-  filen=`echo ${funcvals} | tr '#' ' ' | awk '{print $1}'`
-  sfcdiagnames=`echo ${funcvals} | tr '#' ' ' | awk '{print $2}'`
-  nondiagvs=`echo ${funcvals} | tr '#' ' ' | awk '{print $3}'`
-  sfcmapdiagd=`echo ${funcvals} | tr '#' ' ' | awk '{print $4}'`
-
-  # Computing sfc diagnostics
-  diagns=`echo ${sfcdiagnames} | tr ':' ' '`
-
-  # getting that variables only required for the diagnostics
-  vardiags=''
-  idiag=1
-  for diagn in ${diagns}; do
-    diagv=`cat $pyHOME/diagnostics.inf | grep WRF | grep ${diagn}',' | tr ',' ' ' |  \
-      awk '{print $2"|"$3}'`
-    if test ${idiag} -eq 1; then
-      sfcdiagvals=${diagv}
-      vardiags=`echo ${diagv} | tr '|' ' ' | awk '{print $2}' | tr '@' ':'`
-    else
-      sfcdiagvals=${sfcdiagvals}','${diagv}
-      vardiag=`echo ${diagv} | tr '|' ' ' | awk '{print $2}' | tr '@' ' '`
-      for vd in ${vardiag}; do
-        if ! $(isin_list ${vardiags} ${vd}); then vardiags=${vardiags}':'${vd}; fi
-      done
-    fi
-    idiag=`expr ${idiag} + 1`
-  done
-
-  # Inlcuding non-diagnostics
-  if test ! ${nondiagvs} = 'None'; then
-    nvns=`echo ${nondiagvs} | tr ':' ' '`
-    for vn in ${nvns}; do
-      if ! $(isin_list ${vardiags} ${vn}); then vardiags=${vardiags}':'${vn}; fi
-    done
-    if ! $(isin_list ${vardiags} 'time'); then vardiags=${vardiags}':time'; fi
-  fi
-  vardiag=`echo ${vardiags} | tr ':' ','`
-  
-  # Getting values
-  if ${fscratch}; then rm ${simsfcmapf} >& /dev/null; fi
-  if test ! -f ${simsfcmapf}; then
-    values='Time,0,-1,1@south_north,0,-1,1@west_east,0,-1,1:False'
-    python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}               \
-      -S ${values} -v ${vardiag}
-    if test $? -ne 0; then
-      echo ${errmsg}
-      echo "  python failed!!"
-      echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}        \
-        -S "'"${values}"'"  -v ${vardiag}
-      exit
-    fi
-    echo "* get values for 2D map diagnostics: " >> ${ofileins}
-    echo python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}          \
-      -S "'"${values}"'" -v ${vardiag} >> ${ofileins}
-    echo " " >> ${ofileins}
-
-    ofilen='newfile_multidims.nc'
-    mv ${ofilen} ${simsfcmapf}
-  fi
-
-  if ${fscratch}; then rm ${simsfcmapdiagsf}; fi
-  if test ! -f ${simsfcmapdiagsf}; then
-    python ${pyHOME}/diagnostics.py -f ${simsfcmapf} -d ${sfcmapdiagd}               \
-      -v ${sfcdiagvals}
-    if test $? -ne 0; then
-      echo ${errmsg}
-      echo "  python failed!!"
-      echo python ${pyHOME}/diagnostics.py -f ${simsfcmapf} -d "'"${sfcmapdiagd}"'"  \
-        -v "'"${sfcdiagvals}"'"
-      exit
-    fi
-    echo "* diagnostics for sfc 2D map: " >> ${ofileins}
-    echo python ${pyHOME}/diagnostics.py -f ${simsfcmapf} -d "'"${sfcmapdiagd}"'"    \
-      -v "'"${sfcdiagvals}"'" >> ${ofileins}
-    echo " " >> ${ofileins}
-    mv diagnostics.nc ${simsfcmapdiagsf}
-
-    #Adding non-diagnostic variables
-    if test ! ${nondiagvs} = 'None'; then
-      varsadd=`echo ${nondiagvs} | tr ':' ' '`
-      for vadd in ${varsadd}; do
-        python ${pyHOME}/nc_var.py -o fvaradd -S ${simsfcmapf},${vadd}               \
-          -f ${simsfcmapdiagsf}
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcmapf},${vadd}"'"  \
-            -f ${simsfcmapdiagsf}
-          exit
-          rm ${simsfcmapdiagsf}
-        fi
-        echo "* adding variable '"${vadd}"' at sfc map: " >> ${ofileins}
-        echo python ${pyHOME}/nc_var.py -o fvaradd -S "'"${simsfcmapf},${vadd}"'"    \
-          -f ${simsfcmapdiagsf} >> ${ofileins}
-        echo " " >> ${ofileins}
-        # CF varname
-        CFvarn=`python $pyHOME/generic.py -o variables_values -S ${vadd} |           \
-          tr ':' ' ' | awk '{print $1}'`
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python $pyHOME/generic.py -o variables_values -S ${vadd}
-          exit
-          rm ${simsfcmapdiagsf}
-        fi
-        python $pyHOME/nc_var.py -o chvarname -S ${CFvarn} -f ${simsfcmapdiagsf}     \
-          -v ${vadd}
-        if test $? -ne 0; then
-          echo ${errmsg}
-          echo "  python failed!!"
-          echo python ${pyHOME}/nc_var.py -o chvarname -S ${CFvarn}                  \
-            -f ${simsfcmapdiagsf} -v ${vadd}
-          exit
-          rm ${simsfcmapdiagsf}
-        fi
-      done
-    fi
   fi
 }
@@ -1112,5 +584,5 @@
 
 ###
-## Preparing simulations
+## Preparing stations data
 ###
 
@@ -1139,61 +611,4 @@
     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}'`
-    expm=`echo ${exp} | tr ',' ' ' | awk '{print $5}'`
-
-    simfiles=`ls -1 ${simdir}/${expf}/${simH}*${simM}*${simT}`
-
-    ofile=${odir}/simout_${prn}vars_${stid}_${expl}.nc
-    if ${fscratch}; then rm ${ofile} >& /dev/null; fi
-    if test ! -f ${ofile}; then
-      for simf in ${simfiles}; do
-        simfn=`basename ${simf}`
-        fdate=`echo ${simfn} | tr '.' ' ' | awk '{print $1}' | tr '_' ' ' |          \
-          awk '{print $3"_"$4}'`
-
-        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}'#'
-        fvals=${fvals}${simdiagd}
-        get_WRFsounding_data ${fvals}
-
-      # end of files
-      done
-
-      # Concatenating files
-      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`
@@ -1230,125 +645,7 @@
   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}'`
-    expm=`echo ${exp} | tr ',' ' ' | awk '{print $5}'`
-
-    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
 if test ! ${sfcHf} = 'None'; then sfcstids=${oststids}; fi
-
-# surface data for maps
-iost=1
-obstype='surface_map'
-prn='sfc'
-listfiles=${sfcfiles}
-wrfdiags=${wrfsfcdiags}
-simdiagd=${simsfcmapdiagd}
-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}'`
-  expm=`echo ${exp} | tr ',' ' ' | awk '{print $5}'`
-
-  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}'`
-
-    simsfcmapf=${odir}'/simout_vars_'${prn}'map_'${expl}'_'${fdate}'.nc'
-    simsfcmapdiagsf=${odir}'/simout_'${prn}'mapdiags_'${expl}'_'${fdate}'.nc'
-
-    fvals=${simf}'#'${wrfdiags}'#'${wrfsfcnondiags}'#'${simdiagd}
-    get_WRFsfc2D_data ${fvals}
-
-  # end of files
-  done
-
-  # Concatenating files
-  ofile=${odir}/simout_${prn}mapvars_${expl}.nc
-  if ${fscratch}; then rm ${ofile} >& /dev/null; fi
-  if test ! -f ${ofile}; then
-    Nconfc=`ls -1 ${odir}/simout_${prn}mapdiags_*${expl}*.nc | wc -l | awk '{print $1}'`
-    if test ${Nconfc} -gt 1; then 
-      values=${odir}',Time,time'
-      HMT='simout_'${prn}'mapdiags_,'${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: " >> ${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}mapdiags_*${expl}*.nc`
-      cp ${ffilen} ${ofile}
-    fi
-  fi
-  iexp=`expr ${iexp} + 1`
-# end of experiments
-done
 
 ###
