2020-10-14 23:31:14 +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
|
2021-02-15 17:27:06 +01:00
|
|
|
double precision :: r
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2020-10-14 16:02:09 +02:00
|
|
|
! Output variables
|
2020-07-02 14:27:38 +02:00
|
|
|
|
2020-10-14 23:31:14 +02:00
|
|
|
double precision :: Ex
|
|
|
|
|
|
|
|
! Compute LDA exchange energy
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2020-10-14 23:31:14 +02:00
|
|
|
Ex = 0d0
|
|
|
|
do iG=1,nGrid
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-12-01 10:54:51 +01:00
|
|
|
r = max(0d0,rho(iG))
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-12-01 10:54:51 +01:00
|
|
|
if(r > threshold) Ex = Ex + weight(iG)*CxLSDA*r**(1d0/3d0)*r
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2020-10-14 23:31:14 +02:00
|
|
|
enddo
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
end subroutine US51_lda_exchange_energy
|