1c
2c $Id$
3c
4
5      SUBROUTINE smd_util_rebox(n,latt,rlatt,aaa)
6
7      implicit none
8
9      integer n
10      double precision rlatt(3,3),latt(3,3)
11      double precision  aaa(n,3)
12c
13      integer i
14      double precision  ssx,ssy,ssz,xss,yss,zss
15      logical oprint
16
17
18      if(n.eq.1) then
19       oprint =.true.
20      else
21       oprint = .false.
22      end if
23      oprint = .false.
24      do i=1,n
25
26       if(oprint)
27     >          write(*,*) "rebox",aaa(i,1),aaa(i,2),aaa(i,3)
28       ssx=(rlatt(1,1)*aaa(i,1)+rlatt(1,2)*aaa(i,2)+rlatt(1,3)*aaa(i,3))
29       ssy=(rlatt(2,1)*aaa(i,1)+rlatt(2,2)*aaa(i,2)+rlatt(2,3)*aaa(i,3))
30       ssz=(rlatt(3,1)*aaa(i,1)+rlatt(3,2)*aaa(i,2)+rlatt(3,3)*aaa(i,3))
31
32       xss=ssx-nint(ssx)
33       yss=ssy-nint(ssy)
34       zss=ssz-nint(ssz)
35
36       aaa(i,1)=(latt(1,1)*xss+latt(1,2)*yss+latt(1,3)*zss)
37       aaa(i,2)=(latt(2,1)*xss+latt(2,2)*yss+latt(2,3)*zss)
38       aaa(i,3)=(latt(3,1)*xss+latt(3,2)*yss+latt(3,3)*zss)
39
40      enddo
41
42      return
43
44      END
45
46      subroutine smd_util_print_force_array(un,na,
47     >                           fff)
48
49      implicit none
50      integer un
51      integer na
52      double precision fff(na,3)
53c
54      integer i
55      do i=1,na
56         write(un,*) i, fff(i,1),fff(i,2),fff(i,3)
57      end do
58      return
59
60      end
61
62      subroutine smd_util_print_charge_array(un,na,lo,hi,
63     >                           fff)
64
65      implicit none
66      integer un
67      integer na
68      double precision fff(na)
69c
70      integer i,lo,hi
71      do i=lo,hi
72         write(un,*) i, fff(i)
73      end do
74      return
75
76      end
77