Added putting secondary-structure information to the pdbfiles generated by xdrf2pdb...
[unres.git] / source / xdrfpdb / src-M / xdrf2x.F
1       real coord(3,2000)
2       real prec,time,potE,uconst,t_bath,qfrag(100)
3       integer ihpb(100),jhpb(100)
4       character*80 arg,ctime_start /"0"/,ctime_end /"1000000000"/,
5      &  cfreq /"1"/
6       integer time_start,time_end,freq
7       
8       call getarg(1,arg)
9       if (iargc().eq.0) stop
10       if (iargc().gt.1) then
11         call getarg(2,ctime_start)
12         read (ctime_start,*) time_start
13       else
14         time_start=0.0d0
15       endif
16       if (iargc().gt.2) then
17         call getarg(3,ctime_end)
18         read (ctime_end,*) time_end
19       else
20         time_end=1.0d10
21       endif
22       if (iargc().gt.3) then
23         call getarg(4,cfreq)
24         read (cfreq,*) freq
25       else
26         freq=1
27       endif
28
29       call xdrfopen(ixdrf,arg, "r", iret)
30        
31       licz=0
32       do while(.true.) 
33        call xdrffloat(ixdrf, time, iret)
34 c       print *,"time",time," iret",iret
35        if(iret.eq.0) exit
36        kk = kk + 1
37        call xdrffloat(ixdrf, potE, iret)
38        call xdrffloat(ixdrf, uconst, iret)
39 c       print *,"potE",potE," uconst",uconst
40 #ifdef NEWUNRES
41        call xdrffloat(ixdrf, uconst_back, iret)
42 #endif
43 c       print *,"uconst_back",uconst_back
44        call xdrffloat(ixdrf, t_bath, iret)
45 c       print *,"t_bath",t_bath
46        call xdrfint(ixdrf, nss, iret) 
47        do j=1,nss
48         call xdrfint(ixdrf, ihpb(j), iret)
49         call xdrfint(ixdrf, jhpb(j), iret)
50        enddo
51 c       print *,"nss",nss
52        call xdrfint(ixdrf, nfrag, iret)
53        do i=1,nfrag
54         call xdrffloat(ixdrf, qfrag(i), iret)
55        enddo
56        prec=10000.0
57
58        isize=0
59        call xdrf3dfcoord(ixdrf, coord, isize, prec, iret)
60
61        licz=licz+1
62 c       print *,licz,time_start,time_end,freq,mod(licz,freq)
63        if (licz.gt.time_end) exit
64        if (licz.ge.time_start .and. mod(licz,freq).eq.0) then
65        write (*,'(e15.8,2e15.5,f12.5,$)') time,potE,uconst,t_bath
66        write (*,'(i4,$)') nss,(ihpb(j),jhpb(j),j=1,nss)
67        write (*,'(i4,20f7.4)') nfrag,(qfrag(i),i=1,nfrag)
68        write (*,'(8f10.5)') ((coord(k,j),k=1,3),j=1,isize)
69        endif
70       enddo
71      
72       end