The Elk Code
dynev.f90
Go to the documentation of this file.
1
2
! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3
! This file is distributed under the terms of the GNU General Public License.
4
! See the file COPYING for license details.
5
6
subroutine
dynev
(dq,wq,ev)
7
use
modmain
8
use
modphonon
9
implicit none
10
! arguments
11
complex(8)
,
intent(in)
:: dq(nbph,nbph)
12
real(8)
,
intent(out)
:: wq(nbph)
13
complex(8)
,
intent(out)
:: ev(nbph,nbph)
14
! local variables
15
integer
is,ia,js,ja
16
integer
ip,jp,i,j
17
real(8)
t1
18
ev(:,:)=0.d0
19
i=0
20
do
is=1,
nspecies
21
do
ia=1,
natoms
(is)
22
do
ip=1,3
23
i=i+1
24
j=0
25
do
js=1,
nspecies
26
! mass factor
27
if
((
spmass
(is) <= 0.d0).or.(
spmass
(js) <= 0.d0))
then
28
! infinite mass
29
t1=0.d0
30
else
31
t1=1.d0/sqrt(
spmass
(is)*
spmass
(js))
32
end if
33
do
ja=1,
natoms
(js)
34
do
jp=1,3
35
j=j+1
36
! use Hermitian average of dynamical matrix
37
if
(i <= j) ev(i,j)=0.5d0*t1*(dq(i,j)+conjg(dq(j,i)))
38
end do
39
end do
40
end do
41
end do
42
end do
43
end do
44
! find the eigenvalues and eigenvectors of the dynamical matrix
45
call
zheevdi
(nbph,nbph,ev,wq)
46
do
i=1,nbph
47
t1=sqrt(abs(wq(i)))
48
wq(i)=sign(t1,wq(i))
49
end do
50
end subroutine
51
zheevdi
subroutine zheevdi(n, ld, a, w)
Definition:
zheevdi.f90:7
modmain
Definition:
modmain.f90:6
dynev
subroutine dynev(dq, wq, ev)
Definition:
dynev.f90:7
modmain::spmass
real(8), dimension(maxspecies) spmass
Definition:
modmain.f90:101
modphonon
Definition:
modphonon.f90:6
modmain::natoms
integer, dimension(maxspecies) natoms
Definition:
modmain.f90:36
modmain::nspecies
integer nspecies
Definition:
modmain.f90:34
dynev.f90
Generated by
1.8.14