#!/bin/sh -x
#
#echo DEBUG: in sp_getpot

	printenv QC > /dev/null
	status=$?
	if [ $status -ne 0 ]
	then
	    echo "DEBUG: QCHEM not correctly installed"
	    run_stat=100
	fi

        tmp_dir=${USER}_$$
	mkdir $QCSCRATCH/${tmp_dir}
	#??qchemDriver is now inside of qc_start (i.e. progman.exe)
	#$SPAR_SUBMIT/qchemDriver -o input.qpot input.pot archive $QCSCRATCH/${tmp_dir}
#echo DEBUG: ls tmp_dir
#ls -lat $QCSCRATCH/${tmp_dir}
	
	if [ -e QC.FChk ] 
	then
	    rm QC.FChk
	fi

	#SP_ST_ABIN $QC/bin/qchem   input.qpot graphic.output ${tmp_dir}
        $SP_ST_ABIN $QC/exe/qc_start input.pot graphic.output ${tmp_dir}
	run_stat=$?

#echo DEBUG: leaving sp_getpot
#
exit $run_stat
#