The Elk Code
genmcph.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2015 J. K. Dewhurst, S. Sharma and E. K. U. Gross.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 pure subroutine genmcph(wq,ev,a)
7 use modmain
8 use modphonon
9 implicit none
10 ! arguments
11 real(8), intent(in) :: wq(nbph)
12 complex(8), intent(in) :: ev(nbph,nbph)
13 complex(8), intent(out) :: a(nbph,nbph)
14 ! local variables
15 integer is,ia,ip,i,j
16 real(8) t1
17 ! generate the matrix for converting between Cartesian and phonon coordinates
18 do j=1,nbph
19  i=0
20  do is=1,nspecies
21  t1=2.d0*spmass(is)*wq(j)
22  if (t1 > 1.d-8) then
23  t1=1.d0/sqrt(t1)
24  else
25  t1=0.d0
26  end if
27  do ia=1,natoms(is)
28  do ip=1,3
29  i=i+1
30  a(i,j)=t1*ev(i,j)
31  end do
32  end do
33  end do
34 end do
35 end subroutine
36 
integer nbph
Definition: modphonon.f90:13
real(8), dimension(maxspecies) spmass
Definition: modmain.f90:101
integer, dimension(maxspecies) natoms
Definition: modmain.f90:36
pure subroutine genmcph(wq, ev, a)
Definition: genmcph.f90:7
integer nspecies
Definition: modmain.f90:34