1
!{\src2tex{textfont=tt}}
2
!!****f* ABINIT/ckxcldag
7
!! Calculate exchange-correlation kernel Kxclda in G-space
8
!! put it into Kxclda in igfft form
9
!! (Needed only if GWGamma calculation - not operational ?!)
12
!! Copyright (C) 1999-2007 ABINIT group (GMR, VO, LR, RWG)
13
!! This file is distributed under the terms of the
14
!! GNU General Public License, see ~abinit/COPYING
15
!! or http://www.gnu.org/copyleft/gpl.txt .
16
!! For the initials of contributors, see ~abinit/doc/developers/contributors.txt .
19
!! ngfft1,ngfft1a,ngfft2,ngfft3=FFT grid dimensions
20
!! nr=number of points of FFT grid
21
!! rho2(nr)=density in real space
24
!! kxclda(nr)=XC kernel in reciprocal space
34
#if defined HAVE_CONFIG_H
38
subroutine ckxcldag(ngfft1,ngfft1a,ngfft2,ngfft3,nr,rho2,kxclda)
43
!This section has been created automatically by the script Abilint (TD). Do not modify these by hand.
44
#ifdef HAVE_FORTRAN_INTERFACES
46
use interfaces_15gw, except_this_one => ckxcldag
48
!End of the abilint section
52
!Arguments ------------------------------------
54
integer,intent(in) :: ngfft1,ngfft1a,ngfft2,ngfft3,nr
56
real(dp),intent(in) :: rho2(nr)
57
complex,intent(out) :: kxclda(nr)
59
!Local variables-------------------------------
63
type(MPI_type) :: mpi_enreg
66
real(dp),allocatable :: kxcldag(:,:),kxcldar(:,:)
68
! *************************************************************************
70
allocate(kxcldar(2,nr),kxcldag(2,nr))
72
call ckxcldar(nr,rho2,kxclda)
73
kxcldar(1,:)=real(kxclda(:))
74
kxcldar(2,:)=aimag(kxclda(:))
76
write(6,*) 'fft kxclda(r)->kxclda(g)'
79
!call c3dfft(kxclda,ngfft1a,ngfft2,ngfft3,ngfft1,ngfft2,ngfft3,-1)
83
ngfft(4)=2*(ngfft(1)/2)+1
84
ngfft(5)=2*(ngfft(2)/2)+1
97
call fourdp(2,kxcldag,kxcldar,-1,mpi_enreg,nr,ngfft,tim_fourdp)
100
! kxcg(ig)=Kxclda(igfft(ig,3,3,3))*fftfct
103
!renormalization after fft
104
!fftfct=1/real(ngfft1*ngfft2*ngfft3)
105
!kxclda(:)=kxclda(:)*fftfct
106
kxclda(:)=kxcldag(1,:)+(0.0,1.0)*kxcldag(2,:)
108
deallocate(kxcldar,kxcldag)
110
end subroutine ckxcldag