1 subroutine bond_move(nbond,nstart,psi,lprint,error)
2 C Move NBOND fragment starting from the CA(nstart) by angle PSI.
3 implicit real*8 (a-h,o-z)
7 logical fail,error,lprint
11 include 'COMMON.REFSYS'
12 include 'COMMON.IOUNITS'
14 dimension x(3),e(3,3),rot(3,3),trans(3,3)
17 if (print_mc.gt.2) then
18 write (iout,*) 'nstart=',nstart,' nend=',nend,' nbond=',nbond
19 write (iout,*) 'psi=',psi
20 write (iout,'(a)') 'Original coordinates of the fragment'
22 write (iout,'(i5,3f10.5)') i,(c(j,i),j=1,3)
25 if (nstart.lt.1 .or. nend .gt.nres .or. nbond.lt.2 .or.
26 & nbond.ge.nres-1) then
27 write (iout,'(a)') 'Bad data in BOND_MOVE.'
31 C Generate the reference system.
36 C Return, if couldn't define the reference system.
38 C Compute the transformation matrix.
56 if (print_mc.gt.2) then
57 write (iout,'(a)') 'Reference system and matrix r:'
59 write(iout,'(i5,2(3f10.5,5x))')i,(e(i,j),j=1,3),(rot(i,j),j=1,3)
63 call matmult(rot,e,trans)
71 call matmult(e,trans,trans)
74 write (iout,'(a)') 'The trans matrix:'
76 write (iout,'(i5,3f10.5)') i,(trans(i,j),j=1,3)
84 rij=rij+trans(j,k)*(c(k,i)-c(k,nstart))
94 write (iout,'(a)') 'Rotated coordinates of the fragment'
96 write (iout,'(i5,3f10.5)') i,(c(j,i),j=1,3)
100 c call int_from_cart(.false.,lprint)
101 if (nstart.gt.1) then
102 theta(nstart+1)=alpha(nstart-1,nstart,nstart+1)
103 phi(nstart+2)=beta(nstart-1,nstart,nstart+1,nstart+2)
104 if (nstart.gt.2) phi(nstart+1)=
105 & beta(nstart-2,nstart-1,nstart,nstart+1)
107 if (nend.lt.nres) then
108 theta(nend+1)=alpha(nend-1,nend,nend+1)
109 phi(nend+1)=beta(nend-2,nend-1,nend,nend+1)
110 if (nend.lt.nres-1) phi(nend+2)=
111 & beta(nend-1,nend,nend+1,nend+2)
113 if (print_mc.gt.2) then
114 write (iout,'(/a,i3,a,i3,a/)')
115 & 'Moved internal coordinates of the ',nstart,'-',nend,
117 do i=nstart+1,nstart+2
118 write (iout,'(i5,2f10.5)') i,rad2deg*theta(i),rad2deg*phi(i)
121 write (iout,'(i5,2f10.5)') i,rad2deg*theta(i),rad2deg*phi(i)