The Elk Code
 
Loading...
Searching...
No Matches
gengclgq.f90
Go to the documentation of this file.
1
2! Copyright (C) 2017 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
6pure subroutine gengclgq(treg,iq,ngq,gqc,gclgq)
7use modmain
8implicit none
9! arguments
10logical, intent(in) :: treg
11integer, intent(in) :: iq,ngq
12real(8), intent(in) :: gqc(ngq)
13real(8), intent(out) :: gclgq(ngq)
14! local variables
15integer ig
16real(8) t1,t2
17if (treg) then
18! regularise 1/(G+q)² for G+q in the first Brillouin zone
19 t1=sqrt(vqc(1,iq)**2+vqc(2,iq)**2+vqc(3,iq)**2)
20 do ig=1,ngq
21 t2=gqc(ig)
22 if (abs(t1-t2) < epslat) then
23 gclgq(ig)=gclq(iq)
24 else if (t2 > epslat) then
25 gclgq(ig)=fourpi/t2**2
26 else
27 gclgq(ig)=0.d0
28 end if
29 end do
30else
31! no regularisation
32 do ig=1,ngq
33 t1=gqc(ig)
34 if (t1 > epslat) then
35 gclgq(ig)=fourpi/t1**2
36 else
37 gclgq(ig)=0.d0
38 end if
39 end do
40end if
41end subroutine
42
pure subroutine gengclgq(treg, iq, ngq, gqc, gclgq)
Definition gengclgq.f90:7
real(8), dimension(:), allocatable gclq
Definition modmain.f90:553
real(8), parameter fourpi
Definition modmain.f90:1231
real(8), dimension(:,:), allocatable vqc
Definition modmain.f90:547
real(8) epslat
Definition modmain.f90:24