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.IOUNITS'
13 dimension x(3),e(3,3),e1(3),e2(3),e3(3),rot(3,3),trans(3,3)
16 if (print_mc.gt.2) then
17 write (iout,*) 'nstart=',nstart,' nend=',nend,' nbond=',nbond
18 write (iout,*) 'psi=',psi
19 write (iout,'(a)') 'Original coordinates of the fragment'
21 write (iout,'(i5,3f10.5)') i,(c(j,i),j=1,3)
24 if (nstart.lt.1 .or. nend .gt.nres .or. nbond.lt.2 .or.
25 & nbond.ge.nres-1) then
26 write (iout,'(a)') 'Bad data in BOND_MOVE.'
30 C Generate the reference system.
34 call refsys(i2,i3,i4,e1,e2,e3,error)
35 C Return, if couldn't define the reference system.
37 C Compute the transformation matrix.
55 if (print_mc.gt.2) then
56 write (iout,'(a)') 'Reference system and matrix r:'
58 write(iout,'(i5,2(3f10.5,5x))')i,(e(i,j),j=1,3),(rot(i,j),j=1,3)
62 call matmult(rot,e,trans)
70 call matmult(e,trans,trans)
73 write (iout,'(a)') 'The trans matrix:'
75 write (iout,'(i5,3f10.5)') i,(trans(i,j),j=1,3)
83 rij=rij+trans(j,k)*(c(k,i)-c(k,nstart))
93 write (iout,'(a)') 'Rotated coordinates of the fragment'
95 write (iout,'(i5,3f10.5)') i,(c(j,i),j=1,3)
99 c call int_from_cart(.false.,lprint)
100 if (nstart.gt.1) then
101 theta(nstart+1)=alpha(nstart-1,nstart,nstart+1)
102 phi(nstart+2)=beta(nstart-1,nstart,nstart+1,nstart+2)
103 if (nstart.gt.2) phi(nstart+1)=
104 & beta(nstart-2,nstart-1,nstart,nstart+1)
106 if (nend.lt.nres) then
107 theta(nend+1)=alpha(nend-1,nend,nend+1)
108 phi(nend+1)=beta(nend-2,nend-1,nend,nend+1)
109 if (nend.lt.nres-1) phi(nend+2)=
110 & beta(nend-1,nend,nend+1,nend+2)
112 if (print_mc.gt.2) then
113 write (iout,'(/a,i3,a,i3,a/)')
114 & 'Moved internal coordinates of the ',nstart,'-',nend,
116 do i=nstart+1,nstart+2
117 write (iout,'(i5,2f10.5)') i,rad2deg*theta(i),rad2deg*phi(i)
120 write (iout,'(i5,2f10.5)') i,rad2deg*theta(i),rad2deg*phi(i)