********> bugfix.57 Correction Author: David A. Pearlman Correction Date: 04/09/93 Programs: GIBBS Severity: Moderate Problem: If 1) Thermodynamic Integration is being used to calculate free energies (IDIFRG=1); and 2) The contributions of pert-group internals to the free energy are being determined (INTPRT=3 or INTPRT=5); the contributions due to perturbed torsions will be incorrectly calculated. On many platforms, the contribution will be reported as 0.0. On other platforms (e.g. hp), the contribution will be reported as a floating overflow value (a clear indication that something is wrong!) This problem does NOT affect calculations performed using Free Energy Perturbation (FEP; the default method), nor will there be any affect if the torsional contributions in TI are not determined. Affects: Depending on how the host computer treats uninitialized variables, the reported contribution due to torsions (part of BADH) will probably be either 0.0 or an extrememly large value. Cause: A variable was incorrectly being used before it was set. The pointer into several arrays was also being incorrectly set. Fix: Make the following changes to routine PEPHI ---To routine PEPHI in file gibb.f ----------------------------------------- *** OLD gibb.f --- NEW gibb.f *************** *** 3627,3632 **** --- 3627,3633 ---- DF = CT*(CT2*(CT2*192.0-192.0)+36.0) C 60 ARG = PK(IC) + IOLDFM = 0 IF(PHASE(IC).EQ.0.0) GO TO 65 ARG = -ARG C *************** *** 3641,3646 **** --- 3642,3648 ---- SARGUM = SIN(ARGUM) DFP = -APN*SARGUM DF = -DFP/SPHI + IOLDFM = 1 WRITE(6,1530) I3,J3,K3,L3,PN(IC),PHASE(IC) C 65 E = PK(IC)+ARG*E *************** *** 3661,3669 **** C negligable, and saves us a lot of extra calculations here. C IF (IDIFRG.EQ.1 .AND. KPERT.EQ.2) THEN ! DN = ABS(PN(IPHI)) - ABS(PN(IC)) ! DPHI = PHASE(IPHI) - PHASE(IC) ! RKU = ALM(1)*PK(IPHI) + ALM(2)*PK(IC) C C Define for/rev values of K (RKU), N (RN) and PHI (RPHI) C --- 3663,3673 ---- C negligable, and saves us a lot of extra calculations here. C IF (IDIFRG.EQ.1 .AND. KPERT.EQ.2) THEN ! ICOLD = ICP(IPHI) ! DN = ABS(PN(ICOLD)) - ABS(PN(IC)) ! DPHI = PHASE(ICOLD) - PHASE(IC) ! RKU = ALM(1)*PK(ICOLD) + ALM(2)*PK(IC) ! IF (IOLDFM.EQ.0) SARGUM = SIN(ABS(PN(IC))*AP-PHASE(IC)) C C Define for/rev values of K (RKU), N (RN) and PHI (RPHI) C ------------------------------------------------------------------------------ Temporary workarounds: None. Routines affected: GIBBS Routine PEPHI in file ...amber4/src/gibbs/gibb.f