2020-04-01 22:59:52 +02:00
|
|
|
subroutine RMFL20_lda_exchange_individual_energy(LDA_centered,nEns,wEns,nGrid,weight,rhow,rho,Ex)
|
2020-03-17 11:29:29 +01:00
|
|
|
|
|
|
|
! Compute the restricted version of the Marut-Fromager-Loos 2020 weight-dependent exchange functional
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
2020-04-01 22:59:52 +02:00
|
|
|
logical,intent(in) :: LDA_centered
|
2020-03-17 11:29:29 +01:00
|
|
|
integer,intent(in) :: nEns
|
|
|
|
double precision,intent(in) :: wEns(nEns)
|
|
|
|
integer,intent(in) :: nGrid
|
|
|
|
double precision,intent(in) :: weight(nGrid)
|
|
|
|
double precision,intent(in) :: rhow(nGrid)
|
|
|
|
double precision,intent(in) :: rho(nGrid)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iG
|
|
|
|
double precision :: Cxw
|
|
|
|
double precision :: r,rI
|
2020-04-06 19:40:42 +02:00
|
|
|
double precision :: e_p,dedr
|
2020-03-17 11:29:29 +01:00
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: Ex
|
|
|
|
|
|
|
|
! Weight-dependent Cx coefficient for RMFL20 exchange functional
|
|
|
|
|
2020-03-29 18:34:09 +02:00
|
|
|
if(LDA_centered) then
|
|
|
|
Cxw = CxLDA + (Cx1 - Cx0)*wEns(2)
|
|
|
|
else
|
|
|
|
Cxw = wEns(1)*Cx0 + wEns(2)*Cx1
|
|
|
|
end if
|
|
|
|
|
2020-03-17 11:29:29 +01:00
|
|
|
! Compute LDA exchange matrix in the AO basis
|
|
|
|
|
|
|
|
Ex = 0d0
|
|
|
|
do iG=1,nGrid
|
|
|
|
|
|
|
|
r = max(0d0,rhow(iG))
|
|
|
|
rI = max(0d0,rho(iG))
|
|
|
|
|
|
|
|
if(r > threshold .and. rI > threshold) then
|
2020-04-01 22:59:52 +02:00
|
|
|
|
2020-04-06 19:40:42 +02:00
|
|
|
e_p = Cxw*r**(1d0/3d0)
|
2020-03-17 11:29:29 +01:00
|
|
|
dedr = 1d0/3d0*Cxw*r**(-2d0/3d0)
|
2020-04-06 19:40:42 +02:00
|
|
|
Ex = Ex + weight(iG)*(e_p*rI + dedr*r*rI - dedr*r*r)
|
2020-04-01 22:59:52 +02:00
|
|
|
|
2020-03-17 11:29:29 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
end subroutine RMFL20_lda_exchange_individual_energy
|