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