The Elk Code
modphonon.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2010 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 module modphonon
7 use modmain
8 
9 !--------------------------!
10 ! phonon variables !
11 !--------------------------!
12 ! number of phonon branches (3*natmtot)
13 integer nbph
14 ! current phonon q-point, species, atom and polarisation index
16 ! tphq0 is .true. if q = 0
17 logical tphq0
18 ! number of vectors for writing out frequencies and eigenvectors
19 integer nphwrt
20 ! vectors in lattice coordinates for writing out frequencies and eigenvectors
21 real(8), allocatable :: vqlwrt(:,:)
22 ! Coulomb pseudopotential
23 real(8) mustar
24 ! number of temperatures for the Eliashberg equations and thermal properties
25 integer ntemp
26 ! dynamical matrices for all q-points
27 complex(8), allocatable :: dynq(:,:,:)
28 ! dynamical matrices for all R-points
29 real(8), allocatable :: dynr(:,:,:)
30 ! phonon frequencies for all q-points
31 real(8), allocatable :: wphq(:,:)
32 ! tphnat is .true. if the non-analytic term is to be added to the phonon
33 ! dispersion; this requires the Born effective charges and dielectric function
34 logical tphnat
35 ! Born effective charge tensor for each atom
36 real(8), allocatable :: bec(:,:,:)
37 ! static dielectric tensor
38 real(8) epsw0(3,3)
39 
40 !-----------------------------!
41 ! supercell variables !
42 !-----------------------------!
43 ! number of primitive unit cells in phonon supercell
44 integer nscph
45 ! Cartesian offset vectors for each primitive cell in the supercell
46 real(8), allocatable :: vscph(:,:)
47 ! phonon displacement distance
48 real(8) deltaph
49 
50 !---------------------!
51 ! k+q-vectors !
52 !---------------------!
53 ! k+q-vectors in lattice coordinates
54 real(8), allocatable :: vkql(:,:)
55 ! k+q-vectors in Cartesian coordinates
56 real(8), allocatable :: vkqc(:,:)
57 
58 !------------------------------!
59 ! G+q-vector variables !
60 !------------------------------!
61 ! G+q-vectors in Cartesian coordinates
62 real(8), allocatable :: vgqc(:,:)
63 ! G+q-vector lengths
64 real(8), allocatable :: gqc(:)
65 ! regularised Coulomb Green's function in G+q-space
66 real(8), allocatable :: gclgq(:)
67 ! spherical Bessel functions jâ‚—(|G+q|Rₘₜ)
68 real(8), allocatable :: jlgqrmt(:,:,:)
69 ! spherical harmonics for G+q-vectors
70 complex(8), allocatable :: ylmgq(:,:)
71 ! structure factors for G+q-vectors
72 complex(8), allocatable :: sfacgq(:,:)
73 ! smooth step function form factors for all species and G+q-vectors
74 real(8), allocatable :: ffacgq(:,:)
75 ! characteristic function derivative in G- and G+q-space
76 complex(8), allocatable :: dcfunig(:)
77 ! characteristic function derivative in real-space
78 complex(8), allocatable :: dcfunir(:)
79 
80 !--------------------------------!
81 ! G+k+q-vector variables !
82 !--------------------------------!
83 ! number of G+k+q-vector for each k-point
84 integer, allocatable :: ngkq(:,:)
85 ! index from G+k+q-vectors to G-vectors
86 integer, allocatable :: igkqig(:,:,:)
87 ! G+k+q-vectors in lattice and Cartesian coordinates
88 real(8), allocatable :: vgkql(:,:,:,:),vgkqc(:,:,:,:)
89 ! G+k+q-vector lengths
90 real(8), allocatable :: gkqc(:,:,:)
91 ! structure factors for the G+k+q-vectors
92 complex(8), allocatable :: sfacgkq(:,:,:,:)
93 
94 !----------------------------------------------------------!
95 ! density functional perturbation theory variables !
96 !----------------------------------------------------------!
97 ! combined target array for drhomt, drhoir, dmagmt and dmagir
98 complex(8), allocatable, target :: drhmg(:)
99 ! density derivative
100 complex(8), pointer, contiguous :: drhomt(:,:),drhoir(:)
101 ! magnetisation derivative
102 complex(8), pointer, contiguous :: dmagmt(:,:,:),dmagir(:,:)
103 ! Coulomb potential derivative
104 complex(8), allocatable :: dvclmt(:,:),dvclir(:)
105 ! gradient of vsmt for the displaced muffin-tin
106 complex(8), allocatable :: gvsmt(:)
107 ! combined target array for dvsmt, dvsir, dbsmt and dbsir
108 complex(8), allocatable, target :: dvsbs(:)
109 ! muffin-tin Kohn-Sham potential derivative
110 complex(8), pointer, contiguous :: dvsmt(:,:)
111 ! interstitial Kohn-Sham potential derivative
112 complex(8), allocatable :: dvsir(:)
113 ! G+q-space interstitial Kohn-Sham potential derivative
114 complex(8), pointer, contiguous :: dvsig(:)
115 ! Kohn-Sham effective magnetic field derivative
116 complex(8), pointer, contiguous :: dbsmt(:,:,:),dbsir(:,:)
117 ! spin-orbit coupling radial function derivative
118 complex(8), allocatable :: dsocfr(:,:)
119 ! APW-APW Hamiltonian integral derivatives
120 complex(8), allocatable :: dhaa(:,:,:,:,:,:)
121 ! local-orbital-APW Hamiltonian integral derivatives
122 complex(8), allocatable :: dhloa(:,:,:,:,:)
123 ! local-orbital-local-orbital Hamiltonian integral derivatives
124 complex(8), allocatable :: dhlolo(:,:,:,:)
125 ! real Gaunt coefficient array
126 real(8), allocatable :: gntyyy(:,:,:)
127 ! smallest allowed perturbation theory denominator for eigenvector derivatives
128 real(8) epsdev
129 ! Fermi energy derivative
130 real(8) defermi
131 ! first-variational eigenvalue derivatives
132 real(8), allocatable :: devalfv(:,:,:)
133 ! second-variational eigenvalue derivatives
134 real(8), allocatable :: devalsv(:,:)
135 ! second-variational occupation number derivatives
136 real(8), allocatable :: doccsv(:,:)
137 
138 !-------------------------------------------+
139 ! electron-phonon mean-field theory |
140 !-------------------------------------------+
141 ! energy change of the electron system
142 real(8) dengye
143 ! energy change of the phonon system
144 real(8) dengyph
145 ! sum of energy changes in electron and phonon systems
146 real(8) dengy
147 ! phonon frequency cut-off below which modes are neglected
148 real(8) wphcut
149 ! scale factor of the electron-phonon term and its mixing parameter
150 real(8) ephscf(2)
151 ! anomalous is .true. if only the anomalous density matrix is to be used in the
152 ! construction of the electron-phonon Hamiltonian
153 logical anomalous
154 ! tephde is .true. if D = D0 + E, otherwise D = D0
155 logical tephde
156 ! single-precision electron-phonon matrix element array for each k- and q-point
157 complex(4), allocatable :: ephmkq(:,:,:,:,:)
158 
159 end module
160 
logical tphq0
Definition: modphonon.f90:17
real(8), dimension(:,:,:), allocatable dynr
Definition: modphonon.f90:29
complex(8), dimension(:,:), pointer, contiguous dmagir
Definition: modphonon.f90:102
real(8), dimension(:,:,:), allocatable jlgqrmt
Definition: modphonon.f90:68
complex(8), dimension(:,:), pointer, contiguous drhomt
Definition: modphonon.f90:100
integer nphwrt
Definition: modphonon.f90:19
complex(8), dimension(:,:), allocatable dvclmt
Definition: modphonon.f90:104
real(8), dimension(:,:,:), allocatable gkqc
Definition: modphonon.f90:90
complex(8), dimension(:), allocatable dvsir
Definition: modphonon.f90:112
complex(8), dimension(:), allocatable dcfunir
Definition: modphonon.f90:78
integer iasph
Definition: modphonon.f90:15
real(8), dimension(:,:), allocatable vkqc
Definition: modphonon.f90:56
complex(8), dimension(:,:,:), pointer, contiguous dbsmt
Definition: modphonon.f90:116
real(8), dimension(:,:), allocatable devalsv
Definition: modphonon.f90:134
complex(8), dimension(:), allocatable gvsmt
Definition: modphonon.f90:106
complex(8), dimension(:,:,:,:,:), allocatable dhloa
Definition: modphonon.f90:122
real(8), dimension(:,:,:), allocatable gntyyy
Definition: modphonon.f90:126
complex(8), dimension(:,:), allocatable dsocfr
Definition: modphonon.f90:118
real(8) mustar
Definition: modphonon.f90:23
real(8), dimension(:,:,:), allocatable bec
Definition: modphonon.f90:36
real(8), dimension(:,:), allocatable vscph
Definition: modphonon.f90:46
real(8), dimension(:,:), allocatable vqlwrt
Definition: modphonon.f90:21
complex(8), dimension(:,:,:), pointer, contiguous dmagmt
Definition: modphonon.f90:102
integer ntemp
Definition: modphonon.f90:25
complex(8), dimension(:), pointer, contiguous dvsig
Definition: modphonon.f90:114
complex(8), dimension(:,:,:,:), allocatable sfacgkq
Definition: modphonon.f90:92
logical tephde
Definition: modphonon.f90:155
real(8), dimension(:,:,:,:), allocatable vgkql
Definition: modphonon.f90:88
complex(8), dimension(:,:,:), allocatable dynq
Definition: modphonon.f90:27
real(8), dimension(:,:), allocatable doccsv
Definition: modphonon.f90:136
integer nbph
Definition: modphonon.f90:13
real(8) dengye
Definition: modphonon.f90:142
complex(8), dimension(:), allocatable, target drhmg
Definition: modphonon.f90:98
complex(8), dimension(:,:), pointer, contiguous dvsmt
Definition: modphonon.f90:110
real(8), dimension(:,:,:), allocatable devalfv
Definition: modphonon.f90:132
integer ipph
Definition: modphonon.f90:15
complex(8), dimension(:,:), pointer, contiguous dbsir
Definition: modphonon.f90:116
real(8) wphcut
Definition: modphonon.f90:148
real(8), dimension(:,:), allocatable vgqc
Definition: modphonon.f90:62
integer isph
Definition: modphonon.f90:15
real(8), dimension(2) ephscf
Definition: modphonon.f90:150
real(8), dimension(:,:), allocatable ffacgq
Definition: modphonon.f90:74
complex(8), dimension(:), pointer, contiguous drhoir
Definition: modphonon.f90:100
real(8) dengy
Definition: modphonon.f90:146
complex(8), dimension(:), allocatable, target dvsbs
Definition: modphonon.f90:108
integer iqph
Definition: modphonon.f90:15
complex(8), dimension(:), allocatable dcfunig
Definition: modphonon.f90:76
complex(8), dimension(:,:), allocatable sfacgq
Definition: modphonon.f90:72
real(8) epsdev
Definition: modphonon.f90:128
integer, dimension(:,:), allocatable ngkq
Definition: modphonon.f90:84
logical anomalous
Definition: modphonon.f90:153
real(8) dengyph
Definition: modphonon.f90:144
real(8), dimension(:,:,:,:), allocatable vgkqc
Definition: modphonon.f90:88
integer iaph
Definition: modphonon.f90:15
real(8), dimension(:,:), allocatable vkql
Definition: modphonon.f90:54
complex(8), dimension(:,:,:,:,:,:), allocatable dhaa
Definition: modphonon.f90:120
real(8), dimension(:), allocatable gqc
Definition: modphonon.f90:64
real(8) defermi
Definition: modphonon.f90:130
real(8), dimension(:,:), allocatable wphq
Definition: modphonon.f90:31
real(8) deltaph
Definition: modphonon.f90:48
complex(8), dimension(:), allocatable dvclir
Definition: modphonon.f90:104
complex(4), dimension(:,:,:,:,:), allocatable ephmkq
Definition: modphonon.f90:157
integer, dimension(:,:,:), allocatable igkqig
Definition: modphonon.f90:86
real(8), dimension(3, 3) epsw0
Definition: modphonon.f90:38
real(8), dimension(:), allocatable gclgq
Definition: modphonon.f90:66
logical tphnat
Definition: modphonon.f90:34
integer nscph
Definition: modphonon.f90:44
complex(8), dimension(:,:), allocatable ylmgq
Definition: modphonon.f90:70
complex(8), dimension(:,:,:,:), allocatable dhlolo
Definition: modphonon.f90:124