#!/bin/bash

cd ../tests
files=`/bin/ls */*.nw`
#echo ${files}

NPROC="64"
MPIRUN="cobalt-mpirun -np ${NPROC} -verbose 2"
NWCHEM="/gpfs/home/projects/nwchem/bin/nwchem-6.0_01august2010_QA1"
TOPDIR=`pwd`

echo "#!/bin/sh" > QA.sh
for file in ${files} ; do
    directory=${file%%/*}
    #echo "directory  = ${directory}"
    input=${file#*/}
    #echo "input file = ${input}"
    output="${input%.nw}.output"
    #echo "output file = ${output}"
    echo "cd ${TOPDIR}/${directory}" >> QA.sh
    echo "${MPIRUN} ${NWCHEM} ${input} > ${output}" >> QA.sh
done
chmod +x QA.sh








