4
1
mirror of https://github.com/pfloos/quack synced 2024-06-26 15:12:17 +02:00
quack/src/eDFT/US51_lda_exchange_energy.f90

54 lines
1.1 KiB
Fortran
Raw Normal View History

2020-07-06 15:42:21 +02:00
subroutine US51_lda_exchange_energy(nGrid,weight,rho,Ex)
2019-03-13 11:07:31 +01:00
! Compute Slater's LDA exchange energy
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
double precision,intent(in) :: rho(nGrid)
! Local variables
integer :: iG
2020-07-02 14:27:38 +02:00
double precision :: alpha,r,alphaw,a2,b2,c2,a1,b1,c1
2019-03-13 11:07:31 +01:00
! Output variables
double precision :: Ex
2020-07-02 14:27:38 +02:00
! Cxw2 parameters for He N->N+1
! a2 = 0.135068d0
! b2 = -0.00774769d0
! c2 = -0.0278205d0
! Cxw1 parameters for He N->N-1
! a1 = 0.420243d0
! b1 = 0.0700561d0
! c1 = -0.288301d0
2019-03-13 11:07:31 +01:00
! Cx coefficient for Slater LDA exchange
alpha = -(3d0/2d0)*(3d0/(4d0*pi))**(1d0/3d0)
2020-07-02 14:27:38 +02:00
! alphaw = alpha*(1d0 - wEns(2)*(1d0 - wEns(2))*(a1 + b1*(wEns(2) - 0.5d0) + c1*(wEns(2) - 0.5d0)**2))
2019-03-13 11:07:31 +01:00
! Compute LDA exchange energy
Ex = 0d0
do iG=1,nGrid
r = max(0d0,rho(iG))
if(r > threshold) then
Ex = Ex + weight(iG)*alpha*r**(4d0/3d0)
endif
enddo
2020-07-02 14:27:38 +02:00
end subroutine US51_lda_exchange_energy