********>bugfix.7: Author: Daniel R. Roe Date: 06/17/2008 Programs: sander Description: When running replica exchange with nmr weight restraints (nmropt>0), the bath temperature (temp0) would be reset to its initial value after every exchange, regardless of whether an exchange was successful or not. This patch forces a re-read of the temp0 value after every exchange. Affected files: src/sander/nmr.f , src/sander/remd.f Fix: Run this patch from the $AMBERHOME directory, with: $ patch -p0 -N -r patch_rejects < bugfix.7 ------------------------------------------------------------------------------ diff -Naur oldamber10/src/sander/nmr.f newamber10/src/sander/nmr.f --- src/sander/nmr.f 2008-06-17 14:43:30.000000000 -0400 +++ src/sander/nmr.f 2008-06-17 15:13:07.000000000 -0400 @@ -1818,6 +1818,12 @@ ! WEIGHT(23) : Exponential decay time constant for time-averaged plane-plane restraints ! WEIGHT(24) : The value of the LES target temperature on the first call use constants, only : one +#ifdef MPI + ! initmodwt forces modwt() to re-read values such as temp0 - + ! otherwise they will be reset to the initial value after each + ! exchange. + use remd, only : initmodwt +#endif implicit none integer jweit @@ -1896,8 +1902,12 @@ ! ICHOLD(I)=1, if weight of term was set to non-unity as of the previous call. ! ICHOLD(I)=2, if weight of term has been set to 0, or if the weight ! of the term is constant throughout the run (NSTEP1=NSTEP2=0). - + +#ifdef MPI + if (ionce /= 99.or.initmodwt) then +#else if (ionce /= 99) then +#endif ichold(1:jweit) = 0 weight(1:13) = ONE @@ -1914,6 +1924,9 @@ weight(24) = tauave(6) weight(25) = temp0les ionce = 99 +#ifdef MPI + initmodwt = .false. +#endif end if ivdw = 0 diff -Naur oldamber10/src/sander/remd.f newamber10/src/sander/remd.f --- src/sander/remd.f 2008-06-17 14:50:48.000000000 -0400 +++ src/sander/remd.f 2008-06-17 15:08:49.000000000 -0400 @@ -59,7 +59,10 @@ ! during hybrid remd. ! jumpright - if true replica that controls the exchange will attempt ! to exchange with the replica at next highest temperature. -logical, save :: jumpright, hybridwritetraj +! initmodwt - If nmropt>0 modwt will reset temp0 to its initial value +! after each exchange. initmodwt will force a re-read of +! temp0 after each exchange. +logical, save :: jumpright, hybridwritetraj, initmodwt ! ... integer variables: ! mdloop - Current exchange index. mdloop will be always 0 unless rem>0 @@ -174,6 +177,7 @@ myscaling = -1.0d0 newtargettemp = -99.0d0 jumpright = .true. + initmodwt = .true. rremd_idx=-1 ! For storing ekmh between runmd calls ! DAN ROE: ntt==1 only? @@ -413,6 +417,11 @@ ! DAN ROE: Eventually take out debug info. call remd_scale_velo(v,temp0,nr,nr3) + ! initmodwt forces modwt() in nmr.f to re-read values such as temp0 - + ! otherwise they will be reset to the initial value after each + ! exchange. + initmodwt = .true. + return end subroutine remd_exchange ------------------------------------------------------------------------------ Temporary workarounds: none