Commit 2ee48ec3 authored by Matthias Redies's avatar Matthias Redies

rename this so it compiles

parent d223655c
......@@ -122,7 +122,7 @@ CONTAINS
call juDFT_error("Can't use XC-parrent class")
END SUBROUTINE xcpot_get_vxc
SUBROUTINE xcpot_get_exc(xcpot,jspins,rh,exc,grad,kinEnergyDen)
SUBROUTINE xcpot_get_exc(xcpot,jspins,rh,exc,grad,kinEnergyDen_KS)
USE m_types_misc
USE m_judft
USE, INTRINSIC :: IEEE_ARITHMETIC
......@@ -136,7 +136,7 @@ CONTAINS
!---> xc energy density
REAL, INTENT (OUT) :: exc (:)
TYPE(t_gradients),OPTIONAL,INTENT(IN) :: grad
REAL, INTENT(IN), OPTIONAL :: kinEnergyDen(:,:)
REAL, INTENT(IN), OPTIONAL :: kinEnergyDen_KS(:,:)
exc = 0.0
call juDFT_error("Can't use XC-parrent class")
......
......@@ -259,7 +259,7 @@ CONTAINS
END SUBROUTINE xcpot_get_vxc
!***********************************************************************
SUBROUTINE xcpot_get_exc(xcpot,jspins,rh,exc,grad,kinEnergyDen)
SUBROUTINE xcpot_get_exc(xcpot,jspins,rh,exc,grad,kinEnergyDen_KS)
!***********************************************************************
USE m_xcxal, ONLY : excxal
USE m_xcwgn, ONLY : excwgn
......@@ -277,7 +277,7 @@ CONTAINS
REAL,INTENT (IN) :: rh(:,:)
REAL, INTENT (OUT) :: exc(:)
TYPE(t_gradients),OPTIONAL,INTENT(IN) ::grad
REAL, INTENT(IN), OPTIONAL :: kinEnergyDen(:,:)
REAL, INTENT(IN), OPTIONAL :: kinEnergyDen_KS(:,:)
!c
!c ---> local scalars
......
......@@ -274,14 +274,15 @@ CONTAINS
! (-0.5 is applied below)
REAL, INTENT(IN), OPTIONAL :: kinEnergyDen_KS(:,:)
! tau = 0.5 * sum[|grad phi_i(r)|²]
! see eq (3) in https://doi.org/10.1063/1.1565316
REAL, ALLOCATABLE :: kinEnergyDen_libXC(:,:)
#ifdef CPP_LIBXC
TYPE(xc_f03_func_info_t) :: xc_info
REAL :: excc(SIZE(exc))
! tau = 0.5 * sum[|grad phi_i(r)|²]
! see eq (3) in https://doi.org/10.1063/1.1565316
REAL, ALLOCATABLE :: kinEnergyDen_libXC(:,:)
IF (xcpot%exc_is_gga()) THEN
IF (.NOT.PRESENT(grad)) CALL judft_error("Bug: You called get_exc for a GGA potential without providing derivatives")
CALL xc_f03_gga_exc(xcpot%exc_func_x, SIZE(rh,1), TRANSPOSE(rh),grad%sigma,exc)
......@@ -296,7 +297,7 @@ CONTAINS
exc=exc+excc
END IF
ELSEIF(xcpot%exc_is_MetaGGA()) THEN
IF(PRESENT(kinEnergyDen)) THEN
IF(PRESENT(kinEnergyDen_KS)) THEN
! apply correction in eq (4) in https://doi.org/10.1063/1.1565316
kinEnergyDen_libXC = transpose(0.25 * grad%laplace - 0.5 * kinEnergyDen_KS)
call xc_f03_mgga_exc(xcpot%exc_func_x, SIZE(rh,1), TRANSPOSE(rh), grad%sigma, &
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment