2020-03-15 08:24:15 +01:00
|
|
|
subroutine RMFL20_lda_exchange_energy(nEns,wEns,nGrid,weight,rho,Ex)
|
|
|
|
|
2020-03-15 20:33:18 +01:00
|
|
|
! Compute the restricted version of the Marut-Fromager-Loos weight-dependent exchange functional
|
|
|
|
! The RMFL20 is a two-state, single-weight exchange functional
|
2020-03-15 08:24:15 +01:00
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: nEns
|
|
|
|
double precision,intent(in) :: wEns(nEns)
|
|
|
|
integer,intent(in) :: nGrid
|
|
|
|
double precision,intent(in) :: weight(nGrid)
|
|
|
|
double precision,intent(in) :: rho(nGrid)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iG
|
2020-03-15 14:33:53 +01:00
|
|
|
double precision :: Cx0
|
|
|
|
double precision :: Cx1
|
2020-03-15 08:24:15 +01:00
|
|
|
double precision :: CxLDA
|
|
|
|
double precision :: Cxw
|
|
|
|
double precision :: r
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision :: Ex
|
|
|
|
|
|
|
|
! Cx coefficient for Slater LDA exchange
|
|
|
|
|
2020-03-17 11:29:20 +01:00
|
|
|
Cx0 = - (4d0/3d0)*(1d0/pi)**(1d0/3d0)
|
|
|
|
Cx1 = - (176d0/105d0)*(1d0/pi)**(1d0/3d0)
|
|
|
|
CxLDA = - (3d0/4d0)*(3d0/pi)**(1d0/3d0)
|
2020-03-15 08:24:15 +01:00
|
|
|
|
2020-03-17 11:29:20 +01:00
|
|
|
Cxw = CxLDA + wEns(2)*(Cx1 - Cx0)
|
2020-03-15 08:24:15 +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)*Cxw*r**(4d0/3d0)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
end subroutine RMFL20_lda_exchange_energy
|