The Elk Code
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:
9 subroutine 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
23 implicit none
24 ! arguments
25 integer, intent(in) :: n
26 real(8), intent(in) :: rho(n)
27 real(8), intent(out) :: exc(n),vxc(n)
28 ! local variables
29 integer i
30 real(8), parameter :: pi=3.1415926535897932385d0
31 real(8), parameter :: alpha=1.d0
32 real(8) r,efac,rs,rsm1,vfac
33 vfac=(1.5d0/pi)**(2.d0/3.d0)
34 efac=0.75d0*vfac
35 ! loop over density points
36 do 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
46 end do
47 end subroutine
48 !EOC
49 
subroutine xc_xalpha(n, rho, exc, vxc)
Definition: xc_xalpha.f90:10