********> bugfix.75 Correction Author: David A. Pearlman Correction Date: 08/13/96 Programs: Gibbs Severity: Moderate Problem: If one attempts to run a simulation using dual cutoffs (CUT2ND > CUT), and at the same time requests that free energy components or derivatives be calculated (IPERAT 0), the components/derivatives will be incorrect. The net free energies reported in the standard output file will still be *correct*. This bug does not occur if either free energy components are not requested, or else if CUT2ND is not > CUT. Affects: The free energy components/derivatives reported to the file "PATNRG" may be incorrect. Cause: The non-bonded routine is called twice when the pairlist is updated (the additional call is necessary to calculate the energies and forces for pairs between CUT2ND and CUT). The free energy component arrays should be cleared before each call, but were only being cleared before the first call. Fix: Make the following changes to routine FORCE in gibb.f ------------------------------------------------------------------------------ *** OLD gibb.f --- NEW gibb.f *************** *** 1632,1637 WRITE(6,449) NPAIR,NHB,NPPER,ESECND 449 FORMAT(/, '2ndary cut: total=',I8,' hbpair=',I8, * ' pert=',I8,' energy=',F10.2) END IF C C Regular pairlist: --- 1632,1646 ----- WRITE(6,449) NPAIR,NHB,NPPER,ESECND 449 FORMAT(/, '2ndary cut: total=',I8,' hbpair=',I8, * ' pert=',I8,' energy=',F10.2) + C + C Clear EATIN1, EATEL1, EATNB1 arrays again after first NNBOND + C call when we're doing 2 calls for CUT2ND + C + IF (IPERAT.GT.0) THEN + IF (ICMPDR.EQ.0) CALL ZEROUT(2*NATOM,XX(LP01)) + CALL ZEROUT(2*NATOM,XX(LP02)) + CALL ZEROUT(2*NATOM,XX(LP03)) + END IF END IF C C Regular pairlist: ------------------------------------------------------------------------------ Temporary workarounds: None, if you wish to use both CUT2ND > CUT and IPERAT > 0. Routines affected: GIBBS Routine FORCE in file amber41/src/gibbs/gibb.f --