Line data Source code
1 : c*****************************c
2 : c routine to define Bravais c
3 : c in the auxiliary space c
4 : c*****************************c
5 : module m_wann_gwf_auxbrav
6 : use m_juDFT
7 : implicit none
8 : contains
9 :
10 0 : subroutine wann_gwf_auxbrav(a,l_sgwf,l_socgwf,amat,bmat,l_dim)
11 : use m_inv3
12 : use m_constants, only : pimach
13 :
14 : implicit none
15 : real, intent(in) :: a
16 : logical, intent(in) :: l_sgwf,l_socgwf,l_dim(3)
17 : real, intent(out) :: amat(3,3),bmat(3,3)
18 : real :: tpi, omtil,kmesh_tol
19 :
20 0 : call timestart("wann_gwf_auxbrav")
21 :
22 0 : write(*,*)'auxiliary lattice constant a=',a
23 :
24 0 : tpi = 2.0*pimach()
25 0 : kmesh_tol = 0.001
26 0 : amat = 0.0
27 0 : bmat = 0.0
28 :
29 0 : amat(1,1)=1.1*a; amat(2,2)=1.1*a; amat(3,3)=1.1*a
30 0 : if(l_dim(1))amat(1,1)=a
31 0 : if(l_dim(2))amat(2,2)=a
32 0 : if(l_dim(3))amat(3,3)=a
33 0 : if(l_sgwf.or.l_socgwf) then
34 0 : amat = amat/2.0
35 : c amat(1,1)=amat(1,1)-kmesh_tol
36 : c amat(2,2)=amat(2,2)-kmesh_tol
37 : c amat(3,3)=amat(3,3)-kmesh_tol
38 : endif
39 0 : call inv3(amat,bmat,omtil)
40 0 : bmat = tpi*bmat
41 :
42 : !write(*,*)'aux. amat',amat
43 : !write(*,*)'aux. bmat',bmat
44 :
45 0 : call timestop("wann_gwf_auxbrav")
46 0 : end subroutine wann_gwf_auxbrav
47 :
48 : end module m_wann_gwf_auxbrav
|