changes in parameters
[unres4.git] / source / xdrfpdb / xdrf2x.F90
1       program xdrf2x
2       use geometry_data, only: nfrag
3       use energy_data, only: nss,uconst_back
4
5       implicit none
6       real(kind=4) :: coord(3,2000)
7       real(kind=4) :: prec,time,potE,uconst,t_bath,qfrag(100)
8       integer :: ihpb(100),jhpb(100)
9       character(len=80) :: arg,ctime_start,&!=(/"0"/),&
10                            ctime_end,&!=(/"1000000000"/),&
11                            cfreq!=(/"1"/)
12       real(kind=8) :: time_start,time_end
13       integer :: i,j,k,kk,licz,isize,freq
14       integer :: iret,ixdrf
15       
16       ctime_start="0"
17       ctime_end="1000000000"
18       cfreq="1"
19       call getarg(1,arg)
20       if (iargc().eq.0) stop
21       if (iargc().gt.1) then
22         call getarg(2,ctime_start)
23         read (ctime_start,*) time_start
24       else
25         time_start=0.0d0
26       endif
27       if (iargc().gt.2) then
28         call getarg(3,ctime_end)
29         read (ctime_end,*) time_end
30       else
31         time_end=1.0d10
32       endif
33       if (iargc().gt.3) then
34         call getarg(4,cfreq)
35         read (cfreq,*) freq
36       else
37         freq=1
38       endif
39
40       call xdrfopen(ixdrf,arg, "r", iret)
41        
42       licz=0
43       do while(.true.) 
44        call xdrffloat(ixdrf, time, iret)
45 !       print *,"time",time," iret",iret
46        if(iret.eq.0) exit
47        kk = kk + 1
48        call xdrffloat(ixdrf, potE, iret)
49        call xdrffloat(ixdrf, uconst, iret)
50 !       print *,"potE",potE," uconst",uconst
51 #ifdef NEWUNRES
52        call xdrffloat(ixdrf, uconst_back, iret)
53 #endif
54 !       print *,"uconst_back",uconst_back
55        call xdrffloat(ixdrf, t_bath, iret)
56 !       print *,"t_bath",t_bath
57        call xdrfint(ixdrf, nss, iret) 
58        do j=1,nss
59         call xdrfint(ixdrf, ihpb(j), iret)
60         call xdrfint(ixdrf, jhpb(j), iret)
61        enddo
62 !       print *,"nss",nss
63        call xdrfint(ixdrf, nfrag, iret)
64        do i=1,nfrag
65         call xdrffloat(ixdrf, qfrag(i), iret)
66        enddo
67        prec=10000.0
68
69        isize=0
70        call xdrf3dfcoord(ixdrf, coord, isize, prec, iret)
71
72        licz=licz+1
73 !       print *,licz,time_start,time_end,freq,mod(licz,freq)
74        if (licz.gt.time_end) exit
75        if (licz.ge.time_start .and. mod(licz,freq).eq.0) then
76        write (*,'(e15.8,2e15.5,f12.5,$)') time,potE,uconst,t_bath
77        write (*,'(i4,$)') nss,(ihpb(j),jhpb(j),j=1,nss)
78        write (*,'(i4,20f7.4)') nfrag,(qfrag(i),i=1,nfrag)
79        write (*,'(8f10.5)') ((coord(k,j),k=1,3),j=1,isize)
80        endif
81       enddo
82      
83       end