### Runs replica exchange with gREM (fix grem) for unlimited number of replicas on a set number of processors. This script is inefficient, but necessary if wanting to run with hundreds of replicas on relatively few number of procs.
### read number of processors from the command line
nproc=int(sys.argv[1])
### path to simulation directory
path=os.getcwd()
### path to LAMMPS executable
lmp=sys.argv[2]
### LAMMPS input name
inp=sys.argv[3]
### define pressure for simulations (0 if const V)
pressure=0
### some constants for gREM, must match with LAMMPS input file!
H=-30000
eta=-0.01
#kB = 0.000086173324 # eV (metal)
kB=0.0019872# kcal/mol (real)
### define lambdas - script assumes that there are already existing directories with all files necessary to run
print"exchange1 not accepted for pair",first,second,lambdas[first],lambdas[second],"with compares as",compare1,compare2,"weight as",weight,"and lograndnum",LOGRANDNUM
### choose again pair of replicas for exchange attempt based on enthalpy order
### but make sure this pair is different than the first pair
print"exchange2 not accepted for pair",third,fourth,lambdas[third],lambdas[fourth],"with compares as",compare1,compare2,"weight as",weight,"and lograndnum",LOGRANDNUM