4
1
mirror of https://github.com/pfloos/quack synced 2024-06-21 12:42:15 +02:00
quack/src/eDFT/unrestricted_gga_correlation_energy.f90
2020-07-02 14:27:38 +02:00

43 lines
1023 B
Fortran

subroutine unrestricted_gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
! Compute unrstricted GGA correlation energy
implicit none
include 'parameters.h'
! Input variables
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)
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)
! Coefficients for ??? GGA exchange functional
! Compute GGA exchange energy
Ec(:) = 0d0
do iG=1,nGrid
ra = rho(iG,1)
rb = rho(iG,2)
ga = drho(1,iG,1)**2 + drho(2,iG,1)**2 + drho(3,iG,1)**2
gb = drho(1,iG,2)**2 + drho(2,iG,2)**2 + drho(3,iG,2)**2
enddo
end subroutine unrestricted_gga_correlation_energy