PROGRAM RDENT C Create dictionary entries for Restrain from PDB file. IMPLICIT NONE INTEGER MAT,MBO REAL DM PARAMETER (MAT=100,MBO=250,DM=2.625**2) CHARACTER A(MAT)*4,P*9,R*54 LOGICAL E INTEGER I,J,K,L,M(MBO),N REAL B(MBO),D,X(3,MAT) C CALL CCPFYP CALL CCPRCS(6,'RDENT','\$Date: 1997/10/10 10:56:19 \$') I=0 WRITE(6,'(/,A,/)') ' Reading coordinate file: ' CALL CCPDPN(1,'XYZIN','READONLY','F',0,I) WRITE(6,'(/,A,/)') ' Writing dictionary file: ' CALL CCPDPN(2,'DICT','NEW','F',0,I) C E=.FALSE. N=0 P=' ' 10 READ(1,'(A)',END=20) R IF (R(:6).NE.'ATOM') GOTO 10 IF (R(18:26).EQ.P) GOTO 70 GOTO 30 20 E=.TRUE. 30 IF (N.GT.0) THEN C WRITE (6,'(/1X,A)') P(:3) C WRITE (6,'(1X,I4,2X,A,3F8.3)') (J,A(J),(X(I,J),I=1,3),J=1,N) WRITE(2,'(/,A,2X,A)') 'RESI',P(:3) DO 60 J=1,N L=0 DO 50 K=J+1,N D=0. DO 40 I=1,3 40 D=D+(X(I,J)-X(I,K))**2 IF (D.LE.DM) THEN IF (L.EQ.MBO) CALL CCPERR(1,'TOO MANY BONDS') L=L+1 M(L)=K-J B(L)=SQRT(D) ENDIF 50 CONTINUE 60 WRITE (2,100) A(J),(M(I),B(I),I=1,L) 100 FORMAT('DIST ''',A,'''',20(5(I3,F6.3,' 0'):' -'/12X)) N=0 ENDIF P=R(18:26) C 70 IF (.NOT.E) THEN IF (N.EQ.MAT) CALL CCPERR(1,'*** TOO MANY ATOMS IN RESIDUE') N=N+1 READ (R,'(12X,A,14X,3F8.3)') A(N),(X(I,N),I=1,3) GOTO 10 ENDIF CALL CCPERR(0,'Normal termination') END