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

rename nindxm1 => num_rad_bas_fun

parent b6009502
This diff is collapsed.
......@@ -134,11 +134,11 @@ CONTAINS
REAL, ALLOCATABLE :: cprod_vv_r(:, :, :), carr3_vv_r(:, :, :)
COMPLEX, ALLOCATABLE :: cprod_vv_c(:, :, :), carr3_vv_c(:, :, :)
REAL :: coulomb_mt1(maxval(hybrid%nindxm1) - 1, maxval(hybrid%nindxm1) - 1, 0:maxval(hybrid%lcutm1), atoms%ntype)
REAL :: coulomb_mt2_r(maxval(hybrid%nindxm1) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
REAL :: coulomb_mt3_r(maxval(hybrid%nindxm1) - 1, atoms%nat, atoms%nat)
COMPLEX :: coulomb_mt2_c(maxval(hybrid%nindxm1) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
COMPLEX :: coulomb_mt3_c(maxval(hybrid%nindxm1) - 1, atoms%nat, atoms%nat)
REAL :: coulomb_mt1(maxval(hybrid%num_rad_bas_fun) - 1, maxval(hybrid%num_rad_bas_fun) - 1, 0:maxval(hybrid%lcutm1), atoms%ntype)
REAL :: coulomb_mt2_r(maxval(hybrid%num_rad_bas_fun) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
REAL :: coulomb_mt3_r(maxval(hybrid%num_rad_bas_fun) - 1, atoms%nat, atoms%nat)
COMPLEX :: coulomb_mt2_c(maxval(hybrid%num_rad_bas_fun) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
COMPLEX :: coulomb_mt3_c(maxval(hybrid%num_rad_bas_fun) - 1, atoms%nat, atoms%nat)
REAL :: coulomb_mtir_r(((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpbasis%ngptm))* &
((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpbasis%ngptm) + 1)/2)
......@@ -244,7 +244,7 @@ CONTAINS
exch_vv = exch_vv + &
dynamic_hse_adjustment(atoms%rmsh, atoms%rmt, atoms%dx, atoms%jri, atoms%jmtd, kpts%bkf(:, ikpt0), ikpt0, &
kpts%nkptf, cell%bmat, cell%omtil, atoms%ntype, atoms%neq, atoms%nat, atoms%taual, &
hybrid%lcutm1, maxval(hybrid%lcutm1), hybrid%nindxm1, maxval(hybrid%nindxm1), mpbasis%gptm, &
hybrid%lcutm1, maxval(hybrid%lcutm1), hybrid%num_rad_bas_fun, maxval(hybrid%num_rad_bas_fun), mpbasis%gptm, &
mpbasis%ngptm(ikpt0), mpbasis%gptm_ptr(:, ikpt0), mpbasis%num_gpts(), hybrid%basm1, &
hybrid%nbasm(ikpt0), iband1, hybrid%nbands(nk), nsest, ibando, psize, indx_sest, &
atoms%invsat, sym%invsatnr, mpi%irank, cprod_vv_r(:hybrid%nbasm(ikpt0), :, :), &
......
......@@ -216,7 +216,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%max_indx_p_1, 0:maxval(hybrid%lcutm1), atoms%ntype), stat=ok)
allocate(hybdat%prodm(maxval(hybrid%num_rad_bas_fun), hybrid%max_indx_p_1, 0:maxval(hybrid%lcutm1), atoms%ntype), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation hybdat%prodm')
call hybdat%prod%init(hybrid, atoms)
......@@ -248,7 +248,7 @@ CONTAINS
hybdat%prod%l2(n,l,itype) = l2
hybdat%prod%n1(n,l,itype) = n1
hybdat%prod%n2(n,l,itype) = n2
DO i = 1, hybrid%nindxm1(l, itype)
DO i = 1, hybrid%num_rad_bas_fun(l, itype)
hybdat%prodm(i, n, l, itype) = intgrf(basprod(:ng)*hybrid%basm1(:ng, i, l, itype), atoms%jri, &
atoms%jmtd, atoms%rmsh, atoms%dx, atoms%ntype, itype, hybdat%gridf)
END DO
......
......@@ -102,7 +102,7 @@ CONTAINS
! Deallocate arrays which might have been allocated in a previous run of this subroutine
IF (ALLOCATED(mpbasis%ngptm)) deallocate(mpbasis%ngptm)
IF (ALLOCATED(hybrid%nindxm1)) deallocate(hybrid%nindxm1)
IF (ALLOCATED(hybrid%num_rad_bas_fun)) deallocate(hybrid%num_rad_bas_fun)
IF (ALLOCATED(mpbasis%gptm_ptr)) deallocate(mpbasis%gptm_ptr)
IF (ALLOCATED(mpbasis%gptm)) deallocate(mpbasis%gptm)
IF (ALLOCATED(hybrid%basm1)) deallocate(hybrid%basm1)
......@@ -135,12 +135,12 @@ CONTAINS
WRITE (6, '(A)') 'Reduction due to overlap (quality of orthonormality, should be < 1.0E-06)'
END IF
allocate(hybrid%nindxm1(0:maxval(hybrid%lcutm1), atoms%ntype))
allocate(hybrid%num_rad_bas_fun(0:maxval(hybrid%lcutm1), atoms%ntype))
allocate(seleco(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd))
allocate(selecu(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd))
hybrid%nindxm1 = 0 !!! 01/12/10 jij%M.b.
hybrid%num_rad_bas_fun = 0 !!! 01/12/10 jij%M.b.
! determine maximal indices of (radial) mixed-basis functions (->nindxm1)
! determine maximal indices of (radial) mixed-basis functions (->num_rad_bas_fun)
! (will be reduced later-on due to overlap)
hybrid%max_indx_p_1 = 0
DO itype = 1, atoms%ntype
......@@ -191,11 +191,11 @@ CONTAINS
WRITE (6, '(A)') 'mixedbasis: Warning! No basis-function product of '//lchar(l)// &
'-angular momentum defined.'
hybrid%max_indx_p_1 = MAX(hybrid%max_indx_p_1, M)
hybrid%nindxm1(l, itype) = n*input%jspins
hybrid%num_rad_bas_fun(l, itype) = n*input%jspins
END DO
END DO
allocate(hybrid%basm1(atoms%jmtd, maxval(hybrid%nindxm1), 0:maxval(hybrid%lcutm1), atoms%ntype))
allocate(hybrid%basm1(atoms%jmtd, maxval(hybrid%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), atoms%ntype))
hybrid%basm1 = 0
! Define product bases and reduce them according to overlap
......@@ -215,7 +215,7 @@ CONTAINS
ng = atoms%jri(itype)
DO l = 0, hybrid%lcutm1(itype)
n = hybrid%nindxm1(l, itype)
n = hybrid%num_rad_bas_fun(l, itype)
! allow for zero product-basis functions for
! current l-quantum number
IF (n == 0) THEN
......@@ -292,13 +292,13 @@ CONTAINS
! Get rid of linear dependencies (eigenvalue <= hybrid%tolerance1)
nn = 0
DO i = 1, hybrid%nindxm1(l, itype)
DO i = 1, hybrid%num_rad_bas_fun(l, itype)
IF (eig(i) > hybrid%tolerance1) THEN
nn = nn + 1
ihelp(nn) = i
END IF
END DO
hybrid%nindxm1(l, itype) = nn
hybrid%num_rad_bas_fun(l, itype) = nn
eig = eig(ihelp)
eigv(:,:) = eigv(:,ihelp)
......@@ -335,7 +335,7 @@ CONTAINS
nn = nn + 1
deallocate(olap)
allocate(olap(nn, nn))
hybrid%nindxm1(l, itype) = nn
hybrid%num_rad_bas_fun(l, itype) = nn
END IF
! Check orthonormality of product basis
......@@ -373,14 +373,14 @@ CONTAINS
deallocate(olap, eigv, work, eig, ihelp)
END DO !l
IF (mpi%irank == 0) WRITE (6, '(6X,A,I7)') 'Total:', SUM(hybrid%nindxm1(0:hybrid%lcutm1(itype), itype))
IF (mpi%irank == 0) WRITE (6, '(6X,A,I7)') 'Total:', SUM(hybrid%num_rad_bas_fun(0:hybrid%lcutm1(itype), itype))
END DO ! itype
allocate(basmhlp(atoms%jmtd, maxval(hybrid%nindxm1), 0:maxval(hybrid%lcutm1), atoms%ntype))
basmhlp(1:atoms%jmtd, 1:maxval(hybrid%nindxm1), 0:maxval(hybrid%lcutm1), 1:atoms%ntype) &
= hybrid%basm1(1:atoms%jmtd, 1:maxval(hybrid%nindxm1), 0:maxval(hybrid%lcutm1), 1:atoms%ntype)
allocate(basmhlp(atoms%jmtd, maxval(hybrid%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), atoms%ntype))
basmhlp(1:atoms%jmtd, 1:maxval(hybrid%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), 1:atoms%ntype) &
= hybrid%basm1(1:atoms%jmtd, 1:maxval(hybrid%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), 1:atoms%ntype)
deallocate(hybrid%basm1)
allocate(hybrid%basm1(atoms%jmtd, maxval(hybrid%nindxm1), 0:maxval(hybrid%lcutm1), atoms%ntype))
allocate(hybrid%basm1(atoms%jmtd, maxval(hybrid%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), atoms%ntype))
hybrid%basm1 = basmhlp
deallocate(basmhlp, seleco, selecu, selecmat)
......@@ -406,7 +406,7 @@ CONTAINS
! determine radial function with the largest moment
! this function is used to build the linear combinations
rdum = 0
DO i = 1, hybrid%nindxm1(l, itype)
DO i = 1, hybrid%num_rad_bas_fun(l, itype)
rdum1 = intgrf(atoms%rmsh(:ng, itype)**(l + 1)*hybrid%basm1(:ng, i, l, itype), &
atoms%jri, atoms%jmtd, atoms%rmsh, atoms%dx, atoms%ntype, itype, gridf)
IF (ABS(rdum1) > rdum) THEN
......@@ -418,25 +418,25 @@ CONTAINS
! rearrange order of radial functions such that the last function possesses the largest moment
j = 0
bashlp(:ng) = hybrid%basm1(:ng, n, l, itype)
DO i = 1, hybrid%nindxm1(l, itype)
DO i = 1, hybrid%num_rad_bas_fun(l, itype)
IF (i == n) CYCLE
j = j + 1
hybrid%basm1(:ng, j, l, itype) = hybrid%basm1(:ng, i, l, itype)
END DO
hybrid%basm1(:ng, hybrid%nindxm1(l, itype), l, itype) = bashlp(:ng)
hybrid%basm1(:ng, hybrid%num_rad_bas_fun(l, itype), l, itype) = bashlp(:ng)
END DO
DO l = 0, hybrid%lcutm1(itype)
IF (mpi%irank == 0) WRITE (6, '(6X,A)') lchar(l)//':'
IF (hybrid%nindxm1(l, itype) == 0) THEN
IF (hybrid%num_rad_bas_fun(l, itype) == 0) THEN
IF (mpi%irank == 0) WRITE (6, '(6X,A,'': 0 -> '')') lchar(l)
CYCLE
END IF
n = hybrid%nindxm1(l, itype)
DO i = 1, hybrid%nindxm1(l, itype)
n = hybrid%num_rad_bas_fun(l, itype)
DO i = 1, hybrid%num_rad_bas_fun(l, itype)
IF (i == n) CYCLE
! calculate moment of radial function i
rdum1 = intgrf(atoms%rmsh(:ng, itype)**(l + 1)*hybrid%basm1(:ng, i, l, itype), &
......@@ -470,8 +470,8 @@ CONTAINS
! test orthogonality
rdum = 0
DO i = 1, hybrid%nindxm1(l, itype)
DO j = 1, hybrid%nindxm1(l, itype)
DO i = 1, hybrid%num_rad_bas_fun(l, itype)
DO j = 1, hybrid%num_rad_bas_fun(l, itype)
rdum1 = intgrf(hybrid%basm1(:ng, i, l, itype)*hybrid%basm1(:ng, j, l, itype), &
atoms%jri, atoms%jmtd, atoms%rmsh, atoms%dx, atoms%ntype, itype, gridf)
IF (i /= j) THEN
......@@ -489,7 +489,7 @@ CONTAINS
END DO
DO itype = 1, atoms%ntype
IF (ANY(hybrid%nindxm1(0:hybrid%lcutm1(itype), itype) == 0)) call judft_error('any hybrid%nindxm1 eq 0', calledby='mixedbasis')
IF (ANY(hybrid%num_rad_bas_fun(0:hybrid%lcutm1(itype), itype) == 0)) call judft_error('any hybrid%num_rad_bas_fun eq 0', calledby='mixedbasis')
END DO
!count basis functions
......@@ -498,7 +498,7 @@ CONTAINS
DO i = 1, atoms%neq(itype)
DO l = 0, hybrid%lcutm1(itype)
DO M = -l, l
DO j = 1, hybrid%nindxm1(l, itype)
DO j = 1, hybrid%num_rad_bas_fun(l, itype)
hybrid%nbasp = hybrid%nbasp + 1
END DO
END DO
......
......@@ -25,10 +25,10 @@
DO l = 0, hybrid%lcutm1(itype)
DO M = -l, l
WRITE (700 + ikpt, *) l, M
DO n = 1, hybrid%nindxm1(l, itype)
WRITE (700 + ikpt, '(16f8.4)') coulhlp(ic + n, ic + 1:ic + hybrid%nindxm1(l, itype))
DO n = 1, hybrid%num_rad_bas_fun(l, itype)
WRITE (700 + ikpt, '(16f8.4)') coulhlp(ic + n, ic + 1:ic + hybrid%num_rad_bas_fun(l, itype))
END DO
ic = ic + hybrid%nindxm1(l, itype)
ic = ic + hybrid%num_rad_bas_fun(l, itype)
ENDDO
END DO
END DO
......@@ -41,7 +41,7 @@
DO ineq = 1, atoms%neq(itype)
DO l = 0, hybrid%lcutm1(itype)
DO M = -l, l
DO n = 1, hybrid%nindxm1(l, itype) - 1
DO n = 1, hybrid%num_rad_bas_fun(l, itype) - 1
ic2 = ic2 + 1
END DO
END DO
......@@ -55,16 +55,16 @@
DO ineq = 1, atoms%neq(itype)
DO l = 0, hybrid%lcutm1(itype)
DO M = -l, l
DO n = 1, hybrid%nindxm1(l, itype) - 1
coulhlp1(ic + n, ic + 1:ic + hybrid%nindxm1(l, itype) - 1) &
= coulhlp(ic1 + n, ic1 + 1:ic1 + hybrid%nindxm1(l, itype) - 1)
DO n = 1, hybrid%num_rad_bas_fun(l, itype) - 1
coulhlp1(ic + n, ic + 1:ic + hybrid%num_rad_bas_fun(l, itype) - 1) &
= coulhlp(ic1 + n, ic1 + 1:ic1 + hybrid%num_rad_bas_fun(l, itype) - 1)
END DO
coulhlp1(ic2 + 1, ic + 1:ic + hybrid%nindxm1(l, itype) - 1) &
= coulhlp(ic1 + hybrid%nindxm1(l, itype), ic1 + 1:ic1 + hybrid%nindxm1(l, itype) - 1)
coulhlp1(ic2 + 1, ic + 1:ic + hybrid%num_rad_bas_fun(l, itype) - 1) &
= coulhlp(ic1 + hybrid%num_rad_bas_fun(l, itype), ic1 + 1:ic1 + hybrid%num_rad_bas_fun(l, itype) - 1)
ic = ic + hybrid%nindxm1(l, itype) - 1
ic1 = ic1 + hybrid%nindxm1(l, itype)
ic = ic + hybrid%num_rad_bas_fun(l, itype) - 1
ic1 = ic1 + hybrid%num_rad_bas_fun(l, itype)
ic2 = ic2 + 1
END DO
......@@ -78,15 +78,15 @@
ic = 0; ic1 = 0
DO itype = 1, atoms%ntype
DO ineq = 1, atoms%neq(itype)
WRITE (*, *) ic + 1, ic + hybrid%nindxm1(0, itype) - 1, ic1 + 1, &
ic1 + hybrid%nindxm1(0, itype) - 1
coulhlp1(ic + 1:ic + hybrid%nindxm1(0, itype) - 1, nbasp + 1) &
= coulhlp(ic1 + 1:ic1 + hybrid%nindxm1(0, itype) - 1, nbasp + 1)
coulhlp1(nbasp + 1, ic + 1:ic + hybrid%nindxm1(0, itype) - 1) &
= coulhlp(nbasp + 1, ic1 + 1:ic1 + hybrid%nindxm1(0, itype) - 1)
ic = ic + SUM((/((2*l + 1)*(hybrid%nindxm1(l, itype) - 1), &
WRITE (*, *) ic + 1, ic + hybrid%num_rad_bas_fun(0, itype) - 1, ic1 + 1, &
ic1 + hybrid%num_rad_bas_fun(0, itype) - 1
coulhlp1(ic + 1:ic + hybrid%num_rad_bas_fun(0, itype) - 1, nbasp + 1) &
= coulhlp(ic1 + 1:ic1 + hybrid%num_rad_bas_fun(0, itype) - 1, nbasp + 1)
coulhlp1(nbasp + 1, ic + 1:ic + hybrid%num_rad_bas_fun(0, itype) - 1) &
= coulhlp(nbasp + 1, ic1 + 1:ic1 + hybrid%num_rad_bas_fun(0, itype) - 1)
ic = ic + SUM((/((2*l + 1)*(hybrid%num_rad_bas_fun(l, itype) - 1), &
l=0, hybrid%lcutm1(itype))/))
ic1 = ic1 + SUM((/((2*l + 1)*hybrid%nindxm1(l, itype), &
ic1 = ic1 + SUM((/((2*l + 1)*hybrid%num_rad_bas_fun(l, itype), &
l=0, hybrid%lcutm1(itype))/))
END DO
END DO
......@@ -96,7 +96,7 @@
DO ineq = 1, atoms%neq(itype)
DO l = 0, hybrid%lcutm1(itype)
DO M = -l, l
DO n = 1, hybrid%nindxm1(l, itype) - 1
DO n = 1, hybrid%num_rad_bas_fun(l, itype) - 1
ic2 = ic2 + 1
END DO
END DO
......@@ -111,7 +111,7 @@
DO M = -l, l
ic2 = ic2 + 1
ic1 = ic1 + hybrid%nindxm1(l, itype)
ic1 = ic1 + hybrid%num_rad_bas_fun(l, itype)
IF (l /= 0) CYCLE
WRITE (900, *) ic2, ic1, itype, ineq
......@@ -119,16 +119,16 @@
ic3 = 0
ic4 = 0
DO itype1 = 1, atoms%ntype
ishift = SUM((/((2*l2 + 1)*hybrid%nindxm1(l2, itype1), &
ishift = SUM((/((2*l2 + 1)*hybrid%num_rad_bas_fun(l2, itype1), &
l2=0, hybrid%lcutm1(itype1))/))
ishift1 = SUM((/((2*l2 + 1)*(hybrid%nindxm1(l2, itype1) - 1), &
ishift1 = SUM((/((2*l2 + 1)*(hybrid%num_rad_bas_fun(l2, itype1) - 1), &
l2=0, hybrid%lcutm1(itype1))/))
DO ineq1 = 1, atoms%neq(itype1)
ic5 = ic3 + (ineq1 - 1)*ishift + 1
ic6 = ic5 + hybrid%nindxm1(0, itype1) - 2
ic6 = ic5 + hybrid%num_rad_bas_fun(0, itype1) - 2
ic7 = ic4 + (ineq1 - 1)*ishift1 + 1
ic8 = ic7 + hybrid%nindxm1(0, itype1) - 2
ic8 = ic7 + hybrid%num_rad_bas_fun(0, itype1) - 2
WRITE (901, *) ic2, ic7, ic8, ic1, ic5, ic6, itype, itype1
coulhlp1(ic2, ic7:ic8) = coulhlp(ic1, ic5:ic6)
......@@ -154,7 +154,7 @@
DO ineq = 1, atoms%neq(itype)
DO l = 0, hybrid%lcutm1(itype)
DO M = -l, l
DO n = 1, hybrid%nindxm1(l, itype) - 1
DO n = 1, hybrid%num_rad_bas_fun(l, itype) - 1
ic2 = ic2 + 1
END DO
END DO
......@@ -169,7 +169,7 @@
DO M = -l, l
ic2 = ic2 + 1
ic1 = ic1 + hybrid%nindxm1(l, itype)
ic1 = ic1 + hybrid%num_rad_bas_fun(l, itype)
ic3 = 0
ic4 = ic2
......@@ -177,7 +177,7 @@
DO ineq1 = 1, atoms%neq(itype1)
DO l1 = 0, hybrid%lcutm1(itype1)
DO m1 = -l1, l1
ic3 = ic3 + hybrid%nindxm1(l1, itype1)
ic3 = ic3 + hybrid%num_rad_bas_fun(l1, itype1)
IF (ic3 < ic1) CYCLE
WRITE (300, '(4i6,2f15.10)') ic2, ic4, ic1, ic3, coulhlp(ic1, ic3)
coulhlp1(ic2, ic4) = coulhlp(ic1, ic3)
......@@ -216,10 +216,10 @@
DO M = -l, l
WRITE (800 + ikpt, *) l, M
DO n = 1, hybrid%nindxm1(l, itype) - 1
WRITE (800 + ikpt, '(16f8.4)') coulhlp1(ic + n, ic + 1:ic + hybrid%nindxm1(l, itype) - 1)
DO n = 1, hybrid%num_rad_bas_fun(l, itype) - 1
WRITE (800 + ikpt, '(16f8.4)') coulhlp1(ic + n, ic + 1:ic + hybrid%num_rad_bas_fun(l, itype) - 1)
END DO
ic = ic + hybrid%nindxm1(l, itype) - 1
ic = ic + hybrid%num_rad_bas_fun(l, itype) - 1
ENDDO
END DO
END DO
......
......@@ -26,9 +26,9 @@ CONTAINS
INTEGER, INTENT(IN) :: ikpt
! - arrays -
REAL, INTENT(IN) :: coulomb_mt1(maxval(hybrid%nindxm1) - 1, maxval(hybrid%nindxm1) - 1,&
REAL, INTENT(IN) :: coulomb_mt1(maxval(hybrid%num_rad_bas_fun) - 1, maxval(hybrid%num_rad_bas_fun) - 1,&
& 0:maxval(hybrid%lcutm1), atoms%ntype)
REAL, INTENT(IN) :: coulomb_mt2(maxval(hybrid%nindxm1) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1),&
REAL, INTENT(IN) :: coulomb_mt2(maxval(hybrid%num_rad_bas_fun) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1),&
& 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
REAL, INTENT(IN) :: coulomb_mt3(:, :, :)
REAL, INTENT(IN) :: coulomb_mtir(:)
......@@ -53,7 +53,7 @@ CONTAINS
vecinhlp = vecin
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), hybrid%nindxm1, 1, vecinhlp)
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), hybrid%num_rad_bas_fun, 1, vecinhlp)
ibasm = 0
iatom = 0
......@@ -62,7 +62,7 @@ CONTAINS
iatom = iatom + 1
DO l = 0, hybrid%lcutm1(itype)
DO m = -l, l
ibasm = ibasm + hybrid%nindxm1(l, itype) - 1
ibasm = ibasm + hybrid%num_rad_bas_fun(l, itype) - 1
END DO
END DO
END DO
......@@ -77,13 +77,13 @@ CONTAINS
DO l = 0, hybrid%lcutm1(itype)
DO m = -l, l
indx1 = indx1 + 1
indx2 = indx2 + hybrid%nindxm1(l, itype) - 1
indx2 = indx2 + hybrid%num_rad_bas_fun(l, itype) - 1
indx3 = indx3 + 1
vecout(indx1:indx2) = matmul(coulomb_mt1(:hybrid%nindxm1(l, itype) - 1, :hybrid%nindxm1(l, itype) - 1, l, itype),&
vecout(indx1:indx2) = matmul(coulomb_mt1(:hybrid%num_rad_bas_fun(l, itype) - 1, :hybrid%num_rad_bas_fun(l, itype) - 1, l, itype),&
& vecinhlp(indx1:indx2))
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:hybrid%nindxm1(l, itype) - 1, m, l, iatom)*vecinhlp(indx3)
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:hybrid%num_rad_bas_fun(l, itype) - 1, m, l, iatom)*vecinhlp(indx3)
indx1 = indx2
END DO
......@@ -98,14 +98,14 @@ CONTAINS
iatom = 0
indx0 = 0
DO itype = 1, atoms%ntype
ishift = sum([((2*l + 1)*(hybrid%nindxm1(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
ishift = sum([((2*l + 1)*(hybrid%num_rad_bas_fun(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
DO ieq = 1, atoms%neq(itype)
iatom = iatom + 1
l = 0
m = 0
indx1 = indx0 + 1
indx2 = indx1 + hybrid%nindxm1(l, itype) - 2
indx2 = indx1 + hybrid%num_rad_bas_fun(l, itype) - 2
iatom1 = 0
indx3 = ibasm
......@@ -116,7 +116,7 @@ CONTAINS
indx4 = indx3 + (ieq1 - 1)*ishift1 + 1
IF (iatom == iatom1) CYCLE
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt3(:hybrid%nindxm1(l, itype) - 1, iatom1, iatom)*vecinhlp(indx4)
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt3(:hybrid%num_rad_bas_fun(l, itype) - 1, iatom1, iatom)*vecinhlp(indx4)
END DO
indx3 = indx3 + atoms%neq(itype1)*ishift1
......@@ -124,7 +124,7 @@ CONTAINS
IF (indx3 /= hybrid%nbasp) call judft_error('spmvec: error counting index indx3')
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:hybrid%nindxm1(l, itype) - 1, 0, maxval(hybrid%lcutm1) + 1, iatom)*vecinhlp(indx3 + 1)
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:hybrid%num_rad_bas_fun(l, itype) - 1, 0, maxval(hybrid%lcutm1) + 1, iatom)*vecinhlp(indx3 + 1)
indx0 = indx0 + ishift
END DO
......@@ -144,7 +144,7 @@ CONTAINS
DO ieq = 1, atoms%neq(itype)
iatom = iatom + 1
DO l = 0, hybrid%lcutm1(itype)
n = hybrid%nindxm1(l, itype)
n = hybrid%num_rad_bas_fun(l, itype)
DO m = -l, l
indx1 = indx1 + 1
indx2 = indx2 + 1
......@@ -162,12 +162,12 @@ CONTAINS
iatom = 0
indx0 = 0
DO itype = 1, atoms%ntype
ishift = sum([((2*l + 1)*(hybrid%nindxm1(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
ishift = sum([((2*l + 1)*(hybrid%num_rad_bas_fun(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
DO ieq = 1, atoms%neq(itype)
iatom = iatom + 1
indx1 = indx0 + 1
indx2 = indx1 + hybrid%nindxm1(0, itype) - 2
vecout(hybrid%nbasp + 1) = vecout(hybrid%nbasp + 1) + dot_product(coulomb_mt2(:hybrid%nindxm1(0, itype) - 1, 0, maxval(hybrid%lcutm1) + 1, iatom), vecinhlp(indx1:indx2))
indx2 = indx1 + hybrid%num_rad_bas_fun(0, itype) - 2
vecout(hybrid%nbasp + 1) = vecout(hybrid%nbasp + 1) + dot_product(coulomb_mt2(:hybrid%num_rad_bas_fun(0, itype) - 1, 0, maxval(hybrid%lcutm1) + 1, iatom), vecinhlp(indx1:indx2))
indx0 = indx0 + ishift
END DO
......@@ -184,15 +184,15 @@ CONTAINS
iatom1 = 0
indx2 = 0
DO itype1 = 1, atoms%ntype
ishift1 = sum([((2*l + 1)*(hybrid%nindxm1(l, itype1) - 1), l=0, hybrid%lcutm1(itype1))])
ishift1 = sum([((2*l + 1)*(hybrid%num_rad_bas_fun(l, itype1) - 1), l=0, hybrid%lcutm1(itype1))])
DO ieq1 = 1, atoms%neq(itype1)
iatom1 = iatom1 + 1
IF (iatom1 == iatom) CYCLE
indx3 = indx2 + (ieq1 - 1)*ishift1 + 1
indx4 = indx3 + hybrid%nindxm1(0, itype1) - 2
indx4 = indx3 + hybrid%num_rad_bas_fun(0, itype1) - 2
vecout(indx1) = vecout(indx1) + dot_product(coulomb_mt3(:hybrid%nindxm1(0, itype1) - 1, iatom, iatom1), vecinhlp(indx3:indx4))
vecout(indx1) = vecout(indx1) + dot_product(coulomb_mt3(:hybrid%num_rad_bas_fun(0, itype1) - 1, iatom, iatom1), vecinhlp(indx3:indx4))
END DO
indx2 = indx2 + atoms%neq(itype1)*ishift1
......@@ -203,7 +203,7 @@ CONTAINS
IF (indx0 /= hybrid%nbasp) call judft_error('spmvec: error index counting (indx0)')
END IF
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), hybrid%nindxm1,&
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), hybrid%num_rad_bas_fun,&
& 2,&
& vecout)
......@@ -232,9 +232,9 @@ CONTAINS
INTEGER, INTENT(IN) :: ikpt
! - arrays -
REAL, INTENT(IN) :: coulomb_mt1(maxval(hybrid%nindxm1) - 1, maxval(hybrid%nindxm1) - 1,&
REAL, INTENT(IN) :: coulomb_mt1(maxval(hybrid%num_rad_bas_fun) - 1, maxval(hybrid%num_rad_bas_fun) - 1,&
& 0:maxval(hybrid%lcutm1), atoms%ntype)
COMPLEX, INTENT(IN) :: coulomb_mt2(maxval(hybrid%nindxm1) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1),&
COMPLEX, INTENT(IN) :: coulomb_mt2(maxval(hybrid%num_rad_bas_fun) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1),&
& 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
COMPLEX, INTENT(IN) :: coulomb_mt3(:, :, :)
COMPLEX, INTENT(IN) :: coulomb_mtir(:)
......@@ -254,13 +254,13 @@ CONTAINS
COMPLEX, PARAMETER :: img = (0.0, 1.0)
! - local arrays -
REAL :: vecr(maxval(hybrid%nindxm1) - 1), veci(maxval(hybrid%nindxm1) - 1)
REAL :: vecr(maxval(hybrid%num_rad_bas_fun) - 1), veci(maxval(hybrid%num_rad_bas_fun) - 1)
COMPLEX :: vecinhlp(hybrid%nbasm(ikpt))
COMPLEX, ALLOCATABLE :: coulhlp(:, :)
vecinhlp = vecin
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), hybrid%nindxm1, 1, vec_c=vecinhlp)
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), hybrid%num_rad_bas_fun, 1, vec_c=vecinhlp)
ibasm = 0
iatom = 0
......@@ -269,7 +269,7 @@ CONTAINS
iatom = iatom + 1
DO l = 0, hybrid%lcutm1(itype)
DO m = -l, l
ibasm = ibasm + hybrid%nindxm1(l, itype) - 1
ibasm = ibasm + hybrid%num_rad_bas_fun(l, itype) - 1
END DO
END DO
END DO
......@@ -284,13 +284,13 @@ CONTAINS
DO l = 0, hybrid%lcutm1(itype)
DO m = -l, l
indx1 = indx1 + 1
indx2 = indx2 + hybrid%nindxm1(l, itype) - 1
indx2 = indx2 + hybrid%num_rad_bas_fun(l, itype) - 1
indx3 = indx3 + 1
vecout(indx1:indx2) = matmul(coulomb_mt1(:hybrid%nindxm1(l, itype) - 1, :hybrid%nindxm1(l, itype) - 1, l, itype),&
vecout(indx1:indx2) = matmul(coulomb_mt1(:hybrid%num_rad_bas_fun(l, itype) - 1, :hybrid%num_rad_bas_fun(l, itype) - 1, l, itype),&
& vecinhlp(indx1:indx2))
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:hybrid%nindxm1(l, itype) - 1, m, l, iatom)*vecinhlp(indx3)
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:hybrid%num_rad_bas_fun(l, itype) - 1, m, l, iatom)*vecinhlp(indx3)
indx1 = indx2
END DO
......@@ -305,14 +305,14 @@ CONTAINS
iatom = 0
indx0 = 0
DO itype = 1, atoms%ntype
ishift = sum([((2*l + 1)*(hybrid%nindxm1(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
ishift = sum([((2*l + 1)*(hybrid%num_rad_bas_fun(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
DO ieq = 1, atoms%neq(itype)
iatom = iatom + 1
l = 0
m = 0
indx1 = indx0 + 1
indx2 = indx1 + hybrid%nindxm1(l, itype) - 2
indx2 = indx1<