Commit f70884dc authored by Matthias Redies's avatar Matthias Redies

correct for r^2 factor in density storage

parent 18f6541c
......@@ -133,6 +133,12 @@ CONTAINS
! use updated vTot for exc calculation
IF(perform_MetaGGA) THEN
CALL mt_to_grid(xcpot, input%jspins, atoms,sphhar,EnergyDen%mt(:,0:,n,:),nsp,n,tmp_grad,ED_rs)
! multiply potentials with r^2, because mt_to_grid is made for densities,
! which are stored with a factor r^2
DO jr=1,atmos%jri(n)
vTot%mt(jr,0:,n,:) = vTot(jr,0:,n,:)*atoms%rmsh(jr,n)**2
ENDDO
CALL mt_to_grid(xcpot, input%jspins, atoms,sphhar,vTot%mt(:,0:,n,:),nsp,n,tmp_grad,vTot_rs)
CALL calc_kinEnergyDen(ED_rs, vTot_rs, ch, kinED_rs)
......
......@@ -20,14 +20,14 @@ MODULE m_metagga
PROCEDURE multiply_RS
END INTERFACE OPERATOR (*)
CONTAINS
SUBROUTINE calc_kinEnergyDen(EnergyDen_rs, vTot_rs, den_rs, kinEnergyDen_rs)
SUBROUTINE calc_kinEnergyDen(EnergyDen_rs, vTot_rs, den_rs, kinEnergyDen_RS)
#ifdef CPP_LIBXC
IMPLICIT NONE
REAL, INTENT(in) :: den_RS(:,:), EnergyDen_RS(:,:), vTot_RS(:,:)
REAL, INTENT(inout), allocatable :: kinEnergyDen_rs(:,:)
REAL, INTENT(inout), allocatable :: kinEnergyDen_RS(:,:)
!implicit allocation
kinEnergyDen_rs = EnergyDen_RS - vTot_RS * den_RS
kinEnergyDen_RS = EnergyDen_RS - vTot_RS * den_RS
#else
USE m_juDFT_stop
CALL juDFT_error("MetaGGA require LibXC",hint="compile Fleur with LibXC (e.g. by giving '-external libxc' to ./configure")
......
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