4
1
mirror of https://github.com/pfloos/quack synced 2024-06-27 23:52:19 +02:00
quack/src/eDFT/RMFL20_lda_correlation_individual_energy.f90

60 lines
1.5 KiB
Fortran
Raw Normal View History

2020-03-15 22:37:40 +01:00
subroutine RMFL20_lda_correlation_individual_energy(nEns,wEns,nGrid,weight,rhow,rho,Ec)
! Compute eLDA correlation energy
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) :: rhow(nGrid)
double precision,intent(in) :: rho(nGrid)
! Local variables
2020-03-29 18:34:09 +02:00
logical :: LDA_centered = .true.
2020-03-15 22:37:40 +01:00
integer :: iEns
double precision :: EcLDA
double precision,allocatable :: aMFL(:,:)
double precision,allocatable :: EceLDA(:)
! Output variables
double precision :: Ec
! Allocation
allocate(aMFL(3,nEns),EceLDA(nEns))
! Parameters for weight-dependent LDA correlation functional
aMFL(1,1) = -0.0238184d0
aMFL(2,1) = +0.00540994d0
aMFL(3,1) = +0.0830766d0
aMFL(1,2) = -0.0144633d0
aMFL(2,2) = -0.0506019d0
aMFL(3,2) = +0.0331417d0
2020-03-17 19:35:00 +01:00
! Compute correlation energy for ground- and doubly-excited states
2020-03-15 22:37:40 +01:00
do iEns=1,nEns
call restricted_elda_correlation_individual_energy(nEns,aMFL(:,iEns),nGrid,weight(:),rhow(:),rho(:),EceLDA(iEns))
end do
! LDA-centered functional
2020-03-17 19:35:00 +01:00
call RVWN5_lda_correlation_individual_energy(nGrid,weight(:),rhow(:),rho(:),EcLDA)
2020-03-15 22:37:40 +01:00
2020-03-31 12:39:26 +02:00
if(LDA_centered) EceLDA(:) = EceLDA(:) + EcLDA - EceLDA(1)
2020-03-15 22:37:40 +01:00
! Weight-denpendent functional for ensembles
2020-03-31 12:39:26 +02:00
Ec = dot_product(wEns(:),EceLDA(:))
2020-03-15 22:37:40 +01:00
end subroutine RMFL20_lda_correlation_individual_energy