The Elk Code
modulr.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2017 T. Mueller, 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 modulr
7 
8 !-----------------------------!
9 ! ultracell variables !
10 !-----------------------------!
11 ! ultracell lattice vectors stored column-wise
12 real(8) avecu(3,3)
13 ! ultracell reciprocal lattice vectors
14 real(8) bvecu(3,3)
15 ! ultracell volume and Brillouin zone volume
17 ! original number of k-points
18 integer nkpt0
19 ! κ-point grid sizes
20 integer ngridkpa(3)
21 ! integer grid intervals for the κ-points
22 integer intkpa(2,3)
23 ! number of κ-points
24 integer nkpa
25 ! R-vectors in Cartesian coordinates spanning the ultracell
26 real(8), allocatable :: vrcu(:,:)
27 
28 !------------------------------!
29 ! G+Q-vector variables !
30 !------------------------------!
31 ! small Q cut-off for non-zero Q-vectors
32 real(8) q0cut
33 ! G+Q-vectors in Cartesian coordinates
34 real(8), allocatable :: vgqc(:,:,:)
35 ! |G+Q| for all G+Q-vectors
36 real(8), allocatable :: gqc(:,:)
37 ! Coulomb Green's function in G+Q-space = 4π / |G+Q|²
38 real(8), allocatable :: gclgq(:,:)
39 ! spherical Bessel functions jₗ(|G+Q|Rₘₜ)
40 real(8), allocatable :: jlgqrmt(:,:,:,:)
41 ! spherical harmonics of the G+Q-vectors
42 complex(8), allocatable :: ylmgq(:,:,:)
43 ! structure factors for the G+Q-vectors
44 complex(8), allocatable :: sfacgq(:,:,:)
45 ! phase factor functions exp(iQ⋅r) in each muffin-tin
46 complex(8), allocatable :: expqmt(:,:,:)
47 
48 !---------------------------------------------------!
49 ! ultra long-range densities and potentials !
50 !---------------------------------------------------!
51 ! R-dependent density and magnetisation
52 real(8), allocatable :: rhormt(:,:,:),rhorir(:,:)
53 real(8), allocatable :: magrmt(:,:,:,:),magrir(:,:,:)
54 ! muffin-tin, interstitial and total charges each R-vector
55 real(8), allocatable :: chgmtru(:,:),chgirru(:),chgtotru(:)
56 ! muffin-tin, interstitial and total moments for each R-vector
57 real(8), allocatable :: mommtru(:,:,:),momirru(:,:),momtotru(:,:)
58 ! Q-dependent density and magnetisation
59 complex(8), allocatable :: rhoqmt(:,:,:),rhoqir(:,:)
60 complex(8), allocatable :: magqmt(:,:,:,:),magqir(:,:,:)
61 ! muffin-tin, interstitial and total charges/moments for each Q-vector
62 complex(8), allocatable :: chgmtqu(:,:),chgirqu(:),chgtotqu(:)
63 complex(8), allocatable :: mommtqu(:,:,:),momirqu(:,:),momtotqu(:,:)
64 ! trdvclr is .true. if the real-space external Coulomb potential should be read
65 ! in from file
66 logical trdvclr
67 ! Q-dependent external Coulomb potential (FFT ordering)
68 complex(8), allocatable :: vclq(:)
69 ! trdbfcr is .true. if the real-space external magnetic field in Cartesian
70 ! coordinates should be read in from file
71 logical trdbfcr
72 ! Q-dependent external magnetic field
73 complex(8), allocatable :: bfcq(:,:)
74 ! Q-dependent external muffin-tin magnetic fields
75 complex(8), allocatable :: bfcmtq(:,:,:)
76 ! global external magnetic field in Cartesian coordinates
77 real(8) bfieldcu(3)
78 ! electric field vector in Cartesian coordinates
79 real(8) efieldcu(3)
80 ! if tbdipu is .true. then the spin dipole-dipole interaction is included
81 logical tbdipu
82 ! Q-dependent magnetic dipole field
83 complex(8), allocatable :: bdipq(:,:)
84 ! Q-dependent Kohn-Sham potential and magnetic field
85 complex(8), allocatable, target :: vsbsq(:)
86 complex(8), pointer, contiguous :: vsqmt(:,:,:),vsqir(:,:)
87 complex(8), pointer, contiguous :: bsqmt(:,:,:,:),bsqir(:,:,:)
88 ! random amplitude used for initialising the long-range magnetic field
89 real(8) rndbfcu
90 ! if tplotq0 is .true. then the Q = 0 term is included when generating plots
91 logical tplotq0
92 
93 !----------------------------------------------!
94 ! eigenvalue and eigenvector variables !
95 !----------------------------------------------!
96 ! number of ultra long-range states
97 integer nstulr
98 ! long-range eigenvalues
99 real(8), allocatable :: evalu(:,:)
100 ! long-range occupation numbers
101 real(8), allocatable :: occulr(:,:)
102 
103 end module
104 
complex(8), dimension(:,:,:), pointer, contiguous vsqmt
Definition: modulr.f90:86
complex(8), dimension(:,:,:), allocatable sfacgq
Definition: modulr.f90:44
real(8), dimension(:,:,:,:), allocatable jlgqrmt
Definition: modulr.f90:40
complex(8), dimension(:,:,:), allocatable mommtqu
Definition: modulr.f90:63
complex(8), dimension(:,:), pointer, contiguous vsqir
Definition: modulr.f90:86
integer nstulr
Definition: modulr.f90:97
complex(8), dimension(:,:), allocatable bdipq
Definition: modulr.f90:83
real(8), dimension(3) efieldcu
Definition: modulr.f90:79
integer nkpt0
Definition: modulr.f90:18
integer, dimension(3) ngridkpa
Definition: modulr.f90:20
complex(8), dimension(:), allocatable chgirqu
Definition: modulr.f90:62
real(8) omegau
Definition: modulr.f90:16
real(8), dimension(3, 3) bvecu
Definition: modulr.f90:14
complex(8), dimension(:,:), allocatable chgmtqu
Definition: modulr.f90:62
complex(8), dimension(:,:,:,:), allocatable magqmt
Definition: modulr.f90:60
complex(8), dimension(:,:,:), pointer, contiguous bsqir
Definition: modulr.f90:87
complex(8), dimension(:,:,:), allocatable magqir
Definition: modulr.f90:60
real(8), dimension(:,:), allocatable chgmtru
Definition: modulr.f90:55
real(8), dimension(:,:), allocatable momirru
Definition: modulr.f90:57
complex(8), dimension(:), allocatable vclq
Definition: modulr.f90:68
real(8), dimension(3) bfieldcu
Definition: modulr.f90:77
real(8), dimension(:,:), allocatable rhorir
Definition: modulr.f90:52
real(8), dimension(:,:,:), allocatable rhormt
Definition: modulr.f90:52
real(8), dimension(:,:), allocatable occulr
Definition: modulr.f90:101
real(8) q0cut
Definition: modulr.f90:32
real(8), dimension(3, 3) avecu
Definition: modulr.f90:12
complex(8), dimension(:,:,:), allocatable ylmgq
Definition: modulr.f90:42
real(8), dimension(:,:,:), allocatable vgqc
Definition: modulr.f90:34
complex(8), dimension(:,:,:,:), pointer, contiguous bsqmt
Definition: modulr.f90:87
real(8), dimension(:,:), allocatable gqc
Definition: modulr.f90:36
real(8), dimension(:,:), allocatable vrcu
Definition: modulr.f90:26
complex(8), dimension(:,:,:), allocatable bfcmtq
Definition: modulr.f90:75
logical trdbfcr
Definition: modulr.f90:71
complex(8), dimension(:,:,:), allocatable rhoqmt
Definition: modulr.f90:59
real(8), dimension(:,:,:), allocatable mommtru
Definition: modulr.f90:57
complex(8), dimension(:,:), allocatable bfcq
Definition: modulr.f90:73
real(8), dimension(:,:,:,:), allocatable magrmt
Definition: modulr.f90:53
complex(8), dimension(:,:), allocatable momirqu
Definition: modulr.f90:63
real(8), dimension(:,:,:), allocatable magrir
Definition: modulr.f90:53
real(8), dimension(:,:), allocatable gclgq
Definition: modulr.f90:38
real(8) omegabzu
Definition: modulr.f90:16
integer, dimension(2, 3) intkpa
Definition: modulr.f90:22
Definition: modulr.f90:6
real(8), dimension(:), allocatable chgtotru
Definition: modulr.f90:55
real(8), dimension(:), allocatable chgirru
Definition: modulr.f90:55
integer nkpa
Definition: modulr.f90:24
complex(8), dimension(:), allocatable, target vsbsq
Definition: modulr.f90:85
complex(8), dimension(:,:), allocatable momtotqu
Definition: modulr.f90:63
real(8), dimension(:,:), allocatable evalu
Definition: modulr.f90:99
complex(8), dimension(:,:,:), allocatable expqmt
Definition: modulr.f90:46
logical trdvclr
Definition: modulr.f90:66
real(8), dimension(:,:), allocatable momtotru
Definition: modulr.f90:57
complex(8), dimension(:), allocatable chgtotqu
Definition: modulr.f90:62
logical tplotq0
Definition: modulr.f90:91
logical tbdipu
Definition: modulr.f90:81
complex(8), dimension(:,:), allocatable rhoqir
Definition: modulr.f90:59
real(8) rndbfcu
Definition: modulr.f90:89