Commit b4663d25 authored by Matthias Redies's avatar Matthias Redies

consistent naming: num_rad_bas_fun => num_radbasfn

parent a03cdef3
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(mpbasis%num_rad_bas_fun) - 1, maxval(mpbasis%num_rad_bas_fun) - 1, 0:maxval(hybrid%lcutm1), atoms%ntype)
REAL :: coulomb_mt2_r(maxval(mpbasis%num_rad_bas_fun) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
REAL :: coulomb_mt3_r(maxval(mpbasis%num_rad_bas_fun) - 1, atoms%nat, atoms%nat)
COMPLEX :: coulomb_mt2_c(maxval(mpbasis%num_rad_bas_fun) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
COMPLEX :: coulomb_mt3_c(maxval(mpbasis%num_rad_bas_fun) - 1, atoms%nat, atoms%nat)
REAL :: coulomb_mt1(maxval(mpbasis%num_radbasfn) - 1, maxval(mpbasis%num_radbasfn) - 1, 0:maxval(hybrid%lcutm1), atoms%ntype)
REAL :: coulomb_mt2_r(maxval(mpbasis%num_radbasfn) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
REAL :: coulomb_mt3_r(maxval(mpbasis%num_radbasfn) - 1, atoms%nat, atoms%nat)
COMPLEX :: coulomb_mt2_c(maxval(mpbasis%num_radbasfn) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
COMPLEX :: coulomb_mt3_c(maxval(mpbasis%num_radbasfn) - 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), mpbasis%num_rad_bas_fun, maxval(mpbasis%num_rad_bas_fun), mpbasis%gptm, &
hybrid%lcutm1, maxval(hybrid%lcutm1), mpbasis%num_radbasfn, maxval(mpbasis%num_radbasfn), mpbasis%gptm, &
mpbasis%ngptm(ikpt0), mpbasis%gptm_ptr(:, ikpt0), mpbasis%num_gpts(), mpbasis%radbasfn_mt, &
hybrid%nbasm(ikpt0), iband1, hybrid%nbands(nk), nsest, ibando, psize, indx_sest, &
atoms%invsat, sym%invsatnr, mpi%irank, cprod_vv_r(:hybrid%nbasm(ikpt0), :, :), &
......
......@@ -217,7 +217,7 @@ CONTAINS
allocate(basprod(atoms%jmtd), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation basprod')
allocate(hybdat%prodm(maxval(mpbasis%num_rad_bas_fun), hybrid%max_indx_p_1, 0:maxval(hybrid%lcutm1), atoms%ntype), stat=ok)
allocate(hybdat%prodm(maxval(mpbasis%num_radbasfn), 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)
......@@ -249,7 +249,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, mpbasis%num_rad_bas_fun(l, itype)
DO i = 1, mpbasis%num_radbasfn(l, itype)
hybdat%prodm(i, n, l, itype) = intgrf(basprod(:ng)*mpbasis%radbasfn_mt(:ng, i, l, itype), &
atoms, itype, hybdat%gridf)
END DO
......
......@@ -95,7 +95,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(mpbasis%num_rad_bas_fun)) deallocate(mpbasis%num_rad_bas_fun)
IF (ALLOCATED(mpbasis%num_radbasfn)) deallocate(mpbasis%num_radbasfn)
IF (ALLOCATED(mpbasis%gptm_ptr)) deallocate(mpbasis%gptm_ptr)
IF (ALLOCATED(mpbasis%gptm)) deallocate(mpbasis%gptm)
IF (ALLOCATED(mpbasis%radbasfn_mt)) deallocate(mpbasis%radbasfn_mt)
......@@ -128,12 +128,12 @@ CONTAINS
WRITE (6, '(A)') 'Reduction due to overlap (quality of orthonormality, should be < 1.0E-06)'
END IF
allocate(mpbasis%num_rad_bas_fun(0:maxval(hybrid%lcutm1), atoms%ntype))
allocate(mpbasis%num_radbasfn(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))
mpbasis%num_rad_bas_fun = 0 !!! 01/12/10 jij%M.b.
mpbasis%num_radbasfn = 0 !!! 01/12/10 jij%M.b.
! determine maximal indices of (radial) mixed-basis functions (->num_rad_bas_fun)
! determine maximal indices of (radial) mixed-basis functions (->num_radbasfn)
! (will be reduced later-on due to overlap)
hybrid%max_indx_p_1 = 0
DO itype = 1, atoms%ntype
......@@ -184,12 +184,12 @@ 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)
mpbasis%num_rad_bas_fun(l, itype) = n_radbasfn*input%jspins
mpbasis%num_radbasfn(l, itype) = n_radbasfn*input%jspins
END DO
END DO
allocate(mpbasis%radbasfn_mt(atoms%jmtd,&
maxval(mpbasis%num_rad_bas_fun), &
maxval(mpbasis%num_radbasfn), &
0:maxval(hybrid%lcutm1), &
atoms%ntype), source=0.0)
......@@ -210,7 +210,7 @@ CONTAINS
n_grid_pt = atoms%jri(itype)
DO l = 0, hybrid%lcutm1(itype)
n_radbasfn = mpbasis%num_rad_bas_fun(l, itype)
n_radbasfn = mpbasis%num_radbasfn(l, itype)
! allow for zero product-basis functions for
! current l-quantum number
IF (n_radbasfn == 0) THEN
......@@ -276,7 +276,7 @@ CONTAINS
call filter_radbasfn(hybrid, l, itype, n_radbasfn, eig, eigv, mpbasis)
call trafo_to_orthonorm_bas(mpbasis, n_radbasfn, n_grid_pt, l, itype, eig, eigv)
nn = mpbasis%num_rad_bas_fun(l, itype)
nn = mpbasis%num_radbasfn(l, itype)
! Add constant function to l=0 basis and then do a Gram-Schmidt orthonormalization
call add_l0_fun(atoms, hybrid, n_grid_pt, l, itype, gridf, nn, mpbasis)
......@@ -287,14 +287,14 @@ CONTAINS
deallocate(olap, eigv, work, eig)
END DO !l
IF (mpi%irank == 0) WRITE (6, '(6X,A,I7)') 'Total:', SUM(mpbasis%num_rad_bas_fun(0:hybrid%lcutm1(itype), itype))
IF (mpi%irank == 0) WRITE (6, '(6X,A,I7)') 'Total:', SUM(mpbasis%num_radbasfn(0:hybrid%lcutm1(itype), itype))
END DO ! itype
allocate(basmhlp(atoms%jmtd, maxval(mpbasis%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), atoms%ntype))
basmhlp(1:atoms%jmtd, 1:maxval(mpbasis%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), 1:atoms%ntype) &
= mpbasis%radbasfn_mt(1:atoms%jmtd, 1:maxval(mpbasis%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), 1:atoms%ntype)
allocate(basmhlp(atoms%jmtd, maxval(mpbasis%num_radbasfn), 0:maxval(hybrid%lcutm1), atoms%ntype))
basmhlp(1:atoms%jmtd, 1:maxval(mpbasis%num_radbasfn), 0:maxval(hybrid%lcutm1), 1:atoms%ntype) &
= mpbasis%radbasfn_mt(1:atoms%jmtd, 1:maxval(mpbasis%num_radbasfn), 0:maxval(hybrid%lcutm1), 1:atoms%ntype)
deallocate(mpbasis%radbasfn_mt)
allocate(mpbasis%radbasfn_mt(atoms%jmtd, maxval(mpbasis%num_rad_bas_fun), 0:maxval(hybrid%lcutm1), atoms%ntype))
allocate(mpbasis%radbasfn_mt(atoms%jmtd, maxval(mpbasis%num_radbasfn), 0:maxval(hybrid%lcutm1), atoms%ntype))
mpbasis%radbasfn_mt = basmhlp
deallocate(basmhlp, seleco, selecu, selecmat)
......@@ -320,7 +320,7 @@ CONTAINS
! determine radial function with the largest moment
! this function is used to build the linear combinations
max_momentum = 0
DO i = 1, mpbasis%num_rad_bas_fun(l, itype)
DO i = 1, mpbasis%num_radbasfn(l, itype)
momentum = intgrf(atoms%rmsh(:n_grid_pt, itype)**(l + 1)*mpbasis%radbasfn_mt(:n_grid_pt, i, l, itype), &
atoms, itype, gridf)
IF (ABS(momentum) > max_momentum) THEN
......@@ -332,13 +332,13 @@ CONTAINS
! rearrange order of radial functions such that the last function possesses the largest moment
bashlp(:n_grid_pt) = mpbasis%radbasfn_mt(:n_grid_pt, n_radbasfn, l, itype)
mpbasis%radbasfn_mt(:n_grid_pt,&
n_radbasfn:mpbasis%num_rad_bas_fun(l, itype)-1,&
n_radbasfn:mpbasis%num_radbasfn(l, itype)-1,&
:, itype)&
= mpbasis%radbasfn_mt(:n_grid_pt,&
n_radbasfn+1:mpbasis%num_rad_bas_fun(l, itype),&
n_radbasfn+1:mpbasis%num_radbasfn(l, itype),&
:, itype)
mpbasis%radbasfn_mt(:n_grid_pt, &
mpbasis%num_rad_bas_fun(l, itype),&
mpbasis%num_radbasfn(l, itype),&
l, itype) &
= bashlp(:n_grid_pt)
END DO
......@@ -346,12 +346,12 @@ CONTAINS
DO l = 0, hybrid%lcutm1(itype)
IF (mpi%irank == 0) WRITE (6, '(6X,A)') lchar(l)//':'
IF (mpbasis%num_rad_bas_fun(l, itype) == 0) THEN
IF (mpbasis%num_radbasfn(l, itype) == 0) THEN
IF (mpi%irank == 0) WRITE (6, '(6X,A,'': 0 -> '')') lchar(l)
CYCLE
END IF
n_radbasfn = mpbasis%num_rad_bas_fun(l, itype)
n_radbasfn = mpbasis%num_radbasfn(l, itype)
DO i = 1, n_radbasfn-1
! calculate moment of radial function i
rdum1 = intgrf(atoms%rmsh(:n_grid_pt, itype)**(l + 1)*mpbasis%radbasfn_mt(:n_grid_pt, i, l, itype), &
......@@ -395,7 +395,7 @@ CONTAINS
DO itype = 1, atoms%ntype
DO i = 1, atoms%neq(itype)
DO l = 0, hybrid%lcutm1(itype)
hybrid%nbasp = hybrid%nbasp + (2*l+1) * mpbasis%num_rad_bas_fun(l, itype)
hybrid%nbasp = hybrid%nbasp + (2*l+1) * mpbasis%num_radbasfn(l, itype)
END DO
END DO
END DO
......@@ -547,7 +547,7 @@ CONTAINS
integer :: n1, n2, n_radbasfn
n_radbasfn = mpbasis%num_rad_bas_fun(l, itype)
n_radbasfn = mpbasis%num_radbasfn(l, itype)
if(allocated(olap)) then
if(any(shape(olap) /= n_radbasfn)) then
deallocate(olap)
......@@ -580,14 +580,14 @@ CONTAINS
allocate(remaining_basfn(n_radbasfn), source=1)
num_radbasfn = 0
DO i_bas = 1, mpbasis%num_rad_bas_fun(l, itype)
DO i_bas = 1, mpbasis%num_radbasfn(l, itype)
IF (eig(i_bas) > hybrid%tolerance1) THEN
num_radbasfn = num_radbasfn + 1
remaining_basfn(num_radbasfn) = i_bas
END IF
END DO
mpbasis%num_rad_bas_fun(l, itype) = num_radbasfn
mpbasis%num_radbasfn(l, itype) = num_radbasfn
eig = eig(remaining_basfn)
eigv(:,:) = eigv(:,remaining_basfn)
end subroutine filter_radbasfn
......@@ -601,7 +601,7 @@ CONTAINS
integer :: nn, i
nn = mpbasis%num_rad_bas_fun(l, itype)
nn = mpbasis%num_radbasfn(l, itype)
DO i = 1, n_grid_pt
mpbasis%radbasfn_mt(i, 1:nn, l, itype) &
= MATMUL(mpbasis%radbasfn_mt(i, 1:n_radbasfn, l, itype), eigv(:,1:nn))/SQRT(eig(:nn))
......@@ -658,7 +658,7 @@ CONTAINS
= mpbasis%radbasfn_mt(:n_grid_pt, i, 0, itype) / norm
END DO
nn = nn + 1
mpbasis%num_rad_bas_fun(l, itype) = nn
mpbasis%num_radbasfn(l, itype) = nn
END IF
end subroutine add_l0_fun
......
......@@ -25,10 +25,10 @@
DO l = 0, hybrid%lcutm1(itype)
DO M = -l, l
WRITE (700 + ikpt, *) l, M
DO n = 1, mpbasis%num_rad_bas_fun(l, itype)
WRITE (700 + ikpt, '(16f8.4)') coulhlp(ic + n, ic + 1:ic + mpbasis%num_rad_bas_fun(l, itype))
DO n = 1, mpbasis%num_radbasfn(l, itype)
WRITE (700 + ikpt, '(16f8.4)') coulhlp(ic + n, ic + 1:ic + mpbasis%num_radbasfn(l, itype))
END DO
ic = ic + mpbasis%num_rad_bas_fun(l, itype)
ic = ic + mpbasis%num_radbasfn(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, mpbasis%num_rad_bas_fun(l, itype) - 1
DO n = 1, mpbasis%num_radbasfn(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, mpbasis%num_rad_bas_fun(l, itype) - 1
coulhlp1(ic + n, ic + 1:ic + mpbasis%num_rad_bas_fun(l, itype) - 1) &
= coulhlp(ic1 + n, ic1 + 1:ic1 + mpbasis%num_rad_bas_fun(l, itype) - 1)
DO n = 1, mpbasis%num_radbasfn(l, itype) - 1
coulhlp1(ic + n, ic + 1:ic + mpbasis%num_radbasfn(l, itype) - 1) &
= coulhlp(ic1 + n, ic1 + 1:ic1 + mpbasis%num_radbasfn(l, itype) - 1)
END DO
coulhlp1(ic2 + 1, ic + 1:ic + mpbasis%num_rad_bas_fun(l, itype) - 1) &
= coulhlp(ic1 + mpbasis%num_rad_bas_fun(l, itype), ic1 + 1:ic1 + mpbasis%num_rad_bas_fun(l, itype) - 1)
coulhlp1(ic2 + 1, ic + 1:ic + mpbasis%num_radbasfn(l, itype) - 1) &
= coulhlp(ic1 + mpbasis%num_radbasfn(l, itype), ic1 + 1:ic1 + mpbasis%num_radbasfn(l, itype) - 1)
ic = ic + mpbasis%num_rad_bas_fun(l, itype) - 1
ic1 = ic1 + mpbasis%num_rad_bas_fun(l, itype)
ic = ic + mpbasis%num_radbasfn(l, itype) - 1
ic1 = ic1 + mpbasis%num_radbasfn(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 + mpbasis%num_rad_bas_fun(0, itype) - 1, ic1 + 1, &
ic1 + mpbasis%num_rad_bas_fun(0, itype) - 1
coulhlp1(ic + 1:ic + mpbasis%num_rad_bas_fun(0, itype) - 1, nbasp + 1) &
= coulhlp(ic1 + 1:ic1 + mpbasis%num_rad_bas_fun(0, itype) - 1, nbasp + 1)
coulhlp1(nbasp + 1, ic + 1:ic + mpbasis%num_rad_bas_fun(0, itype) - 1) &
= coulhlp(nbasp + 1, ic1 + 1:ic1 + mpbasis%num_rad_bas_fun(0, itype) - 1)
ic = ic + SUM((/((2*l + 1)*(mpbasis%num_rad_bas_fun(l, itype) - 1), &
WRITE (*, *) ic + 1, ic + mpbasis%num_radbasfn(0, itype) - 1, ic1 + 1, &
ic1 + mpbasis%num_radbasfn(0, itype) - 1
coulhlp1(ic + 1:ic + mpbasis%num_radbasfn(0, itype) - 1, nbasp + 1) &
= coulhlp(ic1 + 1:ic1 + mpbasis%num_radbasfn(0, itype) - 1, nbasp + 1)
coulhlp1(nbasp + 1, ic + 1:ic + mpbasis%num_radbasfn(0, itype) - 1) &
= coulhlp(nbasp + 1, ic1 + 1:ic1 + mpbasis%num_radbasfn(0, itype) - 1)
ic = ic + SUM((/((2*l + 1)*(mpbasis%num_radbasfn(l, itype) - 1), &
l=0, hybrid%lcutm1(itype))/))
ic1 = ic1 + SUM((/((2*l + 1)*mpbasis%num_rad_bas_fun(l, itype), &
ic1 = ic1 + SUM((/((2*l + 1)*mpbasis%num_radbasfn(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, mpbasis%num_rad_bas_fun(l, itype) - 1
DO n = 1, mpbasis%num_radbasfn(l, itype) - 1
ic2 = ic2 + 1
END DO
END DO
......@@ -111,7 +111,7 @@
DO M = -l, l
ic2 = ic2 + 1
ic1 = ic1 + mpbasis%num_rad_bas_fun(l, itype)
ic1 = ic1 + mpbasis%num_radbasfn(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)*mpbasis%num_rad_bas_fun(l2, itype1), &
ishift = SUM((/((2*l2 + 1)*mpbasis%num_radbasfn(l2, itype1), &
l2=0, hybrid%lcutm1(itype1))/))
ishift1 = SUM((/((2*l2 + 1)*(mpbasis%num_rad_bas_fun(l2, itype1) - 1), &
ishift1 = SUM((/((2*l2 + 1)*(mpbasis%num_radbasfn(l2, itype1) - 1), &
l2=0, hybrid%lcutm1(itype1))/))
DO ineq1 = 1, atoms%neq(itype1)
ic5 = ic3 + (ineq1 - 1)*ishift + 1
ic6 = ic5 + mpbasis%num_rad_bas_fun(0, itype1) - 2
ic6 = ic5 + mpbasis%num_radbasfn(0, itype1) - 2
ic7 = ic4 + (ineq1 - 1)*ishift1 + 1
ic8 = ic7 + mpbasis%num_rad_bas_fun(0, itype1) - 2
ic8 = ic7 + mpbasis%num_radbasfn(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, mpbasis%num_rad_bas_fun(l, itype) - 1
DO n = 1, mpbasis%num_radbasfn(l, itype) - 1
ic2 = ic2 + 1
END DO
END DO
......@@ -169,7 +169,7 @@
DO M = -l, l
ic2 = ic2 + 1
ic1 = ic1 + mpbasis%num_rad_bas_fun(l, itype)
ic1 = ic1 + mpbasis%num_radbasfn(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 + mpbasis%num_rad_bas_fun(l1, itype1)
ic3 = ic3 + mpbasis%num_radbasfn(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, mpbasis%num_rad_bas_fun(l, itype) - 1
WRITE (800 + ikpt, '(16f8.4)') coulhlp1(ic + n, ic + 1:ic + mpbasis%num_rad_bas_fun(l, itype) - 1)
DO n = 1, mpbasis%num_radbasfn(l, itype) - 1
WRITE (800 + ikpt, '(16f8.4)') coulhlp1(ic + n, ic + 1:ic + mpbasis%num_radbasfn(l, itype) - 1)
END DO
ic = ic + mpbasis%num_rad_bas_fun(l, itype) - 1
ic = ic + mpbasis%num_radbasfn(l, itype) - 1
ENDDO
END DO
END DO
......
......@@ -26,9 +26,9 @@ CONTAINS
INTEGER, INTENT(IN) :: ikpt
! - arrays -
REAL, INTENT(IN) :: coulomb_mt1(maxval(mpbasis%num_rad_bas_fun) - 1, maxval(mpbasis%num_rad_bas_fun) - 1,&
REAL, INTENT(IN) :: coulomb_mt1(maxval(mpbasis%num_radbasfn) - 1, maxval(mpbasis%num_radbasfn) - 1,&
& 0:maxval(hybrid%lcutm1), atoms%ntype)
REAL, INTENT(IN) :: coulomb_mt2(maxval(mpbasis%num_rad_bas_fun) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1),&
REAL, INTENT(IN) :: coulomb_mt2(maxval(mpbasis%num_radbasfn) - 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), mpbasis%num_rad_bas_fun, 1, vecinhlp)
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), mpbasis%num_radbasfn, 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 + mpbasis%num_rad_bas_fun(l, itype) - 1
ibasm = ibasm + mpbasis%num_radbasfn(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 + mpbasis%num_rad_bas_fun(l, itype) - 1
indx2 = indx2 + mpbasis%num_radbasfn(l, itype) - 1
indx3 = indx3 + 1
vecout(indx1:indx2) = matmul(coulomb_mt1(:mpbasis%num_rad_bas_fun(l, itype) - 1, :mpbasis%num_rad_bas_fun(l, itype) - 1, l, itype),&
vecout(indx1:indx2) = matmul(coulomb_mt1(:mpbasis%num_radbasfn(l, itype) - 1, :mpbasis%num_radbasfn(l, itype) - 1, l, itype),&
& vecinhlp(indx1:indx2))
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:mpbasis%num_rad_bas_fun(l, itype) - 1, m, l, iatom)*vecinhlp(indx3)
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:mpbasis%num_radbasfn(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)*(mpbasis%num_rad_bas_fun(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
ishift = sum([((2*l + 1)*(mpbasis%num_radbasfn(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 + mpbasis%num_rad_bas_fun(l, itype) - 2
indx2 = indx1 + mpbasis%num_radbasfn(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(:mpbasis%num_rad_bas_fun(l, itype) - 1, iatom1, iatom)*vecinhlp(indx4)
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt3(:mpbasis%num_radbasfn(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(:mpbasis%num_rad_bas_fun(l, itype) - 1, 0, maxval(hybrid%lcutm1) + 1, iatom)*vecinhlp(indx3 + 1)
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:mpbasis%num_radbasfn(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 = mpbasis%num_rad_bas_fun(l, itype)
n = mpbasis%num_radbasfn(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)*(mpbasis%num_rad_bas_fun(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
ishift = sum([((2*l + 1)*(mpbasis%num_radbasfn(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
DO ieq = 1, atoms%neq(itype)
iatom = iatom + 1
indx1 = indx0 + 1
indx2 = indx1 + mpbasis%num_rad_bas_fun(0, itype) - 2
vecout(hybrid%nbasp + 1) = vecout(hybrid%nbasp + 1) + dot_product(coulomb_mt2(:mpbasis%num_rad_bas_fun(0, itype) - 1, 0, maxval(hybrid%lcutm1) + 1, iatom), vecinhlp(indx1:indx2))
indx2 = indx1 + mpbasis%num_radbasfn(0, itype) - 2
vecout(hybrid%nbasp + 1) = vecout(hybrid%nbasp + 1) + dot_product(coulomb_mt2(:mpbasis%num_radbasfn(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)*(mpbasis%num_rad_bas_fun(l, itype1) - 1), l=0, hybrid%lcutm1(itype1))])
ishift1 = sum([((2*l + 1)*(mpbasis%num_radbasfn(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 + mpbasis%num_rad_bas_fun(0, itype1) - 2
indx4 = indx3 + mpbasis%num_radbasfn(0, itype1) - 2
vecout(indx1) = vecout(indx1) + dot_product(coulomb_mt3(:mpbasis%num_rad_bas_fun(0, itype1) - 1, iatom, iatom1), vecinhlp(indx3:indx4))
vecout(indx1) = vecout(indx1) + dot_product(coulomb_mt3(:mpbasis%num_radbasfn(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), mpbasis%num_rad_bas_fun,&
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), mpbasis%num_radbasfn,&
& 2,&
& vecout)
......@@ -232,9 +232,9 @@ CONTAINS
INTEGER, INTENT(IN) :: ikpt
! - arrays -
REAL, INTENT(IN) :: coulomb_mt1(maxval(mpbasis%num_rad_bas_fun) - 1, maxval(mpbasis%num_rad_bas_fun) - 1,&
REAL, INTENT(IN) :: coulomb_mt1(maxval(mpbasis%num_radbasfn) - 1, maxval(mpbasis%num_radbasfn) - 1,&
& 0:maxval(hybrid%lcutm1), atoms%ntype)
COMPLEX, INTENT(IN) :: coulomb_mt2(maxval(mpbasis%num_rad_bas_fun) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1),&
COMPLEX, INTENT(IN) :: coulomb_mt2(maxval(mpbasis%num_radbasfn) - 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(mpbasis%num_rad_bas_fun) - 1), veci(maxval(mpbasis%num_rad_bas_fun) - 1)
REAL :: vecr(maxval(mpbasis%num_radbasfn) - 1), veci(maxval(mpbasis%num_radbasfn) - 1)
COMPLEX :: vecinhlp(hybrid%nbasm(ikpt))
COMPLEX, ALLOCATABLE :: coulhlp(:, :)
vecinhlp = vecin
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), mpbasis%num_rad_bas_fun, 1, vec_c=vecinhlp)
CALL reorder(hybrid%nbasm(ikpt), hybrid%nbasp, atoms, hybrid%lcutm1, maxval(hybrid%lcutm1), mpbasis%num_radbasfn, 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 + mpbasis%num_rad_bas_fun(l, itype) - 1
ibasm = ibasm + mpbasis%num_radbasfn(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 + mpbasis%num_rad_bas_fun(l, itype) - 1
indx2 = indx2 + mpbasis%num_radbasfn(l, itype) - 1
indx3 = indx3 + 1
vecout(indx1:indx2) = matmul(coulomb_mt1(:mpbasis%num_rad_bas_fun(l, itype) - 1, :mpbasis%num_rad_bas_fun(l, itype) - 1, l, itype),&
vecout(indx1:indx2) = matmul(coulomb_mt1(:mpbasis%num_radbasfn(l, itype) - 1, :mpbasis%num_radbasfn(l, itype) - 1, l, itype),&
& vecinhlp(indx1:indx2))
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:mpbasis%num_rad_bas_fun(l, itype) - 1, m, l, iatom)*vecinhlp(indx3)
vecout(indx1:indx2) = vecout(indx1:indx2) + coulomb_mt2(:mpbasis%num_radbasfn(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)*(mpbasis%num_rad_bas_fun(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
ishift = sum([((2*l + 1)*(mpbasis%num_radbasfn(l, itype) - 1), l=0, hybrid%lcutm1(itype))])
DO ieq = 1, atoms%neq(itype)
iatom = iatom + 1