2020-04-01 22:59:52 +02:00
|
|
|
subroutine RMFL20_lda_exchange_energy(LDA_centered,nEns,wEns,nGrid,weight,rho,Ex)
|
2020-03-15 08:24:15 +01:00
|
|
|
|
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
|
|
|
|
|
2020-04-01 22:59:52 +02:00
|
|
|
logical,intent(in) :: LDA_centered
|
2020-03-15 08:24:15 +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) :: rho(nGrid)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iG
|
|
|
|
double precision :: Cxw
|
|
|
|
double precision :: r
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision :: Ex
|
|
|
|
|
2020-03-18 16:06:29 +01:00
|
|
|
! Weight-denepdent Cx coefficient
|
2020-03-15 08:24:15 +01:00
|
|
|
|
2020-03-29 18:34:09 +02:00
|
|
|
if(LDA_centered) then
|
2020-04-06 19:40:42 +02:00
|
|
|
Cxw = CxLDA + (Cx1 - Cx0)*wEns(2)
|
2020-03-29 18:34:09 +02:00
|
|
|
else
|
|
|
|
Cxw = wEns(1)*Cx0 + wEns(2)*Cx1
|
|
|
|
end if
|
|
|
|
|
2020-03-15 08:24:15 +01:00
|
|
|
! Compute LDA exchange energy
|
|
|
|
|
|
|
|
Ex = 0d0
|
2020-03-31 12:39:26 +02:00
|
|
|
|
2020-03-15 08:24:15 +01:00
|
|
|
do iG=1,nGrid
|
2020-03-31 12:39:26 +02:00
|
|
|
|
2020-03-15 08:24:15 +01:00
|
|
|
r = max(0d0,rho(iG))
|
2020-03-31 12:39:26 +02:00
|
|
|
|
2020-03-15 08:24:15 +01:00
|
|
|
if(r > threshold) then
|
|
|
|
Ex = Ex + weight(iG)*Cxw*r**(4d0/3d0)
|
|
|
|
endif
|
2020-03-31 12:39:26 +02:00
|
|
|
|
2020-03-15 08:24:15 +01:00
|
|
|
enddo
|
|
|
|
|
|
|
|
end subroutine RMFL20_lda_exchange_energy
|