Commit 53438780 authored by Matthias Redies's avatar Matthias Redies

now it should compile

parent e15d595b
......@@ -79,22 +79,11 @@ CONTAINS
CALL pw_from_grid(xcpot,stars,input%total,v_xc,vTot%pw,vTot%pw_w)
CALL pw_from_grid(xcpot,stars,input%total,v_x,vx%pw,vx%pw_w)
! use updated vTot for exc calculation
IF(ALLOCATED(EnergyDen%pw) .AND. xcpot%exc_is_MetaGGA()) THEN
CALL pw_to_grid(xcpot, input%jspins, noco%l_noco, stars, &
cell, EnergyDen%pw, tmp_grad, ED_rs)
CALL pw_to_grid(xcpot, input%jspins, noco%l_noco, stars, &
cell, vTot%pw, tmp_grad, vTot_rs)
CALL calc_kinEnergyDen_pw(ED_rs, vTot_rs, rho, xcpot%kinED%is)
xcpot%kinED%set = .True.
!calculate the ex.-cor energy density
ALLOCATE ( e_xc(SIZE(rho,1),1) ); e_xc=0.0
IF(ALLOCATED(EnergyDen%pw) .AND. xcpot%exc_is_MetaGGA()) THEN
IF(xcpot%kinED%set) THEN
CALL xcpot%get_exc(input%jspins,rho,e_xc(:,1),grad, xcpot%kinED%is, mt_call=.False.)
CALL xcpot%get_exc(input%jspins,rho,e_xc(:,1),grad, mt_call=.False.)
......@@ -88,15 +88,6 @@
IF (xcpot%needs_grad()) CALL xcpot%alloc_gradients(SIZE(ch,1),input%jspins,grad)
IF (perform_MetaGGA) THEN
IF (xcpot%needs_grad()) CALL xcpot%alloc_gradients(SIZE(ch,1),input%jspins,tmp_grad)
ALLOCATE(ED_rs, mold=ch)
ALLOCATE(vTot_rs, mold=ch)
ALLOCATE(vTot0_rs, mold=vTot_rs)
ALLOCATE(core_den_rs, mold=ch)
ALLOCATE(val_den_rs, mold=ch)
CALL init_mt_grid(input%jspins,atoms,sphhar,xcpot,sym)
#ifdef CPP_MPI
......@@ -148,31 +139,6 @@
CALL mt_from_grid(atoms,sphhar,n,input%jspins,v_xc,vTot%mt(:,0:,n,:))
CALL mt_from_grid(atoms,sphhar,n,input%jspins,v_x,vx%mt(:,0:,n,:))
IF(perform_MetaGGA) THEN
CALL mt_to_grid(xcpot, input%jspins, atoms, sphhar, EnergyDen%mt(:,0:,n,:), &
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
vTot_tmp = vTot
DO jr=1,atoms%jri(n)
vTot_tmp%mt(jr,0:,n,:) = vTot_tmp%mt(jr,0:,n,:) * atoms%rmsh(jr,n)**2
CALL mt_to_grid(xcpot, input%jspins, atoms, sphhar, vTot_tmp%mt(:,0:,n,:), &
n, tmp_grad, vTot_rs)
tmp_sphhar%nlhd = sphhar%nlhd
tmp_sphhar%nlh = [(0, cnt=1,size(sphhar%nlh))]
CALL mt_to_grid(xcpot, input%jspins, atoms, tmp_sphhar, vTot_tmp%mt(:,0:0,n,:), &
n, tmp_grad, vTot0_rs)
CALL mt_to_grid(xcpot, input%jspins, atoms, sphhar, &
xcpot%core_den%mt(:,0:,n,:), n, tmp_grad, core_den_rs)
CALL mt_to_grid(xcpot, input%jspins, atoms, sphhar, &
xcpot%val_den%mt(:,0:,n,:), n, tmp_grad, val_den_rs)
CALL calc_kinEnergyDen_mt(ED_rs, vTot_rs, vTot0_rs, &
core_den_rs, val_den_rs, n, nsp, xcpot%kinED%mt(:,:,loc_n))
xcpot%kinED%set = .True.
......@@ -5,7 +5,9 @@
MODULE m_metagga
PUBLIC :: calc_EnergyDen
PRIVATE :: calc_EnergyDen_auxillary_weights
PRIVATE :: calc_EnergyDen_auxillary_weights, &
calc_kinEnergyDen_pw, &
type t_RS_potden
REAL, ALLOCATABLE :: is(:,:), mt(:,:)
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