1 implicit real*8 (a-h,o-z)
4 include 'COMMON.INTERACT'
5 include 'COMMON.SBRIDGE'
7 real*4 prec,potE,efree,rmsdev
9 character*80 arg,seqfile,pdbfile
10 character*3 sequenc(maxres)
12 character*8 onethree,cfreq
20 if (iargc().lt.4) then
22 & "Usage: xdrf2pdb one/three seqfile cxfile conf [pdbfile]"
25 call getarg(1,onethree)
26 onethree = ucase(onethree)
27 if (onethree.eq.'ONE') then
29 else if (onethree.eq.'THREE') then
32 print *,"ONE or THREE must be specified"
34 call getarg(2,seqfile)
35 open (1,file=seqfile,status='old')
37 read(1,'(80a1)',end=10,err=10) (sequenc(i)(1:1),i=1,maxres)
41 do while (.not.iblnk(sequenc(i+1)(1:1)))
46 itype(i)=rescode(i,sequenc(i),1)
49 read(1,'(20(a3,1x))',end=11,err=11) (sequenc(i),i=1,maxres)
54 print *,i," ",sequenc(i)
58 do while (.not.iblnk(sequenc(i+1)(1:1)))
59 print *,i+1," ",sequenc(i+1)," ",sequenc(i+1)(1:1)
65 itype(i)=rescode(i,sequenc(i),0)
67 print *,(itype(i),i=1,nres)
70 iext = index(arg,'.cx') - 1
72 print *,"Error - not a cx file"
79 if (iargc().gt.4) then
80 call getarg(5,pdbfile)
82 pdbfile=arg(:iext)//'.pdb'
86 if (itype(1).eq.21) nnt = 2
88 if (itype(nres).eq.21) nct = nres-1
89 c if (nct.eq.nres-1) nres=nres-1
90 c if (nnt.eq.2) nres=nres-1
92 print *,"nres",nres," nnt",nnt," nct",nct
94 call xdrfopen(ixdrf,arg, "r", iret)
100 call xdrf3dfcoord(ixdrf, coord, isize, prec, iret)
101 call xdrfint(ixdrf, nss, iret)
103 call xdrfint(ixdrf, ihpb(j), iret)
104 call xdrfint(ixdrf, jhpb(j), iret)
106 call xdrffloat(ixdrf, potE, iret)
109 call xdrffloat(ixdrf, efree, iret)
110 call xdrffloat(ixdrf, rmsdev, iret)
111 call xdrfint(ixdrf, iscor, iret)
112 if (kk.eq.iconf) then
113 print *,"pote",pote," efree",efree," rmsdev",rmsdev
115 print *,"isize",isize
117 if (isize .ne. nres+nct-nnt+1) then
118 print *,"Error: inconsistent sizes",isize,nres+nct-nnt+1
129 c(j,i+nres)=coord(j,ii+nres)
133 write (tytul,'(a,i6)') "Structure",kk
134 call pdbout(etot,tytul,9)