The Elk Code
 
Loading...
Searching...
No Matches
xc_xalpha.f90
Go to the documentation of this file.
1
2! Copyright (C) 1998-2006 ABINIT group (DCA, XG, GMR).
3! This file is distributed under the terms of the GNU Lesser General Public
4! License. See the file COPYING for license details.
5
6!BOP
7! !ROUTINE: xc_xalpha
8! !INTERFACE:
9subroutine xc_xalpha(n,rho,exc,vxc)
10! !INPUT/OUTPUT PARAMETERS:
11! n : number of density points (in,integer)
12! rho : charge density (in,real(n))
13! exc : exchange-correlation energy density (out,real(n))
14! vxc : exchange-correlation potential (out,real(n))
15! !DESCRIPTION:
16! $X_{\alpha}$ approximation to the exchange-correlation potential and energy
17! density. See J. C. Slater, {\it Phys. Rev.} {\bf 81}, 385 (1951).
18!
19! !REVISION HISTORY:
20! Modified an ABINIT routine, September 2006 (JKD)
21!EOP
22!BOC
23implicit none
24! arguments
25integer, intent(in) :: n
26real(8), intent(in) :: rho(n)
27real(8), intent(out) :: exc(n),vxc(n)
28! local variables
29integer i
30real(8), parameter :: pi=3.1415926535897932385d0
31real(8), parameter :: alpha=1.d0
32real(8) r,efac,rs,rsm1,vfac
33vfac=(1.5d0/pi)**(2.d0/3.d0)
34efac=0.75d0*vfac
35! loop over density points
36do i=1,n
37 r=rho(i)
38 if (r > 1.d-12) then
39 rs=(3.d0/(4.d0*pi*r))**(1.d0/3.d0)
40 rsm1=1.0d0/rs
41! compute energy density
42 exc(i)=-alpha*efac*rsm1
43! compute potential
44 vxc(i)=-alpha*vfac*rsm1
45 end if
46end do
47end subroutine
48!EOC
49
subroutine xc_xalpha(n, rho, exc, vxc)
Definition xc_xalpha.f90:10