4
1
mirror of https://github.com/pfloos/quack synced 2024-11-13 01:23:59 +01:00
quack/src/eDFT/RS51_lda_exchange_energy.f90

39 lines
691 B
Fortran
Raw Normal View History

2020-03-15 14:33:53 +01:00
subroutine RS51_lda_exchange_energy(nGrid,weight,rho,Ex)
! Compute restriced version of 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-03-16 22:08:04 +01:00
double precision :: r
2020-03-15 14:33:53 +01:00
! Output variables
double precision :: Ex
! Compute LDA exchange energy
Ex = 0d0
do iG=1,nGrid
r = max(0d0,rho(iG))
if(r > threshold) then
2020-03-18 16:06:29 +01:00
Ex = Ex + weight(iG)*CxLDA*r**(4d0/3d0)
2020-03-15 14:33:53 +01:00
endif
enddo
end subroutine RS51_lda_exchange_energy