Trying to bring files - continued
[unres.git] / source / xdrfpdb / src / xdrf2x1.f
1       implicit real*8 (a-h,o-z)
2       integer ihpb(100),jhpb(100)
3       real*4 coord(3,1000)
4       real*4 prec,potE,efree,rmsdev,qfrag(100)
5       real*8 etot
6       character*80 arg,xfile
7       character*8 ucase,cfreq
8       external ucase
9       logical oneletter
10       integer rescode
11       external rescode
12       
13       ifreq=1
14       if (iargc().lt.2) then
15         print '(a)',
16      &    "Usage: xdrf2x1 cxfile conf [pdbfile]"
17         stop
18       endif
19       call getarg(1,arg)
20       iext = index(arg,'.cx') - 1
21       if (iext.lt.0) then
22         print *,"Error - not a cx file"
23         stop
24       endif
25       print *,"arg ",arg
26       call getarg(2,cfreq)
27       read (cfreq,*) iconf
28       print *,"iconf",iconf
29       if (iargc().gt.2) then
30         call getarg(3,pdbfile)
31       else
32         xfile=arg(:iext)//'.x'
33       endif
34       open(9,file=xfile)
35
36       call xdrfopen(ixdrf,arg, "r", iret)
37       print *,"iret",iret 
38       kk = 0
39       do while(.true.) 
40        prec=10000.0
41        isize=0
42        call xdrf3dfcoord(ixdrf, coord, isize, prec, iret)
43        call xdrfint(ixdrf, nss, iret) 
44        do j=1,nss
45         call xdrfint(ixdrf, ihpb(j), iret)
46         call xdrfint(ixdrf, jhpb(j), iret)
47        enddo
48        call xdrffloat(ixdrf, potE, iret)
49        if(iret.eq.0) exit
50        kk = kk + 1
51        call xdrffloat(ixdrf, efree, iret)
52        call xdrffloat(ixdrf, rmsdev, iret)
53        call xdrfint(ixdrf, iscor, iret)
54        if (kk.eq.iconf) then
55          print *,"pote",pote," efree",efree," rmsdev",rmsdev
56
57          print *,"isize",isize
58
59          write (9,'(e15.8,2e15.5,f12.5,$)') time,potE,uconst,t_bath
60          write (9,'(i4,$)') nss,(ihpb(j),jhpb(j),j=1,nss)
61          write (9,'(i4,20f7.4)') nfrag,(qfrag(i),i=1,nfrag)
62          write (9,'(8f10.5)') ((coord(k,j),k=1,3),j=1,isize)
63          stop
64        endif
65       enddo
66      
67       end