********> bugfix.66 Correction Author: David A. Pearlman Correction Date: 09/19/94 Programs: Gibbs Severity: minor Problem: When running a free energy simulation with ICORC = 1 (constraint contributions included), it is possible that an attempt would be made to write several undefined variables to the restart file. Although these variables are not important (and not used) in any case where they might be undefined, on some computers the undefined variables would be set to large values, which would in turn result an overflow of the corresponding fields in the restart file (e.g. "stars"). A subsequent attempt to read the restart file for a restart run (IREST=1) might then fail. The undefined variables would appear in the second and third lines following the "CONSTRAINTS" flag in the restart file, as in this example: CONSTRAINTS 1 0 0 0 0 0 0 1 0 ******************************************************************************* *********************************************************************** 2306.74 -2306.74 -1.36445 1.36445 0.000000E+00 Affects: An attempt to read the restart file as the "coordinate" file in a subsequent restart run (IREST=1) might fail with an error about improper format information in the restart file. Note that in NO CASE would the energies reported (or trajectories calculated) by the program be incorrect. Also note that on some computers, the uninitialized variables would get set to values that fall within range of the format used to write them out, and no problem would be noticed by the user. Cause: A small bug in the routine that writes the values would allow the possibility of writing the values before they were defined. Fix: Make the following changes to routine CCPRT in gibbs ---gibbs: Module connrg.f ----------------------------- *** OLD connrg.f --- NEW connrg.f *************** *** 2722,2728 **** DATA LASTCL/0/ SAVE LASTCL C ! IF (IONCE.NE.10 .AND. INDEX.LE.1) THEN IONCE = 10 ICALLS = 0 NSTEP0 = 0 --- 2722,2728 ---- DATA LASTCL/0/ SAVE LASTCL C ! IF (IONCE.NE.10) THEN IONCE = 10 ICALLS = 0 NSTEP0 = 0 ------------------------------------------------------------------------------ Temporary workarounds: If you encounter this problem. You may simply remove the "CONSTRAINTS" flag line, and the (precisely) _six_ lines following it from the restart file. A subsequent restart run using this file will report the following message, which you can safely ignore: "WARNING: Constraint information could not be found in restart file" Routines affected: GIBBS file ...amber4/src/gibbs/connrg.f --