2 implicit real*8 (a-h,o-z)
4 include 'COMMON.IOUNITS'
6 include 'COMMON.INTERACT'
9 ccccccccccccccccccccccccc
11 ccccccccccccccccccccccccc
15 ccccccccccccccccccccccccccccccccccccccccc
16 ! Groups the THETAs and the GAMMAs
30 ccccccccccccccccccccccccccccccccccccccccc
32 ! Groups the ALPHAs and the BETAs
35 if(itype(j).ne.10) then
49 write(iout,*) "# of groups: ",ntotgr
51 write(iout,41) i,ngroup(i),((igroup(k,j,i),k=1,3),j=1,ngroup(i))
56 41 format(2i3,3x,6(3i3,2x))
60 ccccccccccccccccccccccccccccccccccccccccccccccccc
61 ccccccccccccccccccccccccccccccccccccccccccccccccc
62 subroutine make_ranvar(n,m,idum)
63 implicit real*8 (a-h,o-z)
65 include 'COMMON.IOUNITS'
66 include 'COMMON.CHAIN'
70 print *,'HOHOHOHO Make_RanVar!!!!!',n,m
72 do while(m.lt.n .and. itrial.le.10000)
75 call gen_rand_conf(jeden,*10)
79 dihang_in(1,j,1,m)=theta(j+1)
80 dihang_in(2,j,1,m)=phi(j+2)
81 dihang_in(3,j,1,m)=alph(j)
82 dihang_in(4,j,1,m)=omeg(j)
84 dihang_in(2,nres-1,1,m)=0.0d0
86 10 write (iout,*) 'Failed to generate conformation #',m+1,
90 print *,'Make_RanVar!!!!! m=',m,' itrial=',itrial
94 ccccccccccccccccccccccccccccccccccccccccccccccccc
95 ccccccccccccccccccccccccccccccccccccccccccccccccc
96 subroutine make_ranvar_reg(n,idum)
97 implicit real*8 (a-h,o-z)
99 include 'COMMON.IOUNITS'
100 include 'COMMON.CHAIN'
102 include 'COMMON.BANK'
105 print *,'HOHOHOHO Make_RanVar!!!!!'
107 do while(m.lt.n .and. itrial.le.10000)
110 call gen_rand_conf(jeden,*10)
114 dihang_in(1,j,1,m)=theta(j+1)
115 dihang_in(2,j,1,m)=phi(j+2)
116 dihang_in(3,j,1,m)=alph(j)
117 dihang_in(4,j,1,m)=omeg(j)
119 dihang_in(1,j,1,m)=90.0*deg2rad
120 dihang_in(2,j,1,m)=50.0*deg2rad
123 dihang_in(2,nres-1,1,m)=0.0d0
125 10 write (iout,*) 'Failed to generate conformation #',m+1,
129 print *,'Make_RanVar!!!!! m=',m,' itrial=',itrial
133 ccccccccccccccccccccccccccccccccccccccccccccccccc
134 ccccccccccccccccccccccccccccccccccccccccccccccccc
135 subroutine from_pdb(n,idum)
136 c This subroutine stores the UNRES int variables generated from
137 c subroutine readpdb into the 1st conformation of in dihang_in.
138 c Subsequent n-1 conformations of dihang_in have identical values
139 c of theta and phi as the 1st conformation but random values for
141 c The array cref (also generated from subroutine readpdb) is stored
142 c to crefjlee to be used for rmsd calculation in CSA, if necessary.
143 implicit real*8 (a-h,o-z)
145 include 'COMMON.IOUNITS'
146 include 'COMMON.CHAIN'
148 include 'COMMON.BANK'
153 dihang_in(1,j,1,m)=theta(j+1)
154 dihang_in(2,j,1,m)=phi(j+2)
155 dihang_in(3,j,1,m)=alph(j)
156 dihang_in(4,j,1,m)=omeg(j)
158 dihang_in(2,nres-1,1,k)=0.0d0
162 dihang_in(1,k,1,m)=dihang_in(1,k,1,1)
163 dihang_in(2,k,1,m)=dihang_in(2,k,1,1)
164 if(dabs(dihang_in(3,k,1,1)).gt.1.d-6) then
165 dihang_in(3,k,1,m)=90.d0*ran1(idum)+90.d0
166 dihang_in(3,k,1,m)=dihang_in(3,k,1,m)*deg2rad
168 if(dabs(dihang_in(4,k,1,1)).gt.1.d-6) then
169 dihang_in(4,k,1,m)=360.d0*ran1(idum)-180.d0
170 dihang_in(4,k,1,m)=dihang_in(4,k,1,m)*deg2rad
175 c Store cref to crefjlee (they are in COMMON.CHAIN).
179 crefjlee(kk,k)=cref(kk,k,kkk)
183 open(icsa_native_int,file=csa_native_int,status="old")
185 write(icsa_native_int,*) m,e
186 write(icsa_native_int,200)
187 & (dihang_in(1,k,1,m)*rad2deg,k=2,nres-1)
188 write(icsa_native_int,200)
189 & (dihang_in(2,k,1,m)*rad2deg,k=2,nres-2)
190 write(icsa_native_int,200)
191 & (dihang_in(3,k,1,m)*rad2deg,k=2,nres-1)
192 write(icsa_native_int,200)
193 & (dihang_in(4,k,1,m)*rad2deg,k=2,nres-1)
197 write(icsa_native_int,200) (crefjlee(i,k),i=1,3)
199 close(icsa_native_int)
205 ccccccccccccccccccccccccccccccccccccccccccccccccc
206 ccccccccccccccccccccccccccccccccccccccccccccccccc
207 subroutine from_int(n,mm,idum)
208 implicit real*8 (a-h,o-z)
210 include 'COMMON.IOUNITS'
211 include 'COMMON.CHAIN'
213 include 'COMMON.INTERACT'
214 include 'COMMON.BANK'
216 include 'COMMON.CONTACTS'
220 double precision energia(0:n_ene)
222 open(icsa_native_int,file=csa_native_int,status="old")
223 read (icsa_native_int,*)
224 call read_angles(icsa_native_int,*10)
226 10 write (iout,'(2a)') "CHUJ NASTAPIL - error in ",
227 & csa_native_int(:ilen(csa_native_int))
231 dihang_in(1,j,1,1)=theta(j+1)
232 dihang_in(2,j,1,1)=phi(j+2)
233 dihang_in(3,j,1,1)=alph(j)
234 dihang_in(4,j,1,1)=omeg(j)
236 dihang_in(2,nres-1,1,1)=0.0d0
238 c read(icsa_native_int,*) ind,e
239 c read(icsa_native_int,200) (dihang_in(1,k,1,1),k=2,nres-1)
240 c read(icsa_native_int,200) (dihang_in(2,k,1,1),k=2,nres-2)
241 c read(icsa_native_int,200) (dihang_in(3,k,1,1),k=2,nres-1)
242 c read(icsa_native_int,200) (dihang_in(4,k,1,1),k=2,nres-1)
243 c dihang_in(2,nres-1,1,1)=0.d0
250 c dihang_in(1,k,1,m)=dihang_in(1,k,1,1)
251 c dihang_in(2,k,1,m)=dihang_in(2,k,1,1)
252 c if(abs(dihang_in(3,k,1,1)).gt.1.d-3) then
253 c dihang_in(3,k,1,m)=90.d0*ran1(idum)+90.d0
255 c if(abs(dihang_in(4,k,1,1)).gt.1.d-3) then
256 c dihang_in(4,k,1,m)=360.d0*ran1(idum)-180.d0
264 DO WHILE (FAIL .AND. ICOUNT_FAIL .LE. MAXCOUNT_FAIL)
267 if (itype(i).ne.10) then
268 cd print *,'i=',i,' itype=',itype(i),' theta=',theta(i+1)
271 do while (fail .and. ii .le. maxsi)
272 call gen_side(itype(i),theta(i+1),alph(i),omeg(i),fail)
278 call etotal(energia(0))
279 fail = (energia(0).ge.1.0d20)
280 icount_fail=icount_fail+1
284 if (icount_fail.gt.maxcount_fail) then
286 & 'Failed to generate non-overlaping near-native conf.',
291 dihang_in(1,j,1,m)=theta(j+1)
292 dihang_in(2,j,1,m)=phi(j+2)
293 dihang_in(3,j,1,m)=alph(j)
294 dihang_in(4,j,1,m)=omeg(j)
296 dihang_in(2,nres-1,1,m)=0.0d0
300 c write(icsa_native_int,*) m,e
301 c write(icsa_native_int,200) (dihang_in(1,k,1,m),k=2,nres-1)
302 c write(icsa_native_int,200) (dihang_in(2,k,1,m),k=2,nres-2)
303 c write(icsa_native_int,200) (dihang_in(3,k,1,m),k=2,nres-1)
304 c write(icsa_native_int,200) (dihang_in(4,k,1,m),k=2,nres-1)
306 c close(icsa_native_int)
311 c dihang_in(i,j,1,m)=dihang_in(i,j,1,m)*deg2rad
316 call dihang_to_c(dihang_in(1,1,1,1))
318 c Store c to cref (they are in COMMON.CHAIN).
321 crefjlee(kk,k)=c(kk,k)
325 call contact(.true.,ncont_ref,icont_ref,co)
328 c write(icsa_native_int,200) (crefjlee(i,k),i=1,3)
330 close(icsa_native_int)
336 ccccccccccccccccccccccccccccccccccccccccccccccccc
337 ccccccccccccccccccccccccccccccccccccccccccccccccc
338 subroutine dihang_to_c(aarray)
339 implicit real*8 (a-h,o-z)
342 include 'COMMON.BANK'
343 include 'COMMON.CHAIN'
347 dimension aarray(mxang,maxres,mxch)
350 c phi(i)=dihang_in(1,i-2,1,1)
353 theta(i+1)=aarray(1,i,1)
354 phi(i+2)=aarray(2,i,1)
355 alph(i)=aarray(3,i,1)
356 omeg(i)=aarray(4,i,1)
363 ccccccccccccccccccccccccccccccccccccccccccccccccc
364 ccccccccccccccccccccccccccccccccccccccccccccccccc