********> bugfix.72 Author: Bill Ross Date: 4/23/96 Programs: Prep Severity: Slight Problem: Use of '-M' in IMPROPER specification is restricted to the 1st 2 atoms; bad 1-4 nonbond energies result from use for 4th atom, and 3rd atom is inappropriate. This fix adds a trap for this form of input error. Also, the manual does not explain use of -M and +M. Explanation updated in web version of manual as follows: -- 'IMPROPER' Control for reading the improper torsion angles. A proper torsion I - J - K - L has I bonded to J bonded to K bonded to L. An IMPROPER torsion is any torsion in which this is not the case. Improper torsions are used to keep the asymmetric centers from racemizing in the united atom model where all the C-H hydrogens are omitted. They can also be used to enforce planarity. The normal case is: J | K / \ I L Improper I-J-K-L where the central atom (K) is the third atom in the improper and the order of the other three is determined alphabetically by atom type and if types are the same by atom number. The improper torsions should be defined in such a way that the proper torsions are not duplicated. The atoms making the improper torsions are read as their atom (IGRAPH) names. '-M' can be used in place of an atom name to indicate the last main chain atom in the previous residue, and '+M' for the first main chain atom in the next residue. NOTE: -M cannot be used in the 3rd or 4th positions ('K' and 'L') owing to internal data representation limitations. A BLANK CARD terminates this section. -- Temporary workarounds: None - this fix only catches the error in prep. Fix: Make the following change to prep.f: --------------------------------------------------------------------------- *** OLD prep.f --- NEW prep.f *************** *** 767,772 CALL FINDN(NATOM,MNB(J),INUM2,IGRAPH) CALL FINDN(NATOM,MNC(J),INUM3,IGRAPH) CALL FINDN(NATOM,MND(J),INUM4,IGRAPH) IF(INUM1.EQ.-99.OR.INUM2.EQ.-99.OR.INUM3.EQ.-99.OR. + INUM4.EQ.-99) then WRITE(IOUT,9108) MNA(J),MNB(J),MNC(J),MND(J) --- 767,784 ----- CALL FINDN(NATOM,MNB(J),INUM2,IGRAPH) CALL FINDN(NATOM,MNC(J),INUM3,IGRAPH) CALL FINDN(NATOM,MND(J),INUM4,IGRAPH) + if (INUM3.eq.-1) then + write(iout, '(1x,a,a)') + + ' Error: -M cannot be used in 3rd position', + + ' for impropers' + call mexit(iout, 1) + endif + if (INUM4.eq.-1) then + write(iout, '(1x,a,a)') + + ' Error: -M cannot be used in 4th position', + + ' for impropers' + call mexit(iout, 1) + endif IF(INUM1.EQ.-99.OR.INUM2.EQ.-99.OR.INUM3.EQ.-99.OR. + INUM4.EQ.-99) then WRITE(IOUT,9108) MNA(J),MNB(J),MNC(J),MND(J) --------------------------------------------------------------------------- --