implicit real*8 (a-h,o-z) include 'DIMENSIONS' include 'COMMON.CHAIN' include 'COMMON.INTERACT' include 'COMMON.SBRIDGE' real*4 coord(3,2*maxres) real*4 prec,time,potE,uconst,t_bath,qfrag(100) real*8 etot character*80 arg,seqfile,pdbfile character*3 sequenc(maxres) character*50 tytul character*8 onethree,cfreq,cntraj,citraj character*3 licz character*8 ucase external ucase logical oneletter,iblnk integer rescode external rescode ifreq=1 if (iargc().lt.5) then print '(2a)', & "Usage: xdrf2pdb-m one/three seqfile cxfile ntraj itraj", & " [pdbfile] [freq]" 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))) c do while (.not.(iblnk(sequenc(i+1)(1:1)) == 0)) 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 i=0 do while (.not.iblnk(sequenc(i+1)(1:1))) c do while (.not.(iblnk(sequenc(i+1)(1:1)) == 0)) i=i+1 enddo nres=i do i=1,nres itype(i)=rescode(i,sequenc(i),0) enddo print *,nres print '(20(a3,1x))',(sequenc(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 call getarg(4,cntraj) read (cntraj,*) ntraj call getarg(5,citraj) read (citraj,*) itraj if (iargc().gt.5) then call getarg(6,pdbfile) else write(licz,'(bz,i3.3)') itraj pdbfile=arg(:iext)//'_'//licz//'.pdb' endif if (iargc().gt.6) then call getarg(7,cfreq) read (cfreq,*) ifreq endif c print *,"ifreq",ifreq," ntraj",ntraj," itraj",itraj open(9,file=pdbfile) nnt = 1 if (itype(1).eq.21) nnt = 2 nct=nres if (itype(nres).eq.21) nct = nres-1 print *,"nnt",nnt," nct",nct call xdrfopen(ixdrf,arg, "r", iret) kk = 0 do while(.true.) call xdrffloat(ixdrf, time, iret) print *,"time",time," iret",iret if(iret.eq.0) exit kk = kk + 1 call xdrffloat(ixdrf, potE, iret) call xdrffloat(ixdrf, uconst, iret) call xdrffloat(ixdrf, t_bath, iret) print *,"potE",potE," uconst",uconst," t_bath",t_bath c c uconst_back not written in MREMD.F code c#ifdef NEWUNRES c call xdrffloat(ixdrf, uconst_back, iret) c print *,"uconst_back",uconst_back c#endif call xdrfint(ixdrf, nss, iret) do j=1,nss call xdrfint(ixdrf, ihpb(j), iret) call xdrfint(ixdrf, jhpb(j), iret) enddo print *,"nss",nss print *," ",(ihpb(j),"-",jhpb(j),j=1,nss) call xdrfint(ixdrf, nfrag, iret) call xdrfint(ixdrf, iset, iret) do i=1,nfrag call xdrffloat(ixdrf, qfrag(i), iret) enddo print *,"nfrag",nfrag,"iset",iset prec=10000.0 isize=0 print *," call xdrf3coord" call xdrf3dfcoord(ixdrf, coord, isize, prec, iret) print *,"isize",isize c write (*,'(e15.8,2e15.5,f12.5,$)') time,potE,uconst,t_bath c write (*,'(i4,$)') nss,(ihpb(j),jhpb(j),j=1,nss) c write (*,'(i4,20f7.4)') nfrag,(qfrag(i),i=1,nfrag) c write (*,'(8f10.5)') ((coord(k,j),k=1,3),j=1,isize) if (mod(kk/ntraj,ifreq).eq.0 .and. mod(kk,ntraj).eq.itraj) then 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) endif enddo end