Commit 994dc7f7 authored by Matthias Redies's avatar Matthias Redies

rename nindx to num_radfun_per_l

parent 1ac5a3bf
......@@ -119,11 +119,11 @@
IF (l > atoms%lmax(itype)) EXIT ! very improbable case
IF (mpi%irank == 0) &
& WRITE (6, "(9X,'u(',A,')',4X,'udot(',A,')',:,3X,'ulo(',A,"//&
& "') ...')") (lchar(l), i=1, min(3, hybrid%nindx(l, itype)))
& "') ...')") (lchar(l), i=1, min(3, hybrid%num_radfun_per_l(l, itype)))
DO i = 1, hybdat%nindxc(l, itype)
IF (mpi%irank == 0)&
& WRITE (6, '(1x,I1,A,2X)', advance='no') i + l, lchar(l)
DO j = 1, hybrid%nindx(l, itype)
DO j = 1, hybrid%num_radfun_per_l(l, itype)
integrand = hybdat%core1(:, i, l, itype)*hybdat%bas1(:, j, l, itype)&
& + hybdat%core2(:, i, l, itype)*hybdat%bas2(:, j, l, itype)
......@@ -135,11 +135,11 @@
& WRITE (6, '(F10.6)', advance='no') olapcb(j)
END DO
lm = sum((/(hybrid%nindx(j, itype)*(2*j + 1), j=0, l - 1)/))
lm = sum((/(hybrid%num_radfun_per_l(j, itype)*(2*j + 1), j=0, l - 1)/))
iatom = sum(atoms%neq(1:itype - 1)) + 1 ! take first of group of equivalent atoms
DO m = -l, l
olapcv = 0
DO j = 1, hybrid%nindx(l, itype)
DO j = 1, hybrid%num_radfun_per_l(l, itype)
lm = lm + 1
olapcv(:, :) = olapcv(:, :) + &
& olapcb(j)*cmt(:maxval(hybrid%nbands), lm, iatom, :nkpti)
......@@ -194,7 +194,7 @@
IF (atoms%ntype > 1 .AND. mpi%irank == 0) &
& WRITE (6, '(A,I3)') ' Atom type', itype
DO l = 0, atoms%lmax(itype)
DO i = 1, hybrid%nindx(l, itype)
DO i = 1, hybrid%num_radfun_per_l(l, itype)
IF (mpi%irank == 0) THEN
SELECT CASE (i)
CASE (1)
......@@ -277,7 +277,7 @@
DO l = 0, atoms%lmax(itype)
DO m = -l, l
lm = lm + 1
DO n = 1, hybrid%nindx(l, itype)
DO n = 1, hybrid%num_radfun_per_l(l, itype)
lm1 = lm1 + 1
rdum = hybdat%bas1(atoms%jri(itype), n, l, itype)/atoms%rmt(itype)
DO iband = 1, hybrid%nbands(ikpt)
......
......@@ -124,7 +124,7 @@ CONTAINS
DO l2 = 0, atoms%lmax(itype)
IF (l < ABS(l1 - l2) .OR. l > l1 + l2) CYCLE
DO p2 = 1, hybrid%nindx(l2, itype)
DO p2 = 1, hybrid%num_radfun_per_l(l2, itype)
n = n + 1
M = SIZE(fprod, 2)
IF (n > M) THEN
......@@ -175,7 +175,7 @@ CONTAINS
ll = larr(i)
IF (ABS(m2) > ll) CYCLE
lm = SUM((/((2*l2 + 1)*hybrid%nindx(l2, itype), l2=0, ll - 1)/)) + (m2 + ll)*hybrid%nindx(ll, itype) + parr(i)
lm = SUM((/((2*l2 + 1)*hybrid%num_radfun_per_l(l2, itype), l2=0, ll - 1)/)) + (m2 + ll)*hybrid%num_radfun_per_l(ll, itype) + parr(i)
carr(i, n1) = cmt(n1, lm, iatom)*gaunt(l1, ll, l, m1, m2, M, hybdat%maxfac, hybdat%fac, hybdat%sfac)
......@@ -311,7 +311,7 @@ CONTAINS
DO l2 = 0, atoms%lmax(itype)
IF (l < ABS(l1 - l2) .OR. l > l1 + l2) CYCLE
DO p2 = 1, hybrid%nindx(l2, itype)
DO p2 = 1, hybrid%num_radfun_per_l(l2, itype)
n = n + 1
M = SIZE(fprod, 2)
IF (n > M) THEN
......@@ -361,8 +361,8 @@ CONTAINS
ll = larr(i)
IF (ABS(m2) > ll) CYCLE
lm = SUM((/((2*l2 + 1)*hybrid%nindx(l2, itype), l2=0, ll - 1)/)) &
+ (m2 + ll)*hybrid%nindx(ll, itype) + parr(i)
lm = SUM((/((2*l2 + 1)*hybrid%num_radfun_per_l(l2, itype), l2=0, ll - 1)/)) &
+ (m2 + ll)*hybrid%num_radfun_per_l(ll, itype) + parr(i)
carr(i, n1) = cmt(n1, lm, iatom)*gaunt(l1, ll, l, m1, m2, M, hybdat%maxfac, hybdat%fac, hybdat%sfac)
......@@ -621,7 +621,7 @@ CONTAINS
! lmstart = lm start index for each l-quantum number and atom type (for cmt-coefficients)
DO itype = 1, atoms%ntype
DO l = 0, atoms%lmax(itype)
lmstart(l, itype) = SUM((/(hybrid%nindx(ll, itype)*(2*ll + 1), ll=0, l - 1)/))
lmstart(l, itype) = SUM((/(hybrid%num_radfun_per_l(ll, itype)*(2*ll + 1), ll=0, l - 1)/))
END DO
END DO
......@@ -659,7 +659,7 @@ CONTAINS
DO m1 = -l1, l1
m2 = m1
IF (ABS(m2) > l2) CYCLE
lm2 = lmstart(l2, itype) + (m2 + l2)*hybrid%nindx(l2, itype)
lm2 = lmstart(l2, itype) + (m2 + l2)*hybrid%num_radfun_per_l(l2, itype)
DO M = -l, l
mm = M - m1
......@@ -669,7 +669,7 @@ CONTAINS
*gaunt1(l, ll, l2, M, mm, m1, llmax)*rdum0
DO n = 1, hybdat%nindxc(l, itype)
DO n2 = 1, hybrid%nindx(l2, itype)
DO n2 = 1, hybrid%num_radfun_per_l(l2, itype)
lmp2 = lm2 + n2
rprod(:atoms%jri(itype)) = (hybdat%core1(:atoms%jri(itype), n, l, itype)*hybdat%bas1(:atoms%jri(itype), n2, l2, itype) &
......
......@@ -158,7 +158,7 @@ CONTAINS
#if CPP_DEBUG
! consistency check
IF (.not. all(iarr == hybrid%nindx)) call judft_error('gen_wavf: counting error')
IF (.not. all(iarr == hybrid%num_radfun_per_l)) call judft_error('gen_wavf: counting error')
#endif
8000 FORMAT(1x, /, /, ' wavefunction parameters for atom type', i3, ':', /, t32, 'radial function', t79, &
......@@ -216,7 +216,7 @@ CONTAINS
! number l in the list of all local orbitals of the atom type
idum = 0
map_lo = 0
IF (hybrid%nindx(l, itype) > 2) THEN
IF (hybrid%num_radfun_per_l(l, itype) > 2) THEN
DO j = 1, atoms%nlo(itype)
IF (atoms%llo(j, itype) == l) THEN
idum = idum + 1
......@@ -227,7 +227,7 @@ CONTAINS
DO M = -l, l
lm = ll + M
DO i = 1, hybrid%nindx(l, itype)
DO i = 1, hybrid%num_radfun_per_l(l, itype)
indx = indx + 1
IF (i == 1) THEN
cmt(:, indx, iatom) = cdum*acof(:, lm, iatom)
......
......@@ -185,7 +185,7 @@ CONTAINS
allocate(basprod(atoms%jmtd), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation basprod')
allocate(hybdat%prodm(maxval(hybrid%nindxm1), hybrid%maxindxp1, 0:hybrid%maxlcutm1, atoms%ntype), stat=ok)
allocate(hybdat%prodm(maxval(hybrid%nindxm1), hybrid%max_indx_p_1, 0:hybrid%maxlcutm1, atoms%ntype), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation hybdat%prodm')
call hybdat%prod%init(hybrid, atoms)
......@@ -200,8 +200,8 @@ CONTAINS
ll = l2
DO l1 = 0, ll
IF (ABS(l1 - l2) <= hybrid%lcutm1(itype)) THEN
DO n2 = 1, hybrid%nindx(l2, itype)
nn = hybrid%nindx(l1, itype)
DO n2 = 1, hybrid%num_radfun_per_l(l2, itype)
nn = hybrid%num_radfun_per_l(l1, itype)
IF (l1 == l2) nn = n2
DO n1 = 1, nn
! Calculate all basis-function hybdat%products to obtain
......@@ -239,7 +239,7 @@ CONTAINS
hybrid%nobd(nk) = COUNT(results%w_iks(:hybrid%ne_eig(nk), nk, jsp) > 0.0)
END DO
hybrid%maxlmindx = MAXVAL((/(SUM((/(hybrid%nindx(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))/)), itype=1, atoms%ntype)/))
hybrid%maxlmindx = MAXVAL((/(SUM((/(hybrid%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))/)), itype=1, atoms%ntype)/))
hybrid%nbands = MIN(hybrid%bands1, DIMENSION%neigd)
ENDIF ! hybrid%l_calhf
......
......@@ -110,12 +110,12 @@ CONTAINS
! with this the local orbitals have a trivial k-dependence
! compute radial lo matching coefficients
hybrid%nindx = 2
hybrid%num_radfun_per_l = 2
DO itype = 1, atoms%ntype
DO ilo = 1, atoms%nlo(itype)
l = atoms%llo(ilo, itype)
hybrid%nindx(l, itype) = hybrid%nindx(l, itype) + 1
p = hybrid%nindx(l, itype)
hybrid%num_radfun_per_l(l, itype) = hybrid%num_radfun_per_l(l, itype) + 1
p = hybrid%num_radfun_per_l(l, itype)
ws = -wronskian(hybdat%bas1_MT(1, l, itype), hybdat%drbas1_MT(1, l, itype), hybdat%bas1_MT(2, l, itype), hybdat%drbas1_MT(2, l, itype))
......@@ -410,12 +410,12 @@ CONTAINS
iatom = 0
DO itype = 1, atoms%ntype
DO ieq = 1, atoms%neq(itype)
hybrid%nindx = 2
hybrid%num_radfun_per_l = 2
iatom = iatom + 1
DO ilo = 1, atoms%nlo(itype)
l1 = atoms%llo(ilo, itype)
hybrid%nindx(l1, itype) = hybrid%nindx(l1, itype) + 1
p1 = hybrid%nindx(l1, itype)
hybrid%num_radfun_per_l(l1, itype) = hybrid%num_radfun_per_l(l1, itype) + 1
p1 = hybrid%num_radfun_per_l(l1, itype)
l2 = l1 + 1
lm2 = l2**2
......@@ -864,7 +864,7 @@ CONTAINS
ic = 0
DO itype = 1, atoms%ntype
DO l = 0, atoms%lmax(itype)
DO n2 = 1, hybrid%nindx(l, itype)
DO n2 = 1, hybrid%num_radfun_per_l(l, itype)
!ic = ic + 1
CALL derivative(dbas1, hybdat%bas1(:, n2, l, itype), atoms, itype)
dbas1 = dbas1 - hybdat%bas1(:, n2, l, itype)/atoms%rmsh(:, itype)
......@@ -873,7 +873,7 @@ CONTAINS
dbas2 = dbas2 - hybdat%bas2(:, n2, l, itype)/atoms%rmsh(:, itype)
IF (l /= 0) THEN
DO n1 = 1, hybrid%nindx(l - 1, itype)
DO n1 = 1, hybrid%num_radfun_per_l(l - 1, itype)
ic = ic + 1
qmat1(n1, n2, l, itype) = intgrf(dbas1(:)*hybdat%bas1(:, n1, l - 1, itype) + &
dbas2(:)*hybdat%bas2(:, n1, l - 1, itype), atoms%jri, atoms%jmtd, atoms%rmsh, atoms%dx, atoms%ntype, itype, hybdat%gridf) &
......@@ -883,7 +883,7 @@ CONTAINS
END DO
END IF
IF (l /= atoms%lmax(itype)) THEN
DO n1 = 1, hybrid%nindx(l + 1, itype)
DO n1 = 1, hybrid%num_radfun_per_l(l + 1, itype)
qmat2(n1, n2, l, itype) = intgrf(dbas1(:)*hybdat%bas1(:, n1, l + 1, itype) + dbas2(:)*hybdat%bas2(:, n1, l + 1, itype), &
atoms%jri, atoms%jmtd, atoms%rmsh, atoms%dx, atoms%ntype, itype, hybdat%gridf) &
......@@ -909,7 +909,7 @@ CONTAINS
DO itype = 1, atoms%ntype
DO ieq = 1, atoms%neq(itype)
ic = ic + 1
nn = sum((/((2*l + 1)*hybrid%nindx(l, itype), l=0, atoms%lmax(itype))/))
nn = sum((/((2*l + 1)*hybrid%num_radfun_per_l(l, itype), l=0, atoms%lmax(itype))/))
DO iband1 = bandi1, bandf1
cmt1(:nn, iband1) = cmt(iband1, :nn, ic)
ENDDO
......@@ -921,11 +921,11 @@ CONTAINS
cvec1 = 0; cvec2 = 0; cvec3 = 0
! build up left vector(s) ( -> cvec1/2/3 )
lm_0 = 0 ! we start with s-functions (l=0)
lm_1 = hybrid%nindx(0, itype) ! we start with p-functions (l=0+1)
lm_1 = hybrid%num_radfun_per_l(0, itype) ! we start with p-functions (l=0+1)
lm = 0
DO l = 0, atoms%lmax(itype) - 1
n0 = hybrid%nindx(l, itype)
n1 = hybrid%nindx(l + 1, itype)
n0 = hybrid%num_radfun_per_l(l, itype)
n1 = hybrid%num_radfun_per_l(l + 1, itype)
DO M = -l, l
lm = lm + 1
lm0 = lm_0 + (M + l)*n0
......@@ -940,12 +940,12 @@ CONTAINS
lm_1 = lm_1 + (2*l + 3)*n1
END DO
lm_0 = hybrid%nindx(0, itype) ! we start with p-functions (l=1)
lm_0 = hybrid%num_radfun_per_l(0, itype) ! we start with p-functions (l=1)
lm_1 = 0 ! we start with s-functions (l=1-1)
lm = 1
DO l = 1, atoms%lmax(itype)
n0 = hybrid%nindx(l, itype)
n1 = hybrid%nindx(l - 1, itype)
n0 = hybrid%num_radfun_per_l(l, itype)
n1 = hybrid%num_radfun_per_l(l - 1, itype)
DO M = -l, l
lm = lm + 1
lm0 = lm_0 + (M + l)*n0
......
......@@ -152,16 +152,16 @@ CONTAINS
bas1(1:ng, 2, 0:atoms%lmaxd, itype, ispin) = df(1:ng, 1, 0:atoms%lmaxd)
bas2(1:ng, 2, 0:atoms%lmaxd, itype, ispin) = df(1:ng, 2, 0:atoms%lmaxd)
hybrid%nindx(:,itype) = 2
hybrid%num_radfun_per_l(:,itype) = 2
! generate radial functions for local orbitals
IF (atoms%nlo(itype) >= 1) THEN
CALL radflo(atoms, itype, ispin, enpara%ello0(1, 1, ispin), vr0(:,itype, ispin), &
f, df, mpi, usdus, uuilon, duilon, ulouilopn, flo)
DO ilo = 1, atoms%nlo(itype)
hybrid%nindx(atoms%llo(ilo, itype), itype) = hybrid%nindx(atoms%llo(ilo, itype), itype) + 1
bas1(1:ng, hybrid%nindx(atoms%llo(ilo, itype), itype), atoms%llo(ilo, itype), itype, ispin) = flo(1:ng, 1, ilo)
bas2(1:ng, hybrid%nindx(atoms%llo(ilo, itype), itype), atoms%llo(ilo, itype), itype, ispin) = flo(1:ng, 2, ilo)
hybrid%num_radfun_per_l(atoms%llo(ilo, itype), itype) = hybrid%num_radfun_per_l(atoms%llo(ilo, itype), itype) + 1
bas1(1:ng, hybrid%num_radfun_per_l(atoms%llo(ilo, itype), itype), atoms%llo(ilo, itype), itype, ispin) = flo(1:ng, 1, ilo)
bas2(1:ng, hybrid%num_radfun_per_l(atoms%llo(ilo, itype), itype), atoms%llo(ilo, itype), itype, ispin) = flo(1:ng, 2, ilo)
END DO
END IF
END DO
......@@ -173,7 +173,7 @@ CONTAINS
DO ispin = 1, input%jspins
DO itype = 1, atoms%ntype
DO l = 0, atoms%lmax(itype)
DO i = 1, hybrid%nindx(l, itype)
DO i = 1, hybrid%num_radfun_per_l(l, itype)
rdum = intgrf(bas1(:,i, l, itype, ispin)**2 + bas2(:,i, l, itype, ispin)**2, &
atoms%jri, atoms%jmtd, atoms%rmsh, atoms%dx, atoms%ntype, itype, gridf)
bas1(:atoms%jri(itype), i, l, itype, ispin) = bas1(:atoms%jri(itype), i, l, itype, ispin)/SQRT(rdum)
......@@ -386,7 +386,7 @@ CONTAINS
! determine maximal indices of (radial) mixed-basis functions (->nindxm1)
! (will be reduced later-on due to overlap)
hybrid%maxindxp1 = 0
hybrid%max_indx_p_1 = 0
DO itype = 1, atoms%ntype
seleco = .FALSE.
selecu = .FALSE.
......@@ -417,8 +417,8 @@ CONTAINS
DO l1 = 0, atoms%lmax(itype)
DO l2 = 0, atoms%lmax(itype)
IF (l >= ABS(l1 - l2) .AND. l <= l1 + l2) THEN
DO n1 = 1, hybrid%nindx(l1, itype)
DO n2 = 1, hybrid%nindx(l2, itype)
DO n1 = 1, hybrid%num_radfun_per_l(l1, itype)
DO n2 = 1, hybrid%num_radfun_per_l(l2, itype)
M = M + 1
IF (selecmat(n1, l1, n2, l2)) THEN
n = n + 1
......@@ -432,7 +432,7 @@ CONTAINS
IF (n == 0 .AND. mpi%irank == 0) &
WRITE (6, '(A)') 'mixedbasis: Warning! No basis-function product of '//lchar(l)// &
'-angular momentum defined.'
hybrid%maxindxp1 = MAX(hybrid%maxindxp1, M)
hybrid%max_indx_p_1 = MAX(hybrid%max_indx_p_1, M)
hybrid%nindxm1(l, itype) = n*input%jspins
END DO
END DO
......@@ -482,8 +482,8 @@ CONTAINS
DO l2 = 0, atoms%lmax(itype)
IF (l < ABS(l1 - l2) .OR. l > l1 + l2) CYCLE
DO n1 = 1, hybrid%nindx(l1, itype)
DO n2 = 1, hybrid%nindx(l2, itype)
DO n1 = 1, hybrid%num_radfun_per_l(l1, itype)
DO n2 = 1, hybrid%num_radfun_per_l(l2, itype)
IF (selecmat(n1, l1, n2, l2)) THEN
DO ispin = 1, input%jspins
......@@ -753,7 +753,7 @@ CONTAINS
hybrid%nbasm(nk) = hybrid%nbasp + hybrid%ngptm(nk)
END DO
hybrid%maxlmindx = MAXVAL((/(SUM((/(hybrid%nindx(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))/)), itype=1, atoms%ntype)/))
hybrid%maxlmindx = MAXVAL((/(SUM((/(hybrid%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))/)), itype=1, atoms%ntype)/))
END SUBROUTINE mixedbasis
END MODULE m_mixedbasis
......@@ -180,7 +180,7 @@ CONTAINS
olapmt = 0
DO itype = 1, atoms%ntype
DO l = 0, atoms%lmax(itype)
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
DO n2 = 1, nn
DO n1 = 1, nn!n2
!IF( n1 .gt. 2 .or. n2 .gt. 2) CYCLE
......@@ -228,7 +228,7 @@ CONTAINS
lm = 0
DO l = 0, atoms%lmax(itype)
DO M = -l, l
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
wfolap_inv = wfolap_inv + &
& dot_product(cmt1(lm + 1:lm + nn, iatom),&
& matmul(olapmt(:nn, :nn, l, itype),&
......@@ -281,7 +281,7 @@ CONTAINS
lm = 0
DO l = 0, atoms%lmax(itype)
DO M = -l, l
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
wfolap_noinv = wfolap_noinv + &
& dot_product(cmt1(lm + 1:lm + nn, iatom),&
& matmul(olapmt(:nn, :nn, l, itype),&
......@@ -342,7 +342,7 @@ CONTAINS
lm = 0
DO l = 0, atoms%lmax(itype)
DO M = -l, l
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
wfolap1 = wfolap1 + &
& dot_product(cmt1(lm + 1:lm + nn, iatom),&
& matmul(olapmt(:nn, :nn, l, itype),&
......@@ -393,7 +393,7 @@ CONTAINS
lm = 0
DO l = 0, atoms%lmax(itype)
DO M = -l, l
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
wfolap2 = wfolap2 + &
& dot_product(cmt1(lm + 1:lm + nn, ic),&
& matmul(olapmt(:nn, :nn, l, itype),&
......
......@@ -98,7 +98,7 @@ CONTAINS
vxc = 0
! Calculate radial functions
hybrid%nindx = 2
hybrid%num_radfun_per_l = 2
DO itype = 1, atoms%ntype
! Generate the radial basis-functions for each l
......@@ -125,10 +125,10 @@ CONTAINS
usdus, uuilon, duilon, ulouilopn, flo, .TRUE.)
DO i = 1, atoms%nlo(itype)
hybrid%nindx(atoms%llo(i, itype), itype) = hybrid%nindx(atoms%llo(i, itype), itype) + 1
pointer_lo(i, itype) = hybrid%nindx(atoms%llo(i, itype), itype)
bas1(:, hybrid%nindx(atoms%llo(i, itype), itype), atoms%llo(i, itype), itype) = flo(:, 1, i)
bas2(:, hybrid%nindx(atoms%llo(i, itype), itype), atoms%llo(i, itype), itype) = flo(:, 2, i)
hybrid%num_radfun_per_l(atoms%llo(i, itype), itype) = hybrid%num_radfun_per_l(atoms%llo(i, itype), itype) + 1
pointer_lo(i, itype) = hybrid%num_radfun_per_l(atoms%llo(i, itype), itype)
bas1(:, hybrid%num_radfun_per_l(atoms%llo(i, itype), itype), atoms%llo(i, itype), itype) = flo(:, 1, i)
bas2(:, hybrid%num_radfun_per_l(atoms%llo(i, itype), itype), atoms%llo(i, itype), itype) = flo(:, 2, i)
END DO
END IF
END DO
......@@ -320,11 +320,11 @@ CONTAINS
DO ilharm = 0, nlharm
i = 0
DO l1 = 0, atoms%lmax(itype)
DO p1 = 1, hybrid%nindx(l1, itype)
DO p1 = 1, hybrid%num_radfun_per_l(l1, itype)
i = i + 1
j = 0
DO l2 = 0, atoms%lmax(itype)
DO p2 = 1, hybrid%nindx(l2, itype)
DO p2 = 1, hybrid%num_radfun_per_l(l2, itype)
j = j + 1
IF (j <= i) THEN
DO igrid = 1, atoms%jri(itype)
......@@ -361,7 +361,7 @@ CONTAINS
pp1 = p1
END IF
IF (hybrid%nindx(l1, itype) <= 2) STOP 'subvxc: error hybrid%nindx'
IF (hybrid%num_radfun_per_l(l1, itype) <= 2) STOP 'subvxc: error hybrid%num_radfun_per_l'
lm = 0
......
......@@ -384,7 +384,7 @@ CONTAINS
DO itype = 1, atoms%ntype
DO l = 0, atoms%lmax(itype)
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
DO n2 = 1, nn
DO n1 = 1, nn
olapmt(n1, n2, l, itype) = intgrf( &
......@@ -407,7 +407,7 @@ CONTAINS
lm = 0
DO l = 0, atoms%lmax(itype)
DO M = -l, l
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
DO iband1 = 1, hybrid%nbands(nk)
carr(:nn) = matmul(olapmt(:nn, :nn, l, itype),&
& cmt(iband1, lm + 1:lm + nn, iatom))
......
......@@ -93,7 +93,7 @@ CONTAINS
lm0 = 0
DO l = 0, atoms%lmax(itype)
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
DO n = 1, nn
lm1 = lm0 + n
lm2 = lm0 + n + 2*l*nn
......@@ -237,7 +237,7 @@ CONTAINS
lm0 = 0
DO l = 0, atoms%lmax(itype)
nn = hybrid%nindx(l, itype)
nn = hybrid%num_radfun_per_l(l, itype)
DO n = 1, nn
lm1 = lm0 + n
lm2 = lm0 + n + 2*l*nn
......
This diff is collapsed.
......@@ -242,7 +242,7 @@ CONTAINS
! lmstart = lm start index for each l-quantum number and atom type (for cmt-coefficients)
DO itype = 1, atoms%ntype
DO l = 0, atoms%lmax(itype)
lmstart(l, itype) = sum([(hybrid%nindx(ll, itype)*(2*ll+1), ll=0, l-1)])
lmstart(l, itype) = sum([(hybrid%num_radfun_per_l(ll, itype)*(2*ll+1), ll=0, l-1)])
END DO
END DO
......@@ -279,7 +279,7 @@ CONTAINS
DO m1 = -l1, l1
m2 = m1 + m ! Gaunt condition -m1+m2-m=0
IF (abs(m2) <= l2) THEN
lm2 = lm2_0 + n2 + (m2 + l2)*hybrid%nindx(l2, itype)
lm2 = lm2_0 + n2 + (m2 + l2)*hybrid%num_radfun_per_l(l2, itype)
IF (abs(hybdat%gauntarr(1, l1, l2, l, m1, m)) > 1e-12) THEN
carr = carr + hybdat%gauntarr(1, l1, l2, l, m1, m) &
* outer_prod(cmt(bandoi:bandof, lm2, ic), &
......@@ -289,7 +289,7 @@ CONTAINS
m2 = m1 - m ! switch role of b1 and b2
IF (abs(m2) <= l2 .and. offdiag) THEN
lm2 = lm2_0 + n2 + (m2 + l2)*hybrid%nindx(l2, itype)
lm2 = lm2_0 + n2 + (m2 + l2)*hybrid%num_radfun_per_l(l2, itype)
IF (abs(hybdat%gauntarr(2, l1, l2, l, m1, m)) > 1e-12) THEN
carr = carr + hybdat%gauntarr(2, l1, l2, l, m1, m) &
* outer_prod(cmt(bandoi:bandof, lm1, ic),&
......@@ -297,7 +297,7 @@ CONTAINS
END IF
END IF
lm1 = lm1 + hybrid%nindx(l1, itype) ! go to lm start index for next m1-quantum number
lm1 = lm1 + hybrid%num_radfun_per_l(l1, itype) ! go to lm start index for next m1-quantum number
END DO !m1
......
......@@ -168,7 +168,7 @@ SUBROUTINE initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
ALLOCATE(oneD%invtab1(oneD%odd%nop),oneD%multab1(oneD%odd%nop,oneD%odd%nop))
ALLOCATE(oneD%igfft1(0:oneD%odd%nn2d-1,2),oneD%pgfft1(0:oneD%odd%nn2d-1))
ALLOCATE(hybrid%nindx(0:atoms%lmaxd,atoms%ntype))
ALLOCATE(hybrid%num_radfun_per_l(0:atoms%lmaxd,atoms%ntype))
ALLOCATE(hybrid%select1(4,atoms%ntype),hybrid%lcutm1(atoms%ntype))
ALLOCATE(hybrid%lcutwf(atoms%ntype))
......
......@@ -138,7 +138,7 @@ CONTAINS
atoms%llo(:,:) = -1
input%eig66(1)=.FALSE.
! HF/hybrid functionals/EXX
ALLOCATE ( hybrid%nindx(0:atoms%lmaxd,atoms%ntype) )
ALLOCATE ( hybrid%num_radfun_per_l(0:atoms%lmaxd,atoms%ntype) )
kpts%specificationType = 0
atoms%numStatesProvided(:) = 0
......
......@@ -417,7 +417,7 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
! Initialize missing hybrid functionals arrays
ALLOCATE (hybrid%nindx(0:atoms%lmaxd,atoms%ntype))
ALLOCATE (hybrid%num_radfun_per_l(0:atoms%lmaxd,atoms%ntype))
! Generate lattice harmonics
......
......@@ -12,13 +12,13 @@ MODULE m_types_hybrid
INTEGER :: nbasp
INTEGER :: maxlcutm1
INTEGER :: maxbasm1
INTEGER :: maxindxp1
INTEGER :: max_indx_p_1
INTEGER :: maxgptm
INTEGER :: maxgptm1
INTEGER :: maxindx
INTEGER :: maxlmindx
INTEGER :: gptmd
INTEGER, ALLOCATABLE :: nindx(:,:)
INTEGER, ALLOCATABLE :: num_radfun_per_l(:,:)
INTEGER, ALLOCATABLE :: select1(:,:)
INTEGER, ALLOCATABLE :: lcutm1(:)
INTEGER, ALLOCATABLE :: nindxm1(:,:)
......@@ -159,7 +159,7 @@ contains
type(t_atoms), intent(in) :: atoms
integer :: ok
ALLOCATE (prod%l1(hybrid%maxindxp1, 0:hybrid%maxlcutm1, atoms%ntype), stat=ok)
ALLOCATE (prod%l1(hybrid%max_indx_p_1, 0:hybrid%maxlcutm1, atoms%ntype), stat=ok)
IF (ok /= 0) call judft_error('init_prodtype: failure allocation prod%l1')
ALLOCATE (prod%l2, mold=prod%l1, stat=ok)
......
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