1 subroutine int_from_cart(lside,lprn)
10 include 'COMMON.INTERACT'
11 include 'COMMON.IOUNITS'
13 include 'COMMON.NAMES'
14 include 'COMMON.CONTROL'
15 include 'COMMON.SETUP'
16 double precision dist,alpha,beta
17 character*3 seq,atom,res
19 double precision sccor(3,50)
23 double precision di,cosfac2,sinfac2,cosfac,sinfac
25 if(me.eq.king.or..not.out1file)then
29 & 'Internal coordinates calculated from crystal structure.'
31 write (iout,'(8a)') ' Res ',' dvb',' Theta',
32 & ' Phi',' Dsc_id',' Dsc',' Alpha',
35 write (iout,'(4a)') ' Res ',' dvb',' Theta',
44 if (iti.ne.ntyp1 .and. itype(i+1).ne.ntyp1 .and.
45 & (dist(i,i+1).lt.2.0D0 .or. dist(i,i+1).gt.5.0D0)) then
46 write (iout,'(a,i4)') 'Bad Cartesians for residue',i
50 vbld_inv(i+1)=1.0d0/vbld(i+1)
51 c write (iout,*) "i",i+1," vbld",vbld(i+1)," vbld_inv",
53 if (i.gt.1) theta(i+1)=alpha(i-1,i,i+1)
54 if (i.gt.2) phi(i+1)=beta(i-2,i-1,i,i+1)
57 c if (itype(1).eq.21) then
58 c theta(3)=90.0d0*deg2rad
59 c phi(4)=180.0d0*deg2rad
61 c vbld_inv(2)=1.0d0/vbld(2)
63 c if (itype(nres).eq.21) then
64 c theta(nres)=90.0d0*deg2rad
65 c phi(nres)=180.0d0*deg2rad
67 c vbld_inv(nres)=1.0d0/vbld(2)
74 c(j,maxres2)=0.5D0*(2*c(j,i)+(c(j,i-1)-c(j,i))*vbld_inv(i)
75 & +(c(j,i+1)-c(j,i))*vbld_inv(i+1))
80 if (itype(i).ne.10) then
81 vbld_inv(i+nres)=1.0d0/di
83 vbld_inv(i+nres)=0.0d0
86 alph(i)=alpha(nres+i,i,maxres2)
87 omeg(i)=beta(nres+i,i,maxres2,i+1)
89 if(me.eq.king.or..not.out1file)then
91 & write (iout,'(a3,i4,7f10.3)') restyp(iti),i,vbld(i),
92 & rad2deg*theta(i),rad2deg*phi(i),dsc(iti),vbld(nres+i),
93 & rad2deg*alph(i),rad2deg*omeg(i)
99 write (iout,'(a3,i4,7f10.3)') restyp(iti),i,vbld(i),
100 & rad2deg*theta(i),rad2deg*phi(i),dsc(iti),vbld(nres+i),
101 & rad2deg*alph(i),rad2deg*omeg(i)
106 if(me.eq.king.or..not.out1file)
107 & write (iout,'(a3,i4,7f10.3)') restyp(iti),i,dist(i,i-1),
108 & rad2deg*theta(i),rad2deg*phi(i)
113 c-------------------------------------------------------------------------------
114 subroutine sc_loc_geom(lprn)
120 include 'COMMON.LOCAL'
122 include 'COMMON.CHAIN'
123 include 'COMMON.INTERACT'
124 include 'COMMON.IOUNITS'
126 include 'COMMON.NAMES'
127 include 'COMMON.CONTROL'
128 include 'COMMON.SETUP'
129 double precision x_prime(3),y_prime(3),z_prime(3)
132 double precision xx,yy,zz,cosfac,cosfac2,sinfac,sinfac2
135 dc_norm(j,i)=vbld_inv(i+1)*(c(j,i+1)-c(j,i))
137 c write (iout,*) "i",i," dc",(dc_norm(j,i),j=1,3),
138 c & " vbld",vbld_inv(i+1)
141 if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then
143 dc_norm(j,i+nres)=vbld_inv(i+nres)*(c(j,i+nres)-c(j,i))
145 c write (iout,*) "i",i," dc",(dc_norm(j,i+nres),j=1,3),
146 c & " vbld",vbld_inv(i+nres)
149 dc_norm(j,i+nres)=0.0d0
154 costtab(i+1) =dcos(theta(i+1))
155 sinttab(i+1) =dsqrt(1-costtab(i+1)*costtab(i+1))
156 cost2tab(i+1)=dsqrt(0.5d0*(1.0d0+costtab(i+1)))
157 sint2tab(i+1)=dsqrt(0.5d0*(1.0d0-costtab(i+1)))
158 cosfac2=0.5d0/(1.0d0+costtab(i+1))
159 cosfac=dsqrt(cosfac2)
160 sinfac2=0.5d0/(1.0d0-costtab(i+1))
161 sinfac=dsqrt(sinfac2)
163 c write (iout,*) "i",i," costab",costtab(i+1),
164 c & " sintab",sinttab(i+1)
165 c write (iout,*) "dc_norm_b",(dc_norm(j,i-1),j=1,3)
166 c write (iout,*) "dc_norm_s",(dc_norm(j,i+nres),j=1,3)
167 if (it.ne.10 .and. itype(i).ne.ntyp1) then
169 C Compute the axes of tghe local cartesian coordinates system; store in
170 c x_prime, y_prime and z_prime
178 x_prime(j) = (dc_norm(j,i) - dc_norm(j,i-1))*cosfac
179 y_prime(j) = (dc_norm(j,i) + dc_norm(j,i-1))*sinfac
181 c write (iout,*) "x_prime",(x_prime(j),j=1,3)
182 c write (iout,*) "y_prime",(y_prime(j),j=1,3)
183 call vecpr(x_prime,y_prime,z_prime)
184 c write (iout,*) "z_prime",(z_prime(j),j=1,3)
186 C Transform the unit vector of the ith side-chain centroid, dC_norm(*,i),
187 C to local coordinate system. Store in xx, yy, zz.
193 xx = xx + x_prime(j)*dc_norm(j,i+nres)
194 yy = yy + y_prime(j)*dc_norm(j,i+nres)
195 zz = zz + z_prime(j)*dc_norm(j,i+nres)
209 if (me.eq.king.or..not.out1file) then
211 write (iout,*) "xxref,yyref,zzref"
213 write (iout,'(a3,i4,3f10.5)')
214 & restyp(itype(i)),i,xxref(i),yyref(i),zzref(i)
222 c---------------------------------------------------------------------------
223 subroutine sccenter(ires,nscat,sccor)
226 include 'COMMON.CHAIN'
227 integer i,j,ires,nscat
228 double precision sccor(3,50)
229 double precision sccmj
230 write (2,*) "sccenter",ires,nscat
235 sccmj=sccmj+sccor(j,i)
237 dc(j,ires)=sccmj/nscat
241 c---------------------------------------------------------------------------
242 subroutine bond_regular
246 include 'COMMON.LOCAL'
247 include 'COMMON.INTERACT'
248 include 'COMMON.CHAIN'
253 vbld(i+1+nres)=dsc(iabs(itype(i+1)))
254 vbld_inv(i+1+nres)=dsc_inv(iabs(itype(i+1)))
255 c print *,vbld(i+1),vbld(i+1+nres)
257 c Adam 2/26/20 Alter virtual bonds for non-blocking end groups of each chain
263 vbld_inv(i1)=vbld_inv(i1)*2
266 vbld(i2+1)=vbld(i2+1)/2
267 vbld_inv(i2+1)=vbld_inv(i2+1)*2