The Elk Code
initph.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 
6 subroutine initph
7 use modmain
8 use modphonon
9 implicit none
10 ! allocate global arrays
11 if (allocated(dynq)) deallocate(dynq)
12 allocate(dynq(nbph,nbph,nqpt))
13 if (allocated(dynr)) deallocate(dynr)
14 allocate(dynr(nbph,nbph,nqptnr))
15 if (allocated(wphq)) deallocate(wphq)
16 allocate(wphq(nbph,nqpt))
17 ! read in the dynamical matrices
18 call readdyn
19 ! apply the acoustic sum rule
20 call sumrule
21 ! if the non-analytic term is required then read in the Born effective charge
22 ! tensor for each atom as well as the static dielectric tensor
23 if (allocated(bec)) deallocate(bec)
24 if (tphnat) then
25  allocate(bec(3,3,natmtot))
26  call readbec
27  call readepsw0
28 end if
29 ! Fourier transform the dynamical matrices to real-space
30 call dynqtor(dynq,dynr)
31 end subroutine
32 
real(8), dimension(:,:,:), allocatable dynr
Definition: modphonon.f90:29
subroutine sumrule
Definition: sumrule.f90:10
subroutine readdyn
Definition: readdyn.f90:7
integer nqpt
Definition: modmain.f90:525
subroutine readepsw0
Definition: readepsw0.f90:7
real(8), dimension(:,:,:), allocatable bec
Definition: modphonon.f90:36
complex(8), dimension(:,:,:), allocatable dynq
Definition: modphonon.f90:27
integer nbph
Definition: modphonon.f90:13
subroutine initph
Definition: initph.f90:7
integer nqptnr
Definition: modmain.f90:527
subroutine dynqtor(dq, dr)
Definition: dynqtor.f90:7
integer natmtot
Definition: modmain.f90:40
real(8), dimension(:,:), allocatable wphq
Definition: modphonon.f90:31
logical tphnat
Definition: modphonon.f90:34
subroutine readbec
Definition: readbec.f90:7