The Elk Code
 
Loading...
Searching...
No Matches
dynqnat.f90
Go to the documentation of this file.
1
2! Copyright (C) 2024 J. K. Dewhurst and S. Sharma.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine dynqnat(sgn,vpl,dq)
7use modmain
8use modphonon
9implicit none
10! arguments
11integer, intent(in) :: sgn
12real(8), intent(in) :: vpl(3)
13complex(8), intent(inout) :: dq(nbph,nbph)
14! local variables
15integer ias,jas,ip,jp,i,j
16real(8) vpfl(3),vpc(3),v(3),t0,t1
17! automatic arrays
18real(8) vbpc(3,natmtot)
19! map vpl to the first Brillouin zone
20vpfl(:)=vpl(:)
21call vecfbz(epslat,bvec,vpfl)
22! q-vector in Cartesian coordinates
23call r3mv(bvec,vpfl,vpc)
24! multiply the q-vector with the Born effective charge tensor
25do ias=1,natmtot
26 call r3mv(bec(:,:,ias),vpc,vbpc(:,ias))
27end do
28! compute q⋅ϵ⋅q
29call r3mv(epsw0,vpc,v)
30t0=vpc(1)*v(1)+vpc(2)*v(2)+vpc(3)*v(3)
31if (abs(t0) > 1.d-8) then
32 t0=fourpi/(omega*t0)
33 if (sgn < 0) t0=-t0
34else
35 t0=0.d0
36end if
37! ensure that the function tends to zero smoothly near the zone boundary
38do i=1,3
39 t1=abs(vpfl(i))
40 if (t1 < 0.5d0) then
41 t0=t0*(1.d0-2.d0*t1)
42 else
43 t0=0.d0
44 end if
45end do
46j=0
47do jas=1,natmtot
48 do jp=1,3
49 j=j+1
50 i=0
51 do ias=1,natmtot
52 do ip=1,3
53 i=i+1
54 t1=vbpc(ip,ias)*vbpc(jp,jas)
55 dq(i,j)=dq(i,j)+t0*t1
56 end do
57 end do
58 end do
59end do
60end subroutine
61
subroutine dynqnat(sgn, vpl, dq)
Definition dynqnat.f90:7
real(8), dimension(3, 3) bvec
Definition modmain.f90:16
real(8) omega
Definition modmain.f90:20
real(8), parameter fourpi
Definition modmain.f90:1231
real(8) epslat
Definition modmain.f90:24
real(8), dimension(3, 3) epsw0
Definition modphonon.f90:38
real(8), dimension(:,:,:), allocatable bec
Definition modphonon.f90:36
pure subroutine r3mv(a, x, y)
Definition r3mv.f90:10
subroutine vecfbz(eps, bvec, vpl)
Definition vecfbz.f90:10