2 ! implicit real*8 (a-h,o-z)
4 ! include 'COMMON.CHAIN'
5 ! include 'COMMON.INTERACT'
6 ! include 'COMMON.SBRIDGE'
7 use geometry_data, only: nres,c,nfrag
8 use energy_data, only: itype,nnt,nct,nss,ihpb,jhpb,uconst_back
9 use io_base!, only: maxres,ucase,iblnk,rescode,pdbout
12 real(kind=4),allocatable,dimension(:,:) :: coord !(3,2*maxres)
13 real(kind=4) :: prec,time,potE,uconst,t_bath,qfrag(100)
15 character(len=80) :: arg,seqfile,pdbfileX
16 character(len=3),allocatable,dimension(:) :: sequenc !(maxres)
17 character(len=50) :: tytul
18 character(len=8) :: onethree,cfreq,cntraj,citraj
19 character(len=3) :: licz
21 logical oneletter !,iblnk
24 integer :: i,ii,j,k,kk,is,ie,ifreq,mnum,molec,iext,isize
25 integer :: iret,ixdrf,itraj,ntraj
31 allocate(sequenc(maxres))
32 allocate(itype(maxres,5))
33 if (iargc().lt.5) then
35 "Usage: xdrf2pdb-m one/three seqfile cxfile ntraj itraj",&
39 call getarg(1,onethree)
40 onethree = ucase(onethree)
41 if (onethree.eq.'ONE') then
43 else if (onethree.eq.'THREE') then
46 print *,"ONE or THREE must be specified"
48 call getarg(2,seqfile)
49 open (1,file=seqfile,status='old')
51 read(1,'(80a1)',end=10,err=10) (sequenc(i)(1:1),i=1,maxres)
55 do while (.not.iblnk(sequenc(i+1)(1:1)))
60 itype(i,mnum)=rescode(i,sequenc(i),1,molec)
63 read(1,'(20(a3,1x))',end=11,err=11) (sequenc(i),i=1,maxres)
67 do while (.not.iblnk(sequenc(i+1)(1:1)))
72 itype(i,mnum)=rescode(i,sequenc(i),0,molec)
75 print '(20(a3,1x))',(sequenc(i),i=1,nres)
78 iext = index(arg,'.cx') - 1
80 print *,"Error - not a cx file"
87 if (iargc().gt.5) then
88 call getarg(6,pdbfileX)
90 write(licz,'(bz,i3.3)') itraj
91 pdbfileX=arg(:iext)//'_'//licz//'.pdb'
93 if (iargc().gt.6) then
97 ! print *,"ifreq",ifreq," ntraj",ntraj," itraj",itraj
100 if (itype(1,mnum).eq.ntyp1) nnt = 2
102 if (itype(nres,mnum).eq.ntyp1) nct = nres-1
103 print *,"nnt",nnt," nct",nct
104 call xdrfopen(ixdrf,arg, "r", iret)
106 allocate(coord(3,2*nres))
107 allocate(c(3,2*nres))
109 call xdrffloat(ixdrf, time, iret)
112 call xdrffloat(ixdrf, potE, iret)
113 call xdrffloat(ixdrf, uconst, iret)
115 call xdrffloat(ixdrf, uconst_back, iret)
117 call xdrffloat(ixdrf, t_bath, iret)
118 call xdrfint(ixdrf, nss, iret)
120 call xdrfint(ixdrf, ihpb(j), iret)
121 call xdrfint(ixdrf, jhpb(j), iret)
123 call xdrfint(ixdrf, nfrag, iret)
125 call xdrffloat(ixdrf, qfrag(i), iret)
130 call xdrf3dfcoord(ixdrf, coord, isize, prec, iret)
133 ! write (*,'(e15.8,2e15.5,f12.5,$)') time,potE,uconst,t_bath
134 ! write (*,'(i4,$)') nss,(ihpb(j),jhpb(j),j=1,nss)
135 ! write (*,'(i4,20f7.4)') nfrag,(qfrag(i),i=1,nfrag)
136 ! write (*,'(8f10.5)') ((coord(k,j),k=1,3),j=1,isize)
137 if (mod(kk/ntraj,ifreq).eq.0 .and. mod(kk,ntraj).eq.itraj) then
138 if (isize .ne. nres+nct-nnt+1) then
139 print *,"Error: inconsistent sizes",isize,nres+nct-nnt+1
150 c(j,i+nres)=coord(j,ii+nres)
154 write (tytul,'(a,i6)') "Structure",kk
155 call pdbout(etot,tytul,9)