2020-07-02 14:27:38 +02:00
|
|
|
subroutine unrestricted_correlation_potential(rung,DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
! Compute the correlation potential
|
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
|
|
|
integer,intent(in) :: rung
|
|
|
|
character(len=12),intent(in) :: DFA
|
|
|
|
integer,intent(in) :: nEns
|
|
|
|
double precision,intent(in) :: wEns(nEns)
|
|
|
|
integer,intent(in) :: nGrid
|
|
|
|
double precision,intent(in) :: weight(nGrid)
|
|
|
|
integer,intent(in) :: nBas
|
|
|
|
double precision,intent(in) :: AO(nBas,nGrid)
|
|
|
|
double precision,intent(in) :: dAO(ncart,nBas,nGrid)
|
|
|
|
double precision,intent(in) :: rho(nGrid,nspin)
|
|
|
|
double precision,intent(in) :: drho(ncart,nGrid,nspin)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
double precision,allocatable :: FcLDA(:,:,:)
|
|
|
|
double precision,allocatable :: FcGGA(:,:,:)
|
|
|
|
double precision :: aC
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision,intent(out) :: Fc(nBas,nBas,nspin)
|
|
|
|
|
|
|
|
! Memory allocation
|
|
|
|
|
|
|
|
select case (rung)
|
|
|
|
|
|
|
|
! Hartree calculation
|
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
case(0)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
Fc(:,:,:) = 0d0
|
|
|
|
|
|
|
|
! LDA functionals
|
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
case(1)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
call unrestricted_lda_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,rho,Fc)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
! GGA functionals
|
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
case(2)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
call unrestricted_gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-02-13 23:09:52 +01:00
|
|
|
! MGGA functionals
|
|
|
|
|
|
|
|
case(3)
|
|
|
|
|
|
|
|
call unrestricted_mgga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
|
|
|
|
|
2019-03-13 11:07:31 +01:00
|
|
|
! Hybrid functionals
|
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
case(4)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
allocate(FcLDA(nBas,nBas,nspin),FcGGA(nBas,nBas,nspin))
|
|
|
|
|
|
|
|
aC = 0.81d0
|
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
call unrestricted_lda_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,rho,FcLDA)
|
|
|
|
call unrestricted_gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,FcGGA)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
Fc(:,:,:) = FcLDA(:,:,:) + aC*(FcGGA(:,:,:) - FcLDA(:,:,:))
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
end select
|
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
end subroutine unrestricted_correlation_potential
|