********> bugfix.18 Author: Bill Ross Date: 5/28/95 Programs: prep, parm Severity: moderate Affects: Generation of new residues using prep/link/edit/parm. Problem: Prep and parm allow improper torsion terms in parm.dat to be in reverse order, but this order causes problems for leap, which depends on the 3rd atom being the central one: J | K / \ I L Improper I-J-K-L This fix prevents the introduction of wrong-order impropers (for leap) in parm.dat files when using prep/link/edit/parm. As a result, one improper torsion in parm94.dat must be reversed. Solution: Prep was reordering improper dihedrals such that the number of the 1st atom would always be less than the 4th atom. This reordering is deleted. As a result, the improper groups are not correctly sorted for 1-4 generation; however, since they are not bonded dihedrals and so are not germane to 1-4 generation anyway, a line of code is added to skip impropers when building the 1-4s. This change to prep preserves the order of the atoms specified in the IMPROPER section of the residue definition in prep.in. Parm is changed to not try reversed order impropers if the canonical order fails. Fix: Make the following change to parm94.dat ------------------------------------------------------------------------------ 440c440 < CT-CM-CM-C 1.1 180. 2. dac guess, 9/94 --- > C -CM-CM-CT 1.1 180. 2. dac guess, 9/94 ------------------------------------------------------------------------------ Make the following change to prep.f _** and after 'make install': 'cd amber41/dat ; rm db4.dat db94.dat ; make' **_ ------------------------------------------------------------------------------ *** OLD prep.f --- NEW prep.f *************** *** 1701,1719 COMMON/IOFILE/IN,IN2,IN3,IN4,IOUT,IOUTB,IOUTC,IFDATP C NPHII = NPHI - C - C ----- IMPROPER TORSION ANGLES ----- - C - IF(NPHI.EQ.0) GO TO 1 - DO 2 I = 1,NPHI - IF(IP(I).LT.LP(I)) GO TO 2 - LINT = LP(I) - KINT = KP(I) - LP(I) = IP(I) - KP(I) = JP(I) - JP(I) = KINT - IP(I) = LINT - 2 CONTINUE 1 DO 37 I = 1,NBOND I1 = IB(I) J1 = JB(I) --- 1701,1706 ----- COMMON/IOFILE/IN,IN2,IN3,IN4,IOUT,IOUTB,IOUTC,IFDATP C NPHII = NPHI 1 DO 37 I = 1,NBOND I1 = IB(I) J1 = JB(I) *************** *** 1972,1977 IPRE = -999 IF(NPHI.EQ.0) GO TO 11 DO 70 J = 1,NPHI IF(I.LT.IPP(J)) GO TO 11 IF(I.NE.IPP(J)) GO TO 70 IF(LPP(J).EQ.IPRE) GO TO 70 --- 1959,1969 ----- IPRE = -999 IF(NPHI.EQ.0) GO TO 11 DO 70 J = 1,NPHI + c + c --- don't consider impropers --- + c + if (lpp(j).lt.0) goto 70 + c IF(I.LT.IPP(J)) GO TO 11 IF(I.NE.IPP(J)) GO TO 70 IF(LPP(J).EQ.IPRE) GO TO 70 ------------------------------------------------------------------------------ Make the following change to parm/pointp.f ------------------------------------------------------------------------------ *** OLD pointp.f --- NEW pointp.f *************** *** 101,111 KT1 = IGRAPH(KP1) LT1 = IGRAPH(LP1) DO 8 K = 1,NUMPHN ! CALL FNDDIH(IS1,JS1,KS1,LS1,IIPT(K),JJPT(K),KKPT(K),LLPT(K), ! + MATCH) ! IF(MATCH.EQ.0) ! + CALL FNDDIH(IS1,JS1,KS1,LS1,LLPT(K),KKPT(K),JJPT(K),IIPT(K), ! + MATCH) C C ----- USE first MATCH FOR DIHEDRAL ----- C --- 101,114 ----- KT1 = IGRAPH(KP1) LT1 = IGRAPH(LP1) DO 8 K = 1,NUMPHN ! IF(KM.EQ.-1.OR.LM.EQ.-1) then ! c -- order was reversed above ! CALL FNDDIH(LS1,KS1,JS1,IS1, ! + IIPT(K),JJPT(K),KKPT(K),LLPT(K),MATCH) ! else ! CALL FNDDIH(IS1,JS1,KS1,LS1, ! + IIPT(K),JJPT(K),KKPT(K),LLPT(K),MATCH) ! endif C C ----- USE first MATCH FOR DIHEDRAL ----- C *************** *** 118,124 IF(MTEMP.NE.0) then ICP(I) = IPNTR(MTEMP) else ! WRITE(IOUT,95) IS1,JS1,KS1,LS1,IP1,JP1,KP1,LP1 IF(LN.LT.0) WRITE(IOUT,76) NOGO = NOGO+1 endif --- 121,132 ----- IF(MTEMP.NE.0) then ICP(I) = IPNTR(MTEMP) else ! if (KM.EQ.-1.OR.LM.EQ.-1) then ! c -- order was reversed above ! WRITE(IOUT,95) LS1,KS1,JS1,IS1,LP1,KP1,JP1,IP1 ! else ! WRITE(IOUT,95) IS1,JS1,KS1,LS1,IP1,JP1,KP1,LP1 ! endif IF(LN.LT.0) WRITE(IOUT,76) NOGO = NOGO+1 endif ------------------------------------------------------------------------------ Temporary workarounds: Make sure all impropers added to parm.dat or frcmod files conform to the 'central atom 3rd' rule. --