#!/bin/csh -f

#Tests chamber to ensure it gives the correct output and creates the expected files

#1) Test Chamber
/bin/rm -f *.prmtop *.inpcrd *.out *.restrt

# Test for the presence of the 'chamber' program

if ( -x $AMBERHOME/bin/chamber ) then
   #CHARMM CRD FILE
   $AMBERHOME/bin/chamber \
             -top $AMBERHOME/dat/chamber/top_all22_prot.inp \
             -param $AMBERHOME/dat/chamber/par_all22_prot.inp \
             -psf ala_ala_ala.psf -cmap\
             -crd ala_ala_ala.pdb \
             -p prmtop \
             -inpcrd inpcrd >& chamber.out || goto error

   ../../dacdif chamber.out.save chamber.out
   ../../dacdif -r 10E-15 prmtop.save prmtop
   ../../dacdif inpcrd.save inpcrd

   exit(0)

else
   echo "Could not find the 'chamber' program. "
   echo "It may happen if you do not compile the serial"
   echo "version of amber."
   echo "=============================================================="
   exit(0)
endif   
error:
echo "  ${0}:  Program error"
exit (1)

