C C $Id: boxstep.F,v 1.6 1998/07/16 16:39:26 jjv5 Exp arjan $ C C------------------------------------------------------------------------ subroutine boxstep(ok) C C acceptance / rejection criteria after boxmove C*****NOTE: this version assumes that every molecule is a residue! C implicit double precision (a-h,o-z) #include "divcon.dim" #include "divcon.h" logical ok CCC------------------------------------------------------CCC ok = .false. C calculate deltaH = deltaE + P*deltaV - N*beta^(-1)*ln(Vnew/Vold) C note that N (=number of molecules) is assumed to be nres. pterm = press*boxvol - (dble(nres)*log(boxvol))/boltzt enth = etot + pterm delta = (enth-enthmc)*boltzt ntry = ntry + 1 if (delta .lt. 75.) then if (delta .le. 0.0) then C accept, because etot < etotmc C calculate the new grid ok = .true. elseif (exp(-delta) .gt. xrandom(iseed)) then C accept, MC ok = .true. endif endif end