1 subroutine distfit(debug,maxit)
2 implicit real*8 (a-h,o-z)
6 include 'COMMON.IOUNITS'
7 include 'COMMON.DISTFIT'
8 DIMENSION X(MAXRES),DIAGH(MAXRES),phiold(maxres)
11 cinput------------------------------------
13 c NY=((NRES-4)*(NRES-5))/2
14 cinput------------------------------------
20 CALL TRANSFER(NRES,phi,phiold)
24 cd WRITE (IOUT,*) 'DISTFIT: F0=',F0
40 CALL TRANSFER(NX,XX,X)
41 CALL BANACH(NX,MAXRES,H,X,sing)
46 IF (AIN.LT.0.1*TOL .AND. RL.LT.1.0E-4) THEN
48 WRITE (IOUT,*) 'DISTFIT: CONVERGENCE HAS BEEN ACHIEVED'
49 WRITE (IOUT,*) 'IT=',it,'F=',F0
54 phi(I)=phiold(I)+mask(i)*X(I-3)
59 cd WRITE (IOUT,*) 'IMAR=',IMAR,' RL=',RL,' F1=',F1
61 CALL TRANSFER(NRES,phi,phiold)
64 ELSE IF (DABS(F1-F0).LT.1.0E-5) THEN
66 WRITE (IOUT,*) 'DISTFIT: CANNOT IMPROVE DISTANCE FIT'
67 WRITE (IOUT,*) 'IT=',it,'F=',F1
73 WRITE (IOUT,*) 'DISTFIT: MARQUARDT PROCEDURE HAS FAILED'
74 WRITE (IOUT,*) 'IT=',it,'F=',F0
75 CALL TRANSFER(NRES,phiold,phi)
78 cd write (iout,*) "it",it," imar",imar," f0",f0
80 WRITE (IOUT,*) 'DISTFIT: FINAL F=',F0,'after MAXIT=',maxit
84 double precision FUNCTION RDIF()
85 implicit real*8 (a-h,o-z)
87 include 'COMMON.CHAIN'
88 include 'COMMON.DISTFIT'
98 if (w(ind).ne.0.0) then
100 suma=suma+w(ind)*(DIJ-d0(ind))*(DIJ-d0(ind))
102 c print '(2i3,i4,4f12.2)',i,j,ind,dij,d0(ind),w(ind),suma
112 implicit real*8 (a-h,o-z)
114 include 'COMMON.CHAIN'
115 include 'COMMON.DISTFIT'
117 DIMENSION E12(3),R13(3),R24(3),PRODU(3)
130 R13(K)=C(K,J)-C(K,I1)
134 R24(L)=C(L,K)-C(L,I2)
136 IND=((J-1)*(2*NRES-J-6))/2+K-3
137 PRODU(1)=R13(2)*R24(3)-R13(3)*R24(2)
138 PRODU(2)=R13(3)*R24(1)-R13(1)*R24(3)
139 PRODU(3)=R13(1)*R24(2)-R13(2)*R24(1)
140 DRDG(IND,I)=SCALAR(E12,PRODU)/DIST(J,K)
148 implicit real*8 (a-h,o-z)
150 include 'COMMON.CHAIN'
151 include 'COMMON.DISTFIT'
159 XI=XI+BKIWK*(D0(K)-DD(K))
167 HIJ=HIJ+DRDG(K,I)*DRDG(K,J)*w(K)
177 SUBROUTINE VEC(I,J,U)
179 * Find the unit vector from atom (I) to atom (J). Store in U.
181 implicit real*8 (a-h,o-z)
183 include 'COMMON.CHAIN'
199 SUBROUTINE TRANSFER(N,X1,X2)
200 implicit real*8 (a-h,o-z)
202 DIMENSION X1(N),X2(N)