Commit 1e8cce6a authored by Matthias Redies's avatar Matthias Redies

Merge branch 'develop' into hybrid_purge

parents b69bf711 1ffcc412
......@@ -87,8 +87,10 @@ CONTAINS
DO nn = 1, n
IF (hmat%l_real) THEN
hmat%data_r(nn, n) = hmat%data_r(nn, n) - a_ex*v_x%data_r(nn, n)
v_x%data_r(n, nn) = v_x%data_r(nn, n)
ELSE
hmat%data_c(nn, n) = hmat%data_c(nn, n) - a_ex*v_x%data_c(nn, n)
v_x%data_c(n, nn) = CONJG(v_x%data_c(nn, n))
ENDIF
END DO
END DO
......
......@@ -32,7 +32,8 @@ CONTAINS
USE m_checkdopall
USE m_cdn_io
USE m_convol
use m_cdntot
USE m_cdntot
USE m_intgr
IMPLICIT NONE
......@@ -56,10 +57,13 @@ CONTAINS
TYPE(t_results), INTENT(INOUT), OPTIONAL :: results
! Local type instances
TYPE(t_potden) :: workDen, exc, veff
real, allocatable :: tmp_mt(:,:,:), tmp_is(:,:)
TYPE(t_potden) :: workDen, exc, veff
REAL, ALLOCATABLE :: tmp_mt(:,:,:), tmp_is(:,:)
REAL, ALLOCATABLE :: rhoc(:,:,:),rhoc_vx(:)
REAL, ALLOCATABLE :: tec(:,:), qintc(:,:)
! Local Scalars
INTEGER ifftd, ifftd2, ifftxc3d, ispin, i
INTEGER :: ifftd, ifftd2, ifftxc3d, ispin, i, iType
REAL :: dpdot
#ifdef CPP_MPI
include 'mpif.h'
integer:: ierr
......@@ -156,16 +160,13 @@ CONTAINS
END IF
veff = vTot
IF (xcpot%is_hybrid() .AND. hybrid%l_subvxc) THEN
IF (xcpot%is_hybrid().AND.hybrid%l_subvxc) THEN
DO ispin = 1, input%jspins
CALL convol(stars, vx%pw_w(:, ispin), vx%pw(:, ispin), stars%ufft)
END DO
veff%pw = vTot%pw - xcpot%get_exchange_weight()*vx%pw
veff%pw_w = vTot%pw_w - xcpot%get_exchange_weight()*vx%pw_w
veff%mt = vTot%mt - xcpot%get_exchange_weight()*vx%mt
exc%pw = exc%pw - xcpot%get_exchange_weight()*exc%pw
exc%pw_w = exc%pw_w - xcpot%get_exchange_weight()*exc%pw_w
exc%mt = exc%mt - xcpot%get_exchange_weight()*exc%mt
END IF
DO ispin = 1, input%jspins
......@@ -182,6 +183,26 @@ CONTAINS
CALL int_nv(ispin, stars, vacuum, atoms, sphhar, cell, sym, input, oneD, veff, workden, results%te_veff)
END DO
IF (xcpot%is_hybrid().AND.hybrid%l_subvxc) THEN
ALLOCATE(rhoc(atoms%jmtd,atoms%ntype,input%jspins), rhoc_vx(atoms%jmtd))
ALLOCATE(tec(atoms%ntype,input%jspins),qintc(atoms%ntype,input%jspins))
CALL readCoreDensity(input,atoms,dimension,rhoc,tec,qintc)
DEALLOCATE(tec,qintc)
DO ispin = 1, input%jspins
DO iType = 1,atoms%ntype
rhoc_vx(:atoms%jri(iType)) = rhoc(:atoms%jri(iType),iType,ispin) * &
vx%mt(:atoms%jri(iType),0,iType,ispin) / sfp_const
CALL intgr3(rhoc_vx,atoms%rmsh(1,iType),atoms%dx(iType),atoms%jri(iType),dpdot)
results%te_veff = results%te_veff + xcpot%get_exchange_weight() * dpdot*atoms%neq(iType)
END DO
END DO
DEALLOCATE(rhoc,rhoc_vx)
END IF
WRITE (6, FMT=8060) results%te_veff
8060 FORMAT(/, 10x, 'total density-effective potential integral :', t40, ES20.10)
......
......@@ -94,7 +94,12 @@ CONTAINS
ENDIF ! ro > smlc
xced = (xedl+cedl+xedg+cedg)
IF(xcpot%is_pbe0) THEN
!pbe0: weight exchange energy with factor 0.75
xced = (0.75*xedl+cedl+0.75*xedg+cedg)
ELSE
xced = (xedl+cedl+xedg+cedg)
END IF
exc(i) = xced*2 ! in ry
......
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