1 implicit real*8 (a-h,o-z)
4 include 'COMMON.INTERACT'
5 include 'COMMON.SBRIDGE'
6 include 'COMMON.DISTFIT'
7 real*4 coord(3,2*maxres)
8 real*4 prec,time,potE,uconst,t_bath,qfrag(100)
10 character*80 arg,seqfile,pdbfile
11 character*3 sequenc(maxres)
13 character*8 onethree,cfreq
21 double precision cm(3)
26 if (iargc().lt.3) then
28 & "Usage: xdrf2pdb one/three seqfile cxfile [freq]",
29 & " [start] [end] [pdbfile]"
32 call getarg(1,onethree)
33 onethree = ucase(onethree)
34 if (onethree.eq.'ONE') then
36 else if (onethree.eq.'THREE') then
39 print *,"ONE or THREE must be specified"
41 call getarg(2,seqfile)
42 open (1,file=seqfile,status='old')
44 read(1,'(80a1)',end=10,err=10) (sequenc(i)(1:1),i=1,maxres)
48 do while (.not.iblnk(sequenc(i+1)(1:1)))
53 itype(i)=rescode(i,sequenc(i),1)
56 read(1,'(20(a3,1x))',end=11,err=11) (sequenc(i),i=1,maxres)
60 do while (.not.iblnk(sequenc(i+1)(1:1)))
65 itype(i)=rescode(i,sequenc(i),0)
69 iext = index(arg,'.cx') - 1
71 print *,"Error - not a cx file"
74 if (iargc().gt.3) then
78 if (iargc().gt.4) then
82 if (iargc().gt.5) then
86 if (iargc().gt.6) then
87 call getarg(7,pdbfile)
89 pdbfile=arg(:iext)//'.pdb'
93 if (itype(1).eq.21) nnt = 2
95 if (itype(nres).eq.21) nct = nres-1
96 print *,"nnt",nnt," nct",nct
99 if (itype(i).ne.20) then
105 call xdrfopen(ixdrf,arg, "r", iret)
107 c print *,"iret",iret
108 c print *,"is",is," ie",ie
110 do while(is.eq.0 .or. kk.lt.ie)
111 call xdrffloat(ixdrf, time, iret)
112 c print *,"time",time," iret",iret
115 call xdrffloat(ixdrf, potE, iret)
116 call xdrffloat(ixdrf, uconst, iret)
117 c print *,"potE",potE," uconst",uconst
119 call xdrffloat(ixdrf, uconst_back, iret)
120 c print *,"uconst_back",uconst_back
122 call xdrffloat(ixdrf, t_bath, iret)
123 c print *,"t_bath",t_bath
124 call xdrfint(ixdrf, nss, iret)
126 call xdrfint(ixdrf, ihpb(j), iret)
127 call xdrfint(ixdrf, jhpb(j), iret)
130 c print *," ",(ihpb(j),"-",jhpb(j),j=1,nss)
131 call xdrfint(ixdrf, nfrag, iret)
133 call xdrffloat(ixdrf, qfrag(i), iret)
135 c print *,"nfrag",nfrag
139 call xdrf3dfcoord(ixdrf, coord, isize, prec, iret)
142 c write (*,'(e15.8,2e15.5,f12.5,$)') time,potE,uconst,t_bath
143 c write (*,'(i4,$)') nss,(ihpb(j),jhpb(j),j=1,nss)
144 c write (*,'(i4,20f7.4)') nfrag,(qfrag(i),i=1,nfrag)
145 c write (*,'(8f10.5)') ((coord(k,j),k=1,3),j=1,isize)
146 if (kk.ge.is .and. mod(kk,ifreq).eq.0) then
147 if (isize .ne. nres+nct-nnt+1) then
148 print *,"Error: inconsistent sizes",isize,nres+nct-nnt+1
159 c(j,i+nres)=coord(j,ii+nres)
173 c(j,i+nres)=c(j,i+nres)-cm(j)
177 write (tytul,'(a,i6)') "Structure",kk
179 call secondary2(.false.)
181 call pdbout(etot,tytul,9)