1 subroutine pdbout(etot,tytul,iunit)
2 implicit real*8 (a-h,o-z)
5 include 'COMMON.INTERACT'
7 include 'COMMON.IOUNITS'
8 include 'COMMON.HEADER'
9 include 'COMMON.SBRIDGE'
10 include 'COMMON.DISTFIT'
13 character*1 chainid(10) /'A','B','C','D','E','F','G','H','I','J'/
15 write (iunit,'(3a,1pe15.5)') 'REMARK ',tytul,' ENERGY ',etot
16 cmodel write (iunit,'(a5,i6)') 'MODEL',1
22 write (iunit,'(a5,i5,1x,a1,i1,2x,a3,i7,2x,a3,i7,i3,t76,i5)')
24 & restyp(iti),hfrag(1,j)-1,
25 & restyp(itj),hfrag(2,j)-1,1,hfrag(2,j)-hfrag(1,j)
27 write (iunit,'(a5,i5,1x,a1,i2,1x,a3,i7,2x,a3,i7,i3)')
29 & restyp(iti),hfrag(1,j)-1,
30 & restyp(itj),hfrag(2,j)-1,1,hfrag(2,j)-hfrag(1,j)
40 itj=itype(bfrag(2,j)-1)
42 write (iunit,'(a5,i5,1x,a1,i1,i3,1x,a3,i6,2x,a3,i6,i3)')
44 & restyp(iti),bfrag(1,j)-1,
45 & restyp(itj),bfrag(2,j)-2,0
47 if (bfrag(3,j).gt.bfrag(4,j)) then
50 itl=itype(bfrag(4,j)+1)
52 write (iunit,'(a5,i5,1x,a1,i1,i3,1x,a3,i6,2x,a3,i6,i3,
53 & 2x,a1,2x,a3,i6,3x,a1,2x,a3,i6)')
55 & restyp(itl),bfrag(4,j),
56 & restyp(itk),bfrag(3,j)-1,-1,
57 & "N",restyp(itk),bfrag(3,j)-1,
58 & "O",restyp(iti),bfrag(1,j)-1
63 itl=itype(bfrag(4,j)-1)
66 write (iunit,'(a5,i5,1x,a1,i1,i3,1x,a3,i6,2x,a3,i6,i3,
67 & 2x,a1,2x,a3,i6,3x,a1,2x,a3,i6)')
69 & restyp(itk),bfrag(3,j)-1,
70 & restyp(itl),bfrag(4,j)-2,1,
71 & "N",restyp(itk),bfrag(3,j)-1,
72 & "O",restyp(iti),bfrag(1,j)-1
83 write(iunit,'(a6,i4,1x,a3,i7,4x,a3,i7)')
84 & 'SSBOND',i,'CYS',ihpb(i)-1-nres,
85 & 'CYS',jhpb(i)-1-nres
97 write (iunit,'(a)') 'TER'
102 write (iunit,10) iatom,restyp(iti),chainid(ichain),
103 & ires,(c(j,i),j=1,3),vtot(i)
106 write (iunit,20) iatom,restyp(iti),chainid(ichain),
107 & ires,(c(j,nres+i),j=1,3),
112 write (iunit,'(a)') 'TER'
114 if (itype(i).eq.21) cycle
115 if (itype(i).eq.10 .and. itype(i+1).ne.21) then
116 write (iunit,30) ica(i),ica(i+1)
117 else if (itype(i).ne.10 .and. itype(i+1).ne.21) then
118 write (iunit,30) ica(i),ica(i+1),ica(i)+1
119 else if (itype(i).ne.10 .and. itype(i+1).eq.21) then
120 write (iunit,30) ica(i),ica(i)+1
123 if (itype(nct).ne.10) then
124 write (iunit,30) ica(nct),ica(nct)+1
127 write (iunit,30) ica(ihpb(i)-nres)+1,ica(jhpb(i)-nres)+1
129 write (iunit,'(a6)') 'ENDMDL'
130 10 FORMAT ('ATOM',I7,' CA ',A3,1X,A1,I4,4X,3F8.3,f15.3)
131 20 FORMAT ('ATOM',I7,' CB ',A3,1X,A1,I4,4X,3F8.3,f15.3)
132 30 FORMAT ('CONECT',8I5)
135 c------------------------------------------------------------------------------
136 subroutine MOL2out(etot,tytul)
137 C Prints the Cartesian coordinates of the alpha-carbons in the Tripos mol2
139 implicit real*8 (a-h,o-z)
141 include 'COMMON.CHAIN'
142 include 'COMMON.INTERACT'
143 include 'COMMON.NAMES'
144 include 'COMMON.IOUNITS'
145 include 'COMMON.HEADER'
146 include 'COMMON.SBRIDGE'
147 character*32 tytul,fd
149 character*6 res_num,pom,ucase
157 write (imol2,'(a)') '#'
159 & '# Creating user name: unres'
160 write (imol2,'(2a)') '# Creation time: ',
162 write (imol2,'(/a)') '\@<TRIPOS>MOLECULE'
163 write (imol2,'(a)') tytul
164 write (imol2,'(5i5)') nct-nnt+1,nct-nnt+nss+1,nct-nnt+nss+1,0,0
165 write (imol2,'(a)') 'SMALL'
166 write (imol2,'(a)') 'USER_CHARGES'
167 write (imol2,'(a)') '\@<TRIPOS>ATOM'
169 write (zahl,'(i3)') i
170 pom=ucase(restyp(itype(i)))
171 res_num = pom(:3)//zahl(2:)
172 write (imol2,10) i,(c(j,i),j=1,3),i,res_num,0.0
174 write (imol2,'(a)') '\@<TRIPOS>BOND'
176 write (imol2,'(i5,2i6,i2)') i-nnt+1,i-nnt+1,i-nnt+2,1
179 write (imol2,'(i5,2i6,i2)') nct-nnt+i,ihpb(i),jhpb(i),1
181 write (imol2,'(a)') '\@<TRIPOS>SUBSTRUCTURE'
183 write (zahl,'(i3)') i
184 pom = ucase(restyp(itype(i)))
185 res_num = pom(:3)//zahl(2:)
186 write (imol2,30) i-nnt+1,res_num,i-nnt+1,0
188 10 FORMAT (I7,' CA ',3F10.4,' C.3',I8,1X,A,F11.4,' ****')
189 30 FORMAT (I7,1x,A,I14,' RESIDUE',I13,' **** ****')
192 c------------------------------------------------------------------------
194 implicit real*8 (a-h,o-z)
196 include 'COMMON.IOUNITS'
197 include 'COMMON.CHAIN'
199 include 'COMMON.LOCAL'
200 include 'COMMON.INTERACT'
201 include 'COMMON.NAMES'
203 write (iout,'(/a)') 'Geometry of the virtual chain.'
204 write (iout,'(7a)') ' Res ',' d',' Theta',
205 & ' Phi',' Dsc',' Alpha',' Omega'
208 write (iout,'(a3,i4,6f10.3)') restyp(iti),i,vbld(i),
209 & rad2deg*theta(i),rad2deg*phi(i),vbld(nres+i),rad2deg*alph(i),
214 c---------------------------------------------------------------------------
215 subroutine briefout(it,ener)
216 implicit real*8 (a-h,o-z)
218 include 'COMMON.IOUNITS'
219 include 'COMMON.CHAIN'
221 include 'COMMON.LOCAL'
222 include 'COMMON.INTERACT'
223 include 'COMMON.NAMES'
225 include 'COMMON.SBRIDGE'
226 c print '(a,i5)',intname,igeom
227 #if defined(AIX) || defined(PGI)
228 open (igeom,file=intname,position='append')
230 open (igeom,file=intname,access='append')
233 WRITE (igeom,180) IT,ENER,NSS,(IHPB(I),JHPB(I),I=1,NSS)
235 WRITE (igeom,180) IT,ENER,NSS,(IHPB(I),JHPB(I),I=1,9)
236 WRITE (igeom,190) (IHPB(I),JHPB(I),I=10,NSS)
238 c IF (nvar.gt.nphi) WRITE (igeom,200) (RAD2DEG*THETA(I),I=3,NRES)
239 WRITE (igeom,200) (RAD2DEG*THETA(I),I=3,NRES)
240 WRITE (igeom,200) (RAD2DEG*PHI(I),I=4,NRES)
241 c if (nvar.gt.nphi+ntheta) then
242 write (igeom,200) (rad2deg*alph(i),i=2,nres-1)
243 write (igeom,200) (rad2deg*omeg(i),i=2,nres-1)
246 180 format (I5,F12.3,I2,9(1X,2I3))
247 190 format (3X,11(1X,2I3))
258 c----------------------------------------------------------------
260 subroutine cartout(time)
262 subroutine cartoutx(time)
264 implicit real*8 (a-h,o-z)
266 include 'COMMON.CHAIN'
267 include 'COMMON.INTERACT'
268 include 'COMMON.NAMES'
269 include 'COMMON.IOUNITS'
270 include 'COMMON.HEADER'
271 include 'COMMON.SBRIDGE'
272 include 'COMMON.DISTFIT'
274 double precision time
275 #if defined(AIX) || defined(PGI)
276 open(icart,file=cartname,position="append")
278 open(icart,file=cartname,access="append")
280 write (icart,'(e15.8,2e15.5,f12.5,$)') time,potE,uconst,t_bath
281 write (icart,'(i4,$)')
282 & nss,(ihpb(j),jhpb(j),j=1,nss)
283 write (icart,'(i4,20f7.4)') nfrag+npair+3*nfrag_back,
284 & (qfrag(i),i=1,nfrag),(qpair(i),i=1,npair),
285 & (utheta(i),ugamma(i),uscdiff(i),i=1,nfrag_back)
286 write (icart,'(8f10.5)')
287 & ((c(k,j),k=1,3),j=1,nres),
288 & ((c(k,j+nres),k=1,3),j=nnt,nct)
292 c-----------------------------------------------------------------
294 subroutine cartout(time)
295 implicit real*8 (a-h,o-z)
299 include 'COMMON.SETUP'
303 include 'COMMON.CHAIN'
304 include 'COMMON.INTERACT'
305 include 'COMMON.NAMES'
306 include 'COMMON.IOUNITS'
307 include 'COMMON.HEADER'
308 include 'COMMON.SBRIDGE'
309 include 'COMMON.DISTFIT'
311 double precision time
313 real xcoord(3,maxres2+2),prec
316 call xdrfopen_(ixdrf,cartname, "a", iret)
317 call xdrffloat_(ixdrf, real(time), iret)
318 call xdrffloat_(ixdrf, real(potE), iret)
319 call xdrffloat_(ixdrf, real(uconst), iret)
320 call xdrffloat_(ixdrf, real(uconst_back), iret)
321 call xdrffloat_(ixdrf, real(t_bath), iret)
322 call xdrfint_(ixdrf, nss, iret)
324 call xdrfint_(ixdrf, ihpb(j), iret)
325 call xdrfint_(ixdrf, jhpb(j), iret)
327 call xdrfint_(ixdrf, nfrag+npair+3*nfrag_back, iret)
329 call xdrffloat_(ixdrf, real(qfrag(i)), iret)
332 call xdrffloat_(ixdrf, real(qpair(i)), iret)
335 call xdrffloat_(ixdrf, real(utheta(i)), iret)
336 call xdrffloat_(ixdrf, real(ugamma(i)), iret)
337 call xdrffloat_(ixdrf, real(uscdiff(i)), iret)
340 call xdrfopen(ixdrf,cartname, "a", iret)
341 call xdrffloat(ixdrf, real(time), iret)
342 call xdrffloat(ixdrf, real(potE), iret)
343 call xdrffloat(ixdrf, real(uconst), iret)
344 call xdrffloat(ixdrf, real(uconst_back), iret)
345 call xdrffloat(ixdrf, real(t_bath), iret)
346 call xdrfint(ixdrf, nss, iret)
348 call xdrfint(ixdrf, ihpb(j), iret)
349 call xdrfint(ixdrf, jhpb(j), iret)
351 call xdrfint(ixdrf, nfrag+npair+3*nfrag_back, iret)
353 call xdrffloat(ixdrf, real(qfrag(i)), iret)
356 call xdrffloat(ixdrf, real(qpair(i)), iret)
359 call xdrffloat(ixdrf, real(utheta(i)), iret)
360 call xdrffloat(ixdrf, real(ugamma(i)), iret)
361 call xdrffloat(ixdrf, real(uscdiff(i)), iret)
372 xcoord(j,nres+i-nnt+1)=c(j,i+nres)
378 call xdrf3dfcoord_(ixdrf, xcoord, itmp, prec, iret)
379 call xdrfclose_(ixdrf, iret)
381 call xdrf3dfcoord(ixdrf, xcoord, itmp, prec, iret)
382 call xdrfclose(ixdrf, iret)
387 c-----------------------------------------------------------------
388 subroutine statout(itime)
389 implicit real*8 (a-h,o-z)
391 include 'COMMON.CONTROL'
392 include 'COMMON.CHAIN'
393 include 'COMMON.INTERACT'
394 include 'COMMON.NAMES'
395 include 'COMMON.IOUNITS'
396 include 'COMMON.HEADER'
397 include 'COMMON.SBRIDGE'
398 include 'COMMON.DISTFIT'
400 include 'COMMON.SETUP'
402 double precision energia(0:n_ene)
403 double precision gyrate
406 character*256 line1,line2
407 character*4 format1,format2
411 open(istat,file=statname,position="append")
415 open(istat,file=statname,position="append")
417 open(istat,file=statname,access="append")
421 call rms_nac_nnc(rms,frac,frac_nn,co,.false.)
422 write (line1,'(i10,f15.2,3f12.3,f7.2,4f6.3,3f12.3,i5,$)')
423 & itime,totT,EK,potE,totE,
424 & rms,frac,frac_nn,co,amax,kinetic_T,t_bath,gyrate(),me
427 write (line1,'(i10,f15.2,7f12.3,i5,$)')
428 & itime,totT,EK,potE,totE,
429 & amax,kinetic_T,t_bath,gyrate(),me
432 if(usampl.and.totT.gt.eq_time) then
433 write(line2,'(i5,2f9.4,300f7.4)') iset,uconst,uconst_back,
434 & (qfrag(ii1),ii1=1,nfrag),(qpair(ii2),ii2=1,npair),
435 & (utheta(i),ugamma(i),uscdiff(i),i=1,nfrag_back)
436 write(format2,'(a1,i3.3)') "a",23+7*nfrag+7*npair
442 if (print_compon) then
443 write(format,'(a1,a4,a1,a4,a10)') "(",format1,",",format2,
445 write (istat,format) line1,line2,
446 & (potEcomp(print_order(i)),i=1,nprint_ene)
448 write(format,'(a1,a4,a1,a4,a1)') "(",format1,",",format2,")"
449 write (istat,format) line1,line2
458 c---------------------------------------------------------------
459 double precision function gyrate()
460 implicit real*8 (a-h,o-z)
462 include 'COMMON.INTERACT'
463 include 'COMMON.CHAIN'
464 double precision cen(3),rg
476 cen(j)=cen(j)/dble(nct-nnt+1)
481 rg = rg + (c(j,i)-cen(j))**2
484 gyrate = sqrt(rg/dble(nct-nnt+1))