#!/bin/csh -f
#set echo
# Script to run the program zscorezi_MPI on linux with MPICH (parallel version).
#
echo "This job is running on host `hostname` "

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

set POT = GB
setenv POT GB
setenv SCRATCHDIR /tmp/`whoami`

#
# Przygotowanie i wyczyszczenie poletka 
#
if ( ! -d $SCRATCHDIR ) then
 mkdir $SCRATCHDIR
endif
rm -f $SCRATCHDIR/*

setenv PREFIX 1LE1_wham

#
# 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

# 5/17/97 parameter file assignment was changed from link to SETENV statements
#
setenv BONDPAR $DD/bond_AM1.parm
setenv THETPAR $DD/theta_abinitio.parm
setenv ROTPAR $DD/rotamers_AM1_aura.10022007.parm
setenv TORPAR $DD/torsion_631Gdp.parm
setenv TORDPAR $DD/torsion_double_631Gdp.parm
setenv ELEPAR $DD/electr_631Gdp.parm
setenv SIDEPAR $DD/scinter_${POT}.parm
setenv FOURIER $DD/fourier_opt.parm.1igd_hc_iter3_3
setenv SCPPAR $DD/scp.parm
setenv SCCORPAR $DD/rotcorr_AM1.parm
setenv PATTERN $DD/patterns.cart
# 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/wham_multparm-hamrep-sep $*
