The Elk Code
dynrtoq.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 dynrtoq(vpl,dr,dq)
7 use modmain
8 use modphonon
9 implicit none
10 ! arguments
11 real(8), intent(in) :: vpl(3)
12 real(8), intent(in) :: dr(nbph,nbph,nqptnr)
13 complex(8), intent(out) :: dq(nbph,nbph)
14 ! local variables
15 integer isym,lspl,ilspl
16 integer i1,i2,i3,ir
17 real(8) s(3,3),v(3),t1
18 complex(8) z1
19 ! automatic arrays
20 complex(8) d(nbph,nbph)
21 dq(:,:)=0.d0
22 ! loop over crystal symmetries
23 do isym=1,nsymcrys
24 ! index to spatial rotation in lattice point group
25  lspl=lsplsymc(isym)
26 ! the inverse of the spatial symmetry
27  ilspl=isymlat(lspl)
28 ! symmetry matrix in lattice coordinates
29  s(:,:)=dble(symlat(:,:,ilspl))
30 ! operate with inverse symmetry matrix on vpl
31  call r3mtv(s,vpl,v)
32 ! construct dynamical matrix for rotated vpl
33  d(:,:)=0.d0
34 ! loop over R-vectors
35  ir=0
36  do i3=ngridq(3)/2-ngridq(3)+1,ngridq(3)/2
37  do i2=ngridq(2)/2-ngridq(2)+1,ngridq(2)/2
38  do i1=ngridq(1)/2-ngridq(1)+1,ngridq(1)/2
39  ir=ir+1
40  t1=-twopi*(v(1)*dble(i1)+v(2)*dble(i2)+v(3)*dble(i3))
41  z1=cmplx(cos(t1),sin(t1),8)
42  d(:,:)=d(:,:)+z1*dr(:,:,ir)
43  end do
44  end do
45  end do
46 ! apply symmetry operation to dynamical matrix and add to total
47  call dynsymapp(isym,v,d,dq)
48 ! end loop over symmetries
49 end do
50 ! normalise by the number of symmetry operations
51 t1=1.d0/dble(nsymcrys)
52 dq(:,:)=t1*dq(:,:)
53 ! add the non-analytic term if required
54 if (tphnat) call dynqnat(1,vpl,dq)
55 end subroutine
56 
subroutine dynsymapp(isym, vpl, dq, dqs)
Definition: dynsymapp.f90:7
pure subroutine r3mtv(a, x, y)
Definition: r3mtv.f90:10
real(8), parameter twopi
Definition: modmain.f90:1233
integer nsymcrys
Definition: modmain.f90:358
integer, dimension(48) isymlat
Definition: modmain.f90:348
subroutine dynqnat(sgn, vpl, dq)
Definition: dynqnat.f90:7
integer, dimension(3, 3, 48) symlat
Definition: modmain.f90:344
subroutine dynrtoq(vpl, dr, dq)
Definition: dynrtoq.f90:7
integer, dimension(maxsymcrys) lsplsymc
Definition: modmain.f90:364
integer, dimension(3) ngridq
Definition: modmain.f90:515
logical tphnat
Definition: modphonon.f90:34