2020-07-02 14:27:38 +02:00
|
|
|
subroutine unrestricted_gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-02-12 16:47:40 +01:00
|
|
|
! Compute unrestricted GGA correlation energy
|
2019-03-13 11:07:31 +01:00
|
|
|
|
|
|
|
implicit none
|
|
|
|
include 'parameters.h'
|
|
|
|
|
|
|
|
! Input variables
|
|
|
|
|
2021-10-25 12:20:25 +02:00
|
|
|
integer,intent(in) :: DFA
|
2019-03-13 11:07:31 +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,nspin)
|
|
|
|
double precision,intent(in) :: drho(ncart,nGrid,nspin)
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
|
|
|
|
integer :: iG
|
|
|
|
double precision :: ra,rb,ga,gb
|
|
|
|
|
|
|
|
! Output variables
|
|
|
|
|
|
|
|
double precision :: Ec(nsp)
|
|
|
|
|
2021-02-12 16:47:40 +01:00
|
|
|
select case (DFA)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-10-25 12:20:25 +02:00
|
|
|
case (1)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-02-12 16:47:40 +01:00
|
|
|
call ULYP_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-10-25 12:20:25 +02:00
|
|
|
case (2)
|
2021-03-01 14:55:29 +01:00
|
|
|
|
|
|
|
call UPBE_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
|
|
|
|
|
2021-02-12 16:47:40 +01:00
|
|
|
case default
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-02-12 16:47:40 +01:00
|
|
|
call print_warning('!!! GGA correlation energy not available !!!')
|
|
|
|
stop
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2021-02-12 16:47:40 +01:00
|
|
|
end select
|
2019-03-13 11:07:31 +01:00
|
|
|
|
2020-07-02 14:27:38 +02:00
|
|
|
end subroutine unrestricted_gga_correlation_energy
|