implicit real*8 (a-h,o-z) include 'DIMENSIONS' include 'COMMON.CHAIN' include 'COMMON.INTERACT' include 'COMMON.SBRIDGE' real*4 coord(3,1000) real*4 prec,potE,efree,rmsdev real*8 etot character*80 arg,seqfile,pdbfile character*3 sequenc(maxres) character*50 tytul character*8 onethree,cfreq character*8 ucase external ucase logical oneletter integer rescode external rescode ifreq=1 if (iargc().lt.4) then print '(a)', & "Usage: xdrf2pdb one/three seqfile cxfile conf [pdbfile]" stop endif call getarg(1,onethree) onethree = ucase(onethree) if (onethree.eq.'ONE') then oneletter = .true. else if (onethree.eq.'THREE') then oneletter = .false. else print *,"ONE or THREE must be specified" endif call getarg(2,seqfile) open (1,file=seqfile,status='old') if (oneletter) then read(1,'(80a1)',end=10,err=10) (sequenc(i)(1:1),i=1,maxres) 10 continue nres=i i=0 do while (.not.iblnk(sequenc(i+1)(1:1))) i=i+1 enddo nres=i do i=1,nres itype(i)=rescode(i,sequenc(i),1) enddo else read(1,'(20(a3,1x))',end=11,err=11) (sequenc(i),i=1,maxres) 11 continue nres=i print *,"nres",nres do i=1,nres print *,i," ",sequenc(i) enddo print * i=0 do while (.not.iblnk(sequenc(i+1)(1:1))) print *,i+1," ",sequenc(i+1)," ",sequenc(i+1)(1:1) i=i+1 enddo nres=i print *,"nres",nres do i=1,nres itype(i)=rescode(i,sequenc(i),0) enddo print *,(itype(i),i=1,nres) endif call getarg(3,arg) iext = index(arg,'.cx') - 1 if (iext.lt.0) then print *,"Error - not a cx file" stop endif print *,"arg ",arg call getarg(4,cfreq) read (cfreq,*) iconf print *,"iconf",iconf if (iargc().gt.4) then call getarg(5,pdbfile) else pdbfile=arg(:iext)//'.pdb' endif open(9,file=pdbfile) nnt = 1 if (itype(1).eq.21) nnt = 2 nct=nres if (itype(nres).eq.21) nct = nres-1 c if (nct.eq.nres-1) nres=nres-1 c if (nnt.eq.2) nres=nres-1 print *,"nres",nres," nnt",nnt," nct",nct call xdrfopen(ixdrf,arg, "r", iret) print *,"iret",iret kk = 0 do while(.true.) prec=10000.0 isize=0 call xdrf3dfcoord(ixdrf, coord, isize, prec, iret) call xdrfint(ixdrf, nss, iret) do j=1,nss call xdrfint(ixdrf, ihpb(j), iret) call xdrfint(ixdrf, jhpb(j), iret) enddo call xdrffloat(ixdrf, potE, iret) if(iret.eq.0) exit kk = kk + 1 call xdrffloat(ixdrf, efree, iret) call xdrffloat(ixdrf, rmsdev, iret) call xdrfint(ixdrf, iscor, iret) if (kk.eq.iconf) then print *,"pote",pote," efree",efree," rmsdev",rmsdev print *,"isize",isize if (isize .ne. nres+nct-nnt+1) then print *,"Error: inconsistent sizes",isize,nres+nct-nnt+1 endif do i=1,nres do j=1,3 c(j,i)=coord(j,i) enddo enddo ii = 0 do i=nnt,nct ii = ii + 1 do j=1,3 c(j,i+nres)=coord(j,ii+nres) enddo enddo etot=potE write (tytul,'(a,i6)') "Structure",kk call pdbout(etot,tytul,9) stop endif enddo end