#!/bin/csh

# gmauger Jun 2013 

echo ; date +"%Y%m%d.%T starting..." ; echo

cd /home/disk/picea/mauger/WUS_CSC/DATA/VIC_config/params/rio_16d

#echo "VEG file check: " ; echo
awk '(NF==2){print $1;}' veg_param.0625.rio.20130508 > ! vtst
#foreach cellnum ( `cat vtst` )
#  grep $cellnum soil_param.0625.rio.20130604.vpd >! jnk 
#  set NR = `wc jnk | awk '{print $1;}'`
#  \rm jnk
#  if ( $NR != 1 ) then
#    echo "NO match in soil file for gridcell number: $cellnum"
#  endif
#end

echo "SOIL file check: " ; echo
awk '{print $2;}' soil_param.0625.rio.20130604.vpd > stst
foreach cellnum ( `cat stst` )
  grep $cellnum vtst >! jnk
  set NR = `wc jnk | awk '{print $1;}'`
  \rm jnk
  if ( $NR != 1 ) then
    echo "NO match in veg file for gridcell number: $cellnum"
  endif
end

\rm stst vtst

echo ; date +"%Y%m%d.%T DONE."


