-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcartezian.f90
79 lines (54 loc) · 1.93 KB
/
cartezian.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
! The code was developed at the Fritz Haber Institute, and
! the intellectual properties and copyright of this file
! are with the Max Planck Society. When you use it, please
! cite R. Gomez-Abal, X. Li, C. Ambrosch-Draxl, M. Scheffler,
! Extended linear tetrahedron method for the calculation of q-dependent
! dynamical response functions, to be published in Comp. Phys. Commun. (2010)
!BOP
!
! !ROUTINE: cartezian
!
! !INTERFACE:
subroutine cartezian(nkp,aaa,gbas,klist,idiv)
! !DESCRIPTION:
!
! This subroutine transform the submesh coordinates of the kpoints into
! cartesian coordinates in the reciprocal space
!
! !INPUT PARAMETERS:
implicit none
integer(4), intent(in) :: nkp ! Number of k-points
real(8), intent(in) :: aaa(3) ! lattice constants
real(8), intent(in) :: gbas(3,3) ! Basis vectors of the direct
! lattice
! !INPUT/OUTPUT PARAMETERS:
integer(4), intent(inout) :: klist(3,*)! integer coordinates of
! the kpoints
integer(4), intent(inout) :: idiv ! minimum common divisor
! for the integer
! coordinates of the
! kpoints
! !LOCAL VARIABLES:
integer(4) :: kpi
integer(4) :: i
integer(4) :: j
real(8), dimension(3) :: ak
! !DEFINED PARAMETERS:
real(8), parameter :: pi = 3.14159265358979323846
!EOP
!
!BOC
do kpi=1,nkp
do i=1,3
ak(i)=0.0d0
do j=1,3
ak(i)=ak(i)+gbas(i,j)*dble(klist(j,kpi))
enddo
enddo
do i=1,3
klist(i,kpi)=nint(ak(i)/2./pi*aaa(i))
enddo
enddo
call divisi(nkp,idiv,klist)
end subroutine cartezian
!EOC