#!/bin/csh -f
#set echo
# Script to run the program zscorezi_MPI on linux with MPICH (parallel version).
#
if ("$3" != "-p4amslave") then
cd $4
endif

echo "This job is running on host `hostname` "
if ($#argv<2) then
  echo "You must supply potential type and input/output filename prefix."
  exit (1)
endif

set DD = /users/adam/UNRES/PARAM
set BIN = /users/adam/ZSCOREZ/bin

set BIN = /users/adam/ZSCOREZ/bin
setenv INPUT 2hep_300K_clust
setenv INTIN 2hep_wham_last
setenv OUTPUT 2hep_300K_clust
setenv PDB CART
setenv COORD CX
setenv PRINTCOOR PRINT_PDB
setenv POT GB
setenv SCRATCHDIR /tmp

#
# Is the specified potential in the list of valid force fields?
#
if (($POT != "LJ") && ($POT != "LJK") && ($POT != "BP") && ($POT != "GB") \
&& ($POT != "GBV") ) then
  echo "Unknown potential type $POT"
  exit(1)
endif

# Check for the existence of the input file

#if (!(-e $2.inp)) then
#  echo "Error: The input file $2.inp does not exist."
#  exit(1)
#endif

# 5/17/97 parameter file assignment was changed from link to SETENV statements
#
setenv BONDPAR $DD/bond.parm 
setenv THETPAR $DD/thetaml.5parm
setenv ROTPAR $DD/scgauss.parm
setenv TORPAR $DD/torsion_631Gdp.parm
setenv TORDPAR $DD/torsion_double_631Gdp.parm
setenv ELEPAR $DD/electr_631Gdp.parm
setenv SIDEPAR ${DD}/sc_GB_opt.1gab_3S_qclass5no310-shan2-sc-16-10-8k
setenv FOURIER $DD/fourier_opt.parm.1igd_hc_iter3_3
setenv SCPPAR $DD/scp.parm
setenv SCCORPAR $DD/rotcorr_AM1.parm

# Define contact function for classification
setenv CONTFUNC GB
if (${CONTFUNC} == "GB") then
  setenv SIDEP ${DD}/contact.3.parm
else if (${CONTFUNC} == "SCDIST") then
  setenv SIDEP ${DD}/cend.3.45.parm
else if (${CONTFUNC} == "CEN") then
  setenv SIDEP ${DD}/cen.parm
else if (${CONTFUNC} == "ODC") then
  setenv SIDEP ${DD}/odc.parm
else if (${CONTFUNC} != "SIG") then
  echo "Unknown sidechain contact function ${CONTFUNC}"
  exit
endif

# Set parallel environment, depending on job type (interactive or batch).

set DEBUG = 0

limit coredumpsize 0
#$BIN/unres_clustMD_MPI-new $*
$BIN/unres_clustMD_MPI-oldparm $*

ls -l /tmp/*
