Commit 76a471b8 authored by Matthias Redies's avatar Matthias Redies

Merge branch 'hyb_cleanup' into 'develop'

remove redundant mnodb

See merge request fleur/fleur!77
parents d1c643e6 891301e3
......@@ -101,12 +101,14 @@ CONTAINS
ENDIF
END DO
END DO
#ifdef CPP_EXPLICIT_HYB
! calculate HF energy
IF (hybdat%l_calhf) THEN
WRITE (6, '(A)') new_line('n')//new_line('n')//' ### '//' diagonal HF exchange elements (eV) ###'
WRITE (6, '(A)') new_line('n')//' k-point '//'band tail pole total(valence+core)'
END IF
#endif
CALL z%init(hmat%l_real, nbasfcn, input%neig)
......
......@@ -128,7 +128,7 @@ CONTAINS
nk = k_list(i)
CALL lapw%init(fi%input, fi%noco, nococonv,fi%kpts, fi%atoms, fi%sym, nk, fi%cell, l_zref)
CALL hsfock(fi,nk, mpdata, lapw, jsp, hybdat, eig_irr, &
nococonv, results, MAXVAL(hybdat%nobd(:,jsp)), xcpot, mpi)
nococonv, results, xcpot, mpi)
END DO
END DO
CALL timestop("Calculation of non-local HF potential")
......
......@@ -60,7 +60,7 @@ MODULE m_exchange_valence_hf
CONTAINS
SUBROUTINE exchange_valence_hf(ik, kpts, nkpt_EIBZ, sym, atoms, mpdata, hybinp, cell, input, jsp, hybdat, mnobd, lapw, &
SUBROUTINE exchange_valence_hf(ik, kpts, nkpt_EIBZ, sym, atoms, mpdata, hybinp, cell, input, jsp, hybdat, lapw, &
eig_irr, results, pointer_EIBZ, n_q, wl_iks, xcpot, noco,nococonv, oneD, nsest, indx_sest, &
mpi, mat_ex)
......@@ -95,7 +95,6 @@ CONTAINS
! scalars
INTEGER, INTENT(IN) :: jsp
INTEGER, INTENT(IN) :: ik, nkpt_EIBZ
INTEGER, INTENT(IN) :: mnobd
! arrays
INTEGER, INTENT(IN) :: n_q(:)
......@@ -129,8 +128,8 @@ CONTAINS
COMPLEX :: dcprod(hybdat%nbands(ik), hybdat%nbands(ik), 3)
COMPLEX :: exch_vv(hybdat%nbands(ik), hybdat%nbands(ik))
COMPLEX :: hessian(3, 3)
COMPLEX :: proj_ibsc(3, mnobd, hybdat%nbands(ik))
COMPLEX :: olap_ibsc(3, 3, mnobd, mnobd)
COMPLEX :: proj_ibsc(3, MAXVAL(hybdat%nobd(:,jsp)), hybdat%nbands(ik))
COMPLEX :: olap_ibsc(3, 3, MAXVAL(hybdat%nobd(:,jsp)), MAXVAL(hybdat%nobd(:,jsp)))
REAL :: carr1_v_r(hybdat%maxbasm1)
COMPLEX :: carr1_v_c(hybdat%maxbasm1)
COMPLEX, ALLOCATABLE :: phase_vv(:, :)
......@@ -165,9 +164,9 @@ CONTAINS
! determine package size loop over the occupied bands
rdum = hybdat%maxbasm1*hybdat%nbands(ik)*4/1048576.
psize = 1
DO iband = mnobd, 1, -1
DO iband = MAXVAL(hybdat%nobd(:,jsp)), 1, -1
! ensure that the packages have equal size
IF (modulo(mnobd, iband) == 0) THEN
IF (modulo(MAXVAL(hybdat%nobd(:,jsp)), iband) == 0) THEN
! choose packet size such that cprod is smaller than memory threshold
IF (rdum*iband <= maxmem) THEN
psize = iband
......@@ -176,7 +175,7 @@ CONTAINS
END IF
END DO
IF (psize /= mnobd) THEN
IF (psize /= MAXVAL(hybdat%nobd(:,jsp))) THEN
WRITE (6, '(A,A,i3,A,f7.2,A)') ' Divide the loop over the occupied hybinp%bands in packages', &
' of the size', psize, ' (cprod=', rdum*psize, 'MB)'
END IF
......@@ -225,7 +224,7 @@ CONTAINS
END IF
END IF
DO ibando = 1, mnobd, psize
DO ibando = 1, MAXVAL(hybdat%nobd(:,jsp)), psize
IF (mat_ex%l_real) THEN
CALL wavefproducts_inv(ibando, ibando + psize - 1, input, jsp, atoms, &
......@@ -345,7 +344,7 @@ CONTAINS
IF (ibs_corr) THEN
CALL ibs_correction(ik, atoms, input, jsp, hybdat, mpdata, hybinp,&
lapw, kpts, cell, mnobd, &
lapw, kpts, cell, MAXVAL(hybdat%nobd(:,jsp)), &
sym, noco,nococonv, proj_ibsc, olap_ibsc)
END IF
END IF
......
......@@ -31,7 +31,6 @@ MODULE m_hsfock
! nbands := number of bands for which the exchange matrix (mat_ex) c
! in the space of the wavefunctions is calculated c
! te_hfex := hf exchange contribution to the total energy c
! mnobd := maximum number of occupied bands c
! parent := parent(ikpt) points to the symmetry equivalent point c
! under the little group of kpoint nk c
! symop := symop(ikpt) points to the symmetry operation, which c
......@@ -45,7 +44,7 @@ CONTAINS
SUBROUTINE hsfock(fi, nk, mpdata, lapw, jsp, hybdat, &
eig_irr, nococonv, &
results, mnobd, xcpot, mpi)
results, xcpot, mpi)
use m_ex_to_vx
USE m_judft
......@@ -72,7 +71,6 @@ CONTAINS
! scalars
INTEGER, INTENT(IN) :: jsp
INTEGER, INTENT(IN) :: nk
INTEGER, INTENT(IN) :: mnobd
! arrays
REAL, INTENT(IN) :: eig_irr(:, :)
......@@ -154,7 +152,7 @@ CONTAINS
! calculate contribution from valence electrons to the
! HF exchange
ex%l_real = fi%sym%invs
CALL exchange_valence_hf(nk, fi%kpts, nkpt_EIBZ, fi%sym, fi%atoms, mpdata, fi%hybinp, fi%cell, fi%input, jsp, hybdat, mnobd, lapw, &
CALL exchange_valence_hf(nk, fi%kpts, nkpt_EIBZ, fi%sym, fi%atoms, mpdata, fi%hybinp, fi%cell, fi%input, jsp, hybdat, lapw, &
eig_irr, results, pointer_EIBZ, n_q, wl_iks, xcpot, fi%noco, nococonv, fi%oneD, nsest, indx_sest, &
mpi, ex)
......
......@@ -65,7 +65,7 @@ CONTAINS
END IF
END DO
WRITE(6, '(A,i3)') ' nk', nk
WRITE(6, '(A,i3)') 'current nk: ', nk
WRITE(6, '(A,3f10.5)') ' kpts%bkf(:,nk):', kpts%bkf(:, nk)
WRITE(6, '(A,i3)') ' Number of elements in the little group:', nsymop
......@@ -259,12 +259,12 @@ CONTAINS
! number of different degenerate bands/states
nddb = count(degenerat >= 1)
#ifdef CPP_EXPLICIT_HYB
WRITE(6, *) ' Degenerate states:'
DO iband = 1, hybdat%nbands(nk)/5 + 1
WRITE(6, '(5i5)') degenerat(iband*5 - 4:min(iband*5, hybdat%nbands(nk)))
END DO
#endif
! read in cmt and z at current k-point (nk)
call calc_cmt(atoms, cell, input, noco,nococonv, hybinp, hybdat, mpdata, kpts, &
sym, oneD, zmat, jsp, nk, c_phase, cmt)
......
......@@ -73,7 +73,7 @@ SUBROUTINE rdmft(eig_id,mpi,fi,enpara,stars,&
TYPE(t_lapw) :: lapw
INTEGER :: ikpt, ikpt_i, iBand, jkpt, jBand, iAtom, i, na, itype, lh, j
INTEGER :: jspin, jspmax, jsp, isp, ispin, nbasfcn, nbands
INTEGER :: nsymop, nkpt_EIBZ, ikptf, iterHF, mnobd
INTEGER :: nsymop, nkpt_EIBZ, ikptf, iterHF
INTEGER :: iState, iStep, numStates, numRelevantStates, convIter
INTEGER :: maxHistoryLength
REAL :: fix, potDenInt, fermiEnergyTemp, spinDegenFac
......@@ -510,8 +510,6 @@ SUBROUTINE rdmft(eig_id,mpi,fi,enpara,stars,&
results%neig(:,:) = highestState(:,:) + 1
mnobd = MAXVAL(hybdat%nobd(:,jsp))
DO ikpt = 1,fi%kpts%nkpt
CALL lapw%init(fi%input,fi%noco,nococonv,fi%kpts,fi%atoms,fi%sym,ikpt,fi%cell,l_zref)
......@@ -528,7 +526,7 @@ SUBROUTINE rdmft(eig_id,mpi,fi,enpara,stars,&
rrot,nsymop,psym,nkpt_EIBZ,n_q,parent,pointer_EIBZ,nsest,indx_sest)
exMat%l_real=fi%sym%invs
CALL exchange_valence_hf(ikpt,fi%kpts,nkpt_EIBZ, fi%sym,fi%atoms,mpdata,fi%hybinp,fi%cell,fi%input,jspin,hybdat,mnobd,lapw,&
CALL exchange_valence_hf(ikpt,fi%kpts,nkpt_EIBZ, fi%sym,fi%atoms,mpdata,fi%hybinp,fi%cell,fi%input,jspin,hybdat,lapw,&
eig_irr,results,pointer_EIBZ,n_q,wl_iks,xcpot,fi%noco,nococonv,fi%oned,nsest,indx_sest,&
mpi,exMat)
CALL exchange_vccv1(ikpt,fi%input,fi%atoms,fi%cell, fi%kpts, fi%sym, fi%noco,nococonv, fi%oned,&
......
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