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'
14 write (iunit,'(3a,1pe15.5)') 'REMARK ',tytul,' ENERGY ',etot
15 cmodel write (iunit,'(a5,i6)') 'MODEL',1
21 write (iunit,'(a5,i5,1x,a1,i1,2x,a3,i7,2x,a3,i7,i3,t76,i5)')
23 & restyp(iti),hfrag(1,j)-1,
24 & restyp(itj),hfrag(2,j)-1,1,hfrag(2,j)-hfrag(1,j)
26 write (iunit,'(a5,i5,1x,a1,i2,1x,a3,i7,2x,a3,i7,i3)')
28 & restyp(iti),hfrag(1,j)-1,
29 & restyp(itj),hfrag(2,j)-1,1,hfrag(2,j)-hfrag(1,j)
39 itj=itype(bfrag(2,j)-1)
41 write (iunit,'(a5,i5,1x,a1,i1,i3,1x,a3,i6,2x,a3,i6,i3)')
43 & restyp(iti),bfrag(1,j)-1,
44 & restyp(itj),bfrag(2,j)-2,0
46 if (bfrag(3,j).gt.bfrag(4,j)) then
49 itl=itype(bfrag(4,j)+1)
51 write (iunit,'(a5,i5,1x,a1,i1,i3,1x,a3,i6,2x,a3,i6,i3,
52 & 2x,a1,2x,a3,i6,3x,a1,2x,a3,i6)')
54 & restyp(itl),bfrag(4,j),
55 & restyp(itk),bfrag(3,j)-1,-1,
56 & "N",restyp(itk),bfrag(3,j)-1,
57 & "O",restyp(iti),bfrag(1,j)-1
62 itl=itype(bfrag(4,j)-1)
65 write (iunit,'(a5,i5,1x,a1,i1,i3,1x,a3,i6,2x,a3,i6,i3,
66 & 2x,a1,2x,a3,i6,3x,a1,2x,a3,i6)')
68 & restyp(itk),bfrag(3,j)-1,
69 & restyp(itl),bfrag(4,j)-2,1,
70 & "N",restyp(itk),bfrag(3,j)-1,
71 & "O",restyp(iti),bfrag(1,j)-1
82 write(iunit,'(a6,i4,1x,a3,i7,4x,a3,i7)')
83 & 'SSBOND',i,'CYS',ihpb(i)-1-nres,
84 & 'CYS',jhpb(i)-1-nres
94 write (iunit,10) iatom,restyp(iti),ires,(c(j,i),j=1,3)
97 write (iunit,20) iatom,restyp(iti),ires,(c(j,nres+i),j=1,3)
100 write (iunit,'(a)') 'TER'
102 if (itype(i).eq.10) then
103 write (iunit,30) ica(i),ica(i+1)
105 write (iunit,30) ica(i),ica(i+1),ica(i)+1
108 if (itype(nct).ne.10) then
109 write (iunit,30) ica(nct),ica(nct)+1
112 write (iunit,30) ica(ihpb(i)-nres)+1,ica(jhpb(i)-nres)+1
114 write (iunit,'(a6)') 'ENDMDL'
115 10 FORMAT ('ATOM',I7,' CA ',A3,I6,4X,3F8.3,f15.3)
116 20 FORMAT ('ATOM',I7,' CB ',A3,I6,4X,3F8.3,f15.3)
117 30 FORMAT ('CONECT',8I5)
120 c------------------------------------------------------------------------------
121 subroutine MOL2out(etot,tytul)
122 C Prints the Cartesian coordinates of the alpha-carbons in the Tripos mol2
124 implicit real*8 (a-h,o-z)
126 include 'COMMON.CHAIN'
127 include 'COMMON.INTERACT'
128 include 'COMMON.NAMES'
129 include 'COMMON.IOUNITS'
130 include 'COMMON.HEADER'
131 include 'COMMON.SBRIDGE'
132 character*32 tytul,fd
134 character*6 res_num,pom,ucase
142 write (imol2,'(a)') '#'
144 & '# Creating user name: unres'
145 write (imol2,'(2a)') '# Creation time: ',
147 write (imol2,'(/a)') '\@<TRIPOS>MOLECULE'
148 write (imol2,'(a)') tytul
149 write (imol2,'(5i5)') nct-nnt+1,nct-nnt+nss+1,nct-nnt+nss+1,0,0
150 write (imol2,'(a)') 'SMALL'
151 write (imol2,'(a)') 'USER_CHARGES'
152 write (imol2,'(a)') '\@<TRIPOS>ATOM'
154 write (zahl,'(i3)') i
155 pom=ucase(restyp(itype(i)))
156 res_num = pom(:3)//zahl(2:)
157 write (imol2,10) i,(c(j,i),j=1,3),i,res_num,0.0
159 write (imol2,'(a)') '\@<TRIPOS>BOND'
161 write (imol2,'(i5,2i6,i2)') i-nnt+1,i-nnt+1,i-nnt+2,1
164 write (imol2,'(i5,2i6,i2)') nct-nnt+i,ihpb(i),jhpb(i),1
166 write (imol2,'(a)') '\@<TRIPOS>SUBSTRUCTURE'
168 write (zahl,'(i3)') i
169 pom = ucase(restyp(itype(i)))
170 res_num = pom(:3)//zahl(2:)
171 write (imol2,30) i-nnt+1,res_num,i-nnt+1,0
173 10 FORMAT (I7,' CA ',3F10.4,' C.3',I8,1X,A,F11.4,' ****')
174 30 FORMAT (I7,1x,A,I14,' RESIDUE',I13,' **** ****')
177 c------------------------------------------------------------------------
179 implicit real*8 (a-h,o-z)
181 include 'COMMON.IOUNITS'
182 include 'COMMON.CHAIN'
184 include 'COMMON.LOCAL'
185 include 'COMMON.INTERACT'
186 include 'COMMON.NAMES'
188 write (iout,'(/a)') 'Geometry of the virtual chain.'
189 write (iout,'(7a)') ' Res ',' d',' Theta',
190 & ' Gamma',' Dsc',' Alpha',' Beta '
193 write (iout,'(a3,i4,6f10.3)') restyp(iti),i,vbld(i),
194 & rad2deg*theta(i),rad2deg*phi(i),vbld(nres+i),rad2deg*alph(i),
199 c---------------------------------------------------------------------------
200 subroutine briefout(it,ener)
201 implicit real*8 (a-h,o-z)
203 include 'COMMON.IOUNITS'
204 include 'COMMON.CHAIN'
206 include 'COMMON.LOCAL'
207 include 'COMMON.INTERACT'
208 include 'COMMON.NAMES'
210 include 'COMMON.SBRIDGE'
211 c print '(a,i5)',intname,igeom
212 #if defined(AIX) || defined(PGI)
213 open (igeom,file=intname,position='append')
215 open (igeom,file=intname,access='append')
218 WRITE (igeom,180) IT,ENER,NSS,(IHPB(I),JHPB(I),I=1,NSS)
220 WRITE (igeom,180) IT,ENER,NSS,(IHPB(I),JHPB(I),I=1,9)
221 WRITE (igeom,190) (IHPB(I),JHPB(I),I=10,NSS)
223 c IF (nvar.gt.nphi) WRITE (igeom,200) (RAD2DEG*THETA(I),I=3,NRES)
224 WRITE (igeom,200) (RAD2DEG*THETA(I),I=3,NRES)
225 WRITE (igeom,200) (RAD2DEG*PHI(I),I=4,NRES)
226 c if (nvar.gt.nphi+ntheta) then
227 write (igeom,200) (rad2deg*alph(i),i=2,nres-1)
228 write (igeom,200) (rad2deg*omeg(i),i=2,nres-1)
231 180 format (I5,F12.3,I2,9(1X,2I3))
232 190 format (3X,11(1X,2I3))
243 c----------------------------------------------------------------
245 subroutine cartout(time)
247 subroutine cartoutx(time)
249 implicit real*8 (a-h,o-z)
251 include 'COMMON.CHAIN'
252 include 'COMMON.INTERACT'
253 include 'COMMON.NAMES'
254 include 'COMMON.IOUNITS'
255 include 'COMMON.HEADER'
256 include 'COMMON.SBRIDGE'
257 include 'COMMON.DISTFIT'
259 double precision time
260 #if defined(AIX) || defined(PGI)
261 open(icart,file=cartname,position="append")
263 open(icart,file=cartname,access="append")
265 write (icart,'(e15.8,2e15.5,f12.5,$)') time,potE,uconst,t_bath
266 write (icart,'(i4,$)')
267 & nss,(ihpb(j),jhpb(j),j=1,nss)
268 write (icart,'(i4,20f7.4)') nfrag+npair+3*nfrag_back,
269 & (qfrag(i),i=1,nfrag),(qpair(i),i=1,npair),
270 & (utheta(i),ugamma(i),uscdiff(i),i=1,nfrag_back)
271 write (icart,'(8f10.5)')
272 & ((c(k,j),k=1,3),j=1,nres),
273 & ((c(k,j+nres),k=1,3),j=nnt,nct)
277 c-----------------------------------------------------------------
279 subroutine cartout(time)
280 implicit real*8 (a-h,o-z)
284 include 'COMMON.SETUP'
288 include 'COMMON.CHAIN'
289 include 'COMMON.INTERACT'
290 include 'COMMON.NAMES'
291 include 'COMMON.IOUNITS'
292 include 'COMMON.HEADER'
293 include 'COMMON.SBRIDGE'
294 include 'COMMON.DISTFIT'
296 double precision time
298 real xcoord(3,maxres2+2),prec
301 call xdrfopen_(ixdrf,cartname, "a", iret)
302 call xdrffloat_(ixdrf, real(time), iret)
303 call xdrffloat_(ixdrf, real(potE), iret)
304 call xdrffloat_(ixdrf, real(uconst), iret)
305 call xdrffloat_(ixdrf, real(uconst_back), iret)
306 call xdrffloat_(ixdrf, real(t_bath), iret)
307 call xdrfint_(ixdrf, nss, iret)
309 call xdrfint_(ixdrf, ihpb(j), iret)
310 call xdrfint_(ixdrf, jhpb(j), iret)
312 call xdrfint_(ixdrf, nfrag+npair+3*nfrag_back, iret)
314 call xdrffloat_(ixdrf, real(qfrag(i)), iret)
317 call xdrffloat_(ixdrf, real(qpair(i)), iret)
320 call xdrffloat_(ixdrf, real(utheta(i)), iret)
321 call xdrffloat_(ixdrf, real(ugamma(i)), iret)
322 call xdrffloat_(ixdrf, real(uscdiff(i)), iret)
325 call xdrfopen(ixdrf,cartname, "a", iret)
326 call xdrffloat(ixdrf, real(time), iret)
327 call xdrffloat(ixdrf, real(potE), iret)
328 call xdrffloat(ixdrf, real(uconst), iret)
329 call xdrffloat(ixdrf, real(uconst_back), iret)
330 call xdrffloat(ixdrf, real(t_bath), iret)
331 call xdrfint(ixdrf, nss, iret)
333 call xdrfint(ixdrf, ihpb(j), iret)
334 call xdrfint(ixdrf, jhpb(j), iret)
336 call xdrfint(ixdrf, nfrag+npair+3*nfrag_back, iret)
338 call xdrffloat(ixdrf, real(qfrag(i)), iret)
341 call xdrffloat(ixdrf, real(qpair(i)), iret)
344 call xdrffloat(ixdrf, real(utheta(i)), iret)
345 call xdrffloat(ixdrf, real(ugamma(i)), iret)
346 call xdrffloat(ixdrf, real(uscdiff(i)), iret)
357 xcoord(j,nres+i-nnt+1)=c(j,i+nres)
363 call xdrf3dfcoord_(ixdrf, xcoord, itmp, prec, iret)
364 call xdrfclose_(ixdrf, iret)
366 call xdrf3dfcoord(ixdrf, xcoord, itmp, prec, iret)
367 call xdrfclose(ixdrf, iret)
372 c-----------------------------------------------------------------
373 subroutine statout(ifile,energia)
374 implicit real*8 (a-h,o-z)
376 include 'COMMON.CONTROL'
377 include 'COMMON.CHAIN'
378 include 'COMMON.INTERACT'
379 include 'COMMON.NAMES'
380 include 'COMMON.IOUNITS'
381 include 'COMMON.HEADER'
382 include 'COMMON.SBRIDGE'
383 include 'COMMON.DISTFIT'
385 include 'COMMON.REMD'
386 include 'COMMON.SETUP'
387 include 'COMMON.ECOMPON'
389 double precision energia(0:n_ene)
390 double precision gyrate
393 character*256 line1,line2
394 character*4 format1,format2
399 open(istat,file=statname,position="append")
403 open(istat,file=statname,position="append")
405 open(istat,file=statname,access="append")
408 write (istat,'("BEGIN DECOY ",a)')
409 & pdbname(ifile)(:ilen(pdbname(ifile)))
412 call rms_nac_nnc(rms,frac,frac_nn,co,.false.)
413 write (istat,'("total UNRES energy",1pe15.6," rmsd ",0pf12.3,
414 & " frac.nat. ",f12.3," frac.nnat. ",f12.3," rad.gyr",f7.2)')
415 & energia(0),rms,frac,frac_nn,gyrate()
417 write (istat,'("total UNRES energy ",e15.5)') energia(0)
419 write(istat,'(a10,1pe15.6)')
420 & (ename(print_order(i)),energia(print_order(i)),i=1,nprint_ene)
421 write (istat,'("EVDW components")')
422 write (istat,'(5x,20(12x,a3))') (restyp(i),i=1,ntyp)
424 write (istat,'(a3,2x,20(1pe15.6))') restyp(i),
425 & (vdwcompon(i,j),j=1,ntyp)
427 write (istat,'("ETOR components")')
428 write (istat,'(5x,20(12x,a3))') (restyp(i),i=1,ntyp)
430 write (istat,'(a3,2x,20(1pe15.6))') restyp(i),
431 & (torcompon(i,j),j=1,ntyp)
433 write (istat,'("ESCCOR components")')
434 write (istat,'(5x,20(12x,a3))') (restyp(i),i=1,ntyp)
436 write (istat,'(a3,2x,20(1pe15.6))') restyp(i),
437 & (sccorcompon(i,j),j=1,ntyp)
439 write (istat,'("EVDW2 components")')
441 write (istat,'(a3,2x,1pe15.6)') restyp(i),vdw2compon(i)
443 write (istat,'("EBE components")')
445 write (istat,'(a3,2x,1pe15.6)') restyp(i),becompon(i)
447 write (istat,'("ESCLOC components")')
449 write (istat,'(a3,2x,1pe15.6)') restyp(i),sccompon(i)
451 write (istat,'("ETORD components")')
453 write (istat,'(a3,2x,1pe15.6)') restyp(i),tordcompon(i)
456 c write (istat,'("total UNRES energy ",e15.5)') energia(0)
458 write(istat,'(1pe15.6,$)') energia(print_order(i))
462 write(istat,'(1pe15.6,$)') vdwcompon(i,j)
467 write (istat,'(1pe15.6,$)') torcompon(i,j)
472 write(istat,'(1pe15.6,$)') sccorcompon(i,j)
476 write (istat,'(1pe15.6,$)') vdw2compon(i)
479 write (istat,'(1pe15.6,$)') becompon(i)
482 write (istat,'(1pe15.6,$)') sccompon(i)
485 write (istat,'(1pe15.6,$)') tordcompon(i)
489 write (istat,'(2a)') "END DECOY ",
490 & pdbname(ifile)(:ilen(pdbname(ifile)))
498 c---------------------------------------------------------------
499 double precision function gyrate()
500 implicit real*8 (a-h,o-z)
502 include 'COMMON.INTERACT'
503 include 'COMMON.CHAIN'
504 double precision cen(3),rg
516 cen(j)=cen(j)/dble(nct-nnt+1)
521 rg = rg + (c(j,i)-cen(j))**2
524 gyrate = sqrt(rg/dble(nct-nnt+1))