#!/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 \
             -xpsf ala_ala_ala.psf.xplor -cmap\
             -crd ala_ala_ala.pdb \
             -p prmtopx \
             -inpcrd inpcrdx  >& chamber.outx || goto error

   ../../dacdif chamber.outx.save chamber.outx
   ../../dacdif -r 10E-15 prmtopx.save prmtopx
   ../../dacdif inpcrdx.save inpcrdx

   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)

