********> bugfix.62 Correction Author: Yax Sun and David A. Pearlman Correction Date: 03/30/94 Programs: GIBBS Severity: Moderate Problem: The number of degrees of freedom calculated for a system with all the following conditions would be 3 too large: 1) center of mass motion being removed (NTCM=1 or NSCM>0) 2) no periodic boundaries used (NTB=0) 3) (If NTT=2 or NTT=5) ISOLVP = 0. Affects: The effective temperature of the system would be off. The percentage by which the temperature would be off is given by approximately 3/actual-number-of-degrees-of-freedom. For all but the smallest systems, this will probably be insignificant. Cause: In effecting a previous bugfix to handle degrees of freedom for the special case of one atom solute systems, a construct was inadvertently introduced which would force this case to be applied to many systems. Fix: Make the following changes to routine MDREAD in Gibbs ---Gibbs: To routine MDREAD in file giba.f ----------------------------- *** OLD giba.f --- NEW giba.f *************** *** 1158,1187 **** END IF C c ------------------------------------ - c set/reset dependent vars - c ------------------------------------ - c - nsolut = 1 - if (ntt.eq.2 .or. ntt.eq.5) then - if (nspstr.gt.0) nsolut = nspstr - if (isolvp.gt.0) nsolut = isolvp - endif - if ((ntcm.eq.1 .or. nscm.gt.0) .and. ntb.eq.0) then - ndfmin = 6 - if (nsolut.eq.1) ndfmin = 3 - if (nsolut.eq.2) ndfmin = 5 - else - ndfmin = 0 - endif - if(ibelly .eq. 1) then - c --- No COM Motion Removal, ever. --- - ntcm = 0 - nscm = 9999999 - ndfmin = 0 - endif - - C - c ------------------------------------ c check range on input vars c ------------------------------------ c --- 1158,1163 ---- *************** *** 1252,1261 **** write(6,'(/2x,a,i3,a)') 'NTCM (',ntcm,') must be 0 or 1.' inerr = 1 endif - if (nsolut.eq.0 .and. ndfmin.ne.0) then - write(6,'(/2x,a)') 'NTCM or NSCM set but no solute atoms' - inerr = 1 - endif if (isvat.lt.0 .or. isvat.gt.3) then write(6,'(/2x,a,i3,a)') 'ISVAT (',isvat,') must be in 0..3.' inerr = 1 --- 1228,1233 ---- *************** *** 1426,1431 **** --- 1398,1430 ---- NSM = 0 NRAM = 0 C + c ------------------------------------ + c set/reset dependent vars + c ------------------------------------ + c + nsolut = nrp + if (ntt.eq.2 .or. ntt.eq.5) then + if (nspstr.gt.0) nsolut = nspstr + if (isolvp.gt.0) nsolut = isolvp + endif + if ((ntcm.eq.1 .or. nscm.gt.0) .and. ntb.eq.0) then + ndfmin = 6 + if (nsolut.eq.1) ndfmin = 3 + if (nsolut.eq.2) ndfmin = 5 + else + ndfmin = 0 + endif + if(ibelly .eq. 1) then + c --- No COM Motion Removal, ever. --- + ntcm = 0 + nscm = 9999999 + ndfmin = 0 + endif + if (nsolut.eq.0 .and. ndfmin.ne.0) then + write(6,'(/2x,a)') 'NTCM or NSCM set but no solute atoms' + call mexit(6,1) + endif + C C Hardwire some variables that refer to stupid or incorrectly implemented C options: C ------------------------------------------------------------------------------ Temporary workarounds: None. Routines affected: GIBBS Routine MDREAD in file ...amber4/src/gibbs/mdread.f --