#!/bin/csh
#
#  C-shell script to execute GAMESS/VB2000 test jobs, one job after the
#  next. Each output is put in its own separate log file in the gamess
#  root. Invoke this by typing './runallvb &'.
#
#  This script should be run from the vb2000 directory, one below $GMSPATH,
#  to run exam-vb*.inp files from the vb2000/tests directory.
#
#  The installer should modify only the following three lines:
#       Note that SCR and USERSCR must be set to the same values
#       which you are using in your ../rungms script.
#
set VERNO=01
set SCR=/scr/$USER
set USERSCR=/u1/$USER/scr
#
echo cleaning up any pre-existing VB2000 output files...
rm -f ./exam-vb*.log
rm -f $USERSCR/exam-vb*
# Create results directory
if (! -d test_results) mkdir test_results
#
foreach NUM ( 01 02 03 04 05 06 07 08 09 10 \
              11 12 13 14 15 16 17 18 19 20 \
              21 22 23 24 25 26 27 28 29 30 \
              31 32 33 34 35 36 37 38 39 40 \
              41 42 43)
  echo running VB2000 test number $NUM...
#           Note 16 and 17 are restart tests:
#      16 restarts from test 03 and 17 restarts from 16.
  set GO=true
  if ($NUM == 16) then
    if (-e $USERSCR/exam-vb03.V84) then
      cp $USERSCR/exam-vb03.V84 $SCR
    else
      echo "$USERSCR/exam-vb03.V84 not found, unable to run test $NUM"
      set GO=false
    endif
  endif
  if ($NUM == 17) then 
    if (-e $USERSCR/exam-vb16.V84) then 
      cp $USERSCR/exam-vb16.V84 $SCR
    else
      echo "$USERSCR/exam-vb16.V84 not found, unable to run test $NUM"
      set GO=false
    endif
  endif
  if ($GO == true) then
     ../rungms tests/exam-vb$NUM $VERNO 1 >& test_results/exam-vb$NUM.log
  endif
end
