4
1
mirror of https://github.com/pfloos/quack synced 2024-07-17 00:20:37 +02:00
quack/src/eDFT/US51_lda_exchange_individual_energy.f90

42 lines
828 B
Fortran
Raw Normal View History

2021-11-29 23:32:49 +01:00
subroutine US51_lda_exchange_individual_energy(nGrid,weight,rhow,Ex)
2020-07-02 14:27:38 +02:00
! Compute the restricted version of Slater's LDA exchange individual energy
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
double precision,intent(in) :: rhow(nGrid)
! Local variables
integer :: iG
2021-11-29 23:32:49 +01:00
double precision :: r
double precision :: dedr
2020-07-02 14:27:38 +02:00
! Output variables
double precision,intent(out) :: Ex
! Compute LDA exchange matrix in the AO basis
2021-11-29 23:32:49 +01:00
Ex = 0d0
2020-07-02 14:27:38 +02:00
do iG=1,nGrid
r = max(0d0,rhow(iG))
2020-07-06 15:42:21 +02:00
if(r > threshold) then
2020-07-02 14:27:38 +02:00
2021-02-15 17:27:06 +01:00
dedr = 1d0/3d0*CxLSDA*r**(-2d0/3d0)
2020-07-02 14:27:38 +02:00
2021-11-29 23:32:49 +01:00
Ex = Ex - weight(iG)*dedr*r*r
2020-07-02 14:27:38 +02:00
endif
enddo
end subroutine US51_lda_exchange_individual_energy