Commit 407138b9 authored by Gregor Michalicek's avatar Gregor Michalicek

Tiny bugfixes in hybrid/add_Vnonlocal.F90

parent da4da480
......@@ -81,16 +81,12 @@ MODULE m_add_vnonlocal
nbasfcn = MERGE(lapw%nv(1)+lapw%nv(2)+2*atoms%nlotot,lapw%nv(1)+atoms%nlotot,noco%l_noco)
CALL v_x%init(hmat%l_real,nbasfcn,nbasfcn)
CALL read_v_x(v_x,kpts%nkpt*(jsp-1) + nk)
CALL read_v_x(v_x,kpts%nkpt*(jsp-1)+nk)
! add non-local x-potential to the hamiltonian hmat
DO n = 1, v_x%matsize1
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)
IF ((n.LE.5).AND.(nn.LE.5)) THEN
WRITE(1234,'(2i7,4f15.8)') n, nn, hmat%data_r(n,nn), hmat%data_r(nn,n), v_x%data_r(n,nn), v_x%data_r(nn,n)
WRITE(1236,'(2i7,2f15.8)') n, nn, v_x%data_r(n,nn), v_x%data_r(nn,n)
END IF
ELSE
hmat%data_c(nn,n) = hmat%data_c(nn,n) - a_ex*v_x%data_c(nn,n)
ENDIF
......@@ -105,13 +101,12 @@ MODULE m_add_vnonlocal
! read in lower triangle part of overlap matrix from direct acces file olap
CALL olap%init(hmat%l_real,nbasfcn,nbasfcn)
CALL read_olap(olap,kpts%nkpt*(jsp-1) + nk)
CALL read_olap(olap,kpts%nkpt*(jsp-1)+nk)
IF (.NOT.olap%l_real) olap%data_c=conjg(olap%data_c)
CALL z%init(olap%l_real,nbasfcn,dimension%neigd)
CALL read_z(z,nk) !what about spin?
WRITE(*,*) 'What about spin (in add_Vnonlocal)?'
CALL read_z(z,kpts%nkpt*(jsp-1)+nk)
! calculate exchange contribution of current k-point nk to total energy (te_hfex)
! in the case of a spin-unpolarized calculation the factor 2 is added in eigen.F90
......@@ -125,7 +120,7 @@ MODULE m_add_vnonlocal
IF (z%l_real) THEN
exch(iband,iband) = dot_product(z%data_r(:z%matsize1,iband),tmp%data_r(:,iband))
ELSE
exch(iband,iband) = dot_product(z%data_r(:z%matsize1,iband),tmp%data_r(:,iband))
exch(iband,iband) = dot_product(z%data_c(:z%matsize1,iband),tmp%data_c(:,iband))
END IF
IF(iband.LE.hybrid%nobd(nk)) THEN
results%te_hfex%valence = results%te_hfex%valence -a_ex*results%w_iks(iband,nk,jsp)*exch(iband,iband)
......
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