Commit 1281c602 authored by Matthias Redies's avatar Matthias Redies

drop maxindxm1 variable

parent 0263b32b
......@@ -96,9 +96,9 @@ CONTAINS
REAL :: q(3), q1(3), q2(3)
REAL :: integrand(atoms%jmtd), primf1(atoms%jmtd), primf2(atoms%jmtd)
REAL :: mat(hybrid%maxindxm1*(hybrid%maxindxm1 + 1)/2)
REAL :: moment(hybrid%maxindxm1, 0:hybrid%maxlcutm1, atoms%ntype), &
moment2(hybrid%maxindxm1, atoms%ntype)
REAL :: mat(maxval(hybrid%nindxm1)*(maxval(hybrid%nindxm1) + 1)/2)
REAL :: moment(maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, atoms%ntype), &
moment2(maxval(hybrid%nindxm1), atoms%ntype)
REAL :: sphbes_var(atoms%jmtd, 0:hybrid%maxlcutm1)
REAL :: sphbesmoment1(atoms%jmtd, 0:hybrid%maxlcutm1)
REAL :: rarr(0:hybrid%lexp + 1), rarr1(0:hybrid%maxlcutm1)
......@@ -317,8 +317,8 @@ CONTAINS
! Look for different qnorm = |k+G|, definition of qnrm and pqnrm.
CALL getnorm(kpts, hybrid%gptm, hybrid%ngptm, hybrid%pgptm, qnrm, nqnrm, pqnrm, cell)
allocate(sphbesmoment(0:hybrid%lexp, atoms%ntype, nqnrm), &
olap(hybrid%maxindxm1, 0:hybrid%maxlcutm1, atoms%ntype, nqnrm), &
integral(hybrid%maxindxm1, 0:hybrid%maxlcutm1, atoms%ntype, nqnrm))
olap(maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, atoms%ntype, nqnrm), &
integral(maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, atoms%ntype, nqnrm))
sphbes_var = 0
sphbesmoment = 0
sphbesmoment1 = 0
......@@ -1098,7 +1098,7 @@ CONTAINS
carr2(:, 2), igpt2, ikpt, isym, .FALSE., POINTER(ikpt, :, :, :), &
sym, rrot(:, :, isym), invrrot(:, :, isym), hybrid, &
kpts, hybrid%maxlcutm1, atoms, hybrid%lcutm1, &
hybrid%nindxm1, hybrid%maxindxm1, dwgn(:, :, :, isym), &
hybrid%nindxm1, maxval(hybrid%nindxm1), dwgn(:, :, :, isym), &
hybrid%nbasp, nbasm1)
IF (iarr(igpt1) == 0) THEN
CALL bramat_trafo( &
......@@ -1106,7 +1106,7 @@ CONTAINS
carr2(:, 2), igpt2, ikpt, isym, .TRUE., POINTER(ikpt, :, :, :), &
sym, rrot(:, :, isym), invrrot(:, :, isym), hybrid, &
kpts, hybrid%maxlcutm1, atoms, hybrid%lcutm1, &
hybrid%nindxm1, hybrid%maxindxm1, &
hybrid%nindxm1, maxval(hybrid%nindxm1), &
dwgn(:, :, :, isym), hybrid%nbasp, nbasm1)
l = (hybrid%nbasp + igpt1 - 1)*(hybrid%nbasp + igpt1)/2
coulomb(l + 1:l + hybrid%nbasp + igpt1, ikpt) = carr2(:hybrid%nbasp + igpt1, 1)
......@@ -1222,18 +1222,18 @@ CONTAINS
! rearrange coulomb matrix
!
allocate(coulomb_mt1(hybrid%maxindxm1 - 1, hybrid%maxindxm1 - 1, 0:hybrid%maxlcutm1, atoms%ntype, 1))
allocate(coulomb_mt1(maxval(hybrid%nindxm1) - 1, maxval(hybrid%nindxm1) - 1, 0:hybrid%maxlcutm1, atoms%ntype, 1))
ic = (hybrid%maxlcutm1 + 1)**2*atoms%nat
idum = ic + hybrid%maxgptm
idum = (idum*(idum + 1))/2
if (sym%invs) THEN
allocate(coulomb_mt2_r(hybrid%maxindxm1 - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1, 0:hybrid%maxlcutm1 + 1, atoms%nat, 1))
allocate(coulomb_mt3_r(hybrid%maxindxm1 - 1, atoms%nat, atoms%nat, 1))
allocate(coulomb_mt2_r(maxval(hybrid%nindxm1) - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1, 0:hybrid%maxlcutm1 + 1, atoms%nat, 1))
allocate(coulomb_mt3_r(maxval(hybrid%nindxm1) - 1, atoms%nat, atoms%nat, 1))
allocate(coulomb_mtir_r(ic + hybrid%maxgptm, ic + hybrid%maxgptm, 1))
allocate(coulombp_mtir_r(idum, 1))
else
allocate(coulomb_mt2_c(hybrid%maxindxm1 - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1, 0:hybrid%maxlcutm1 + 1, atoms%nat, 1))
allocate(coulomb_mt3_c(hybrid%maxindxm1 - 1, atoms%nat, atoms%nat, 1))
allocate(coulomb_mt2_c(maxval(hybrid%nindxm1) - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1, 0:hybrid%maxlcutm1 + 1, atoms%nat, 1))
allocate(coulomb_mt3_c(maxval(hybrid%nindxm1) - 1, atoms%nat, atoms%nat, 1))
allocate(coulomb_mtir_c(ic + hybrid%maxgptm, ic + hybrid%maxgptm, 1))
allocate(coulombp_mtir_c(idum, 1))
endif
......
......@@ -133,11 +133,11 @@ CONTAINS
REAL, ALLOCATABLE :: cprod_vv_r(:, :, :), carr3_vv_r(:, :, :)
COMPLEX, ALLOCATABLE :: cprod_vv_c(:, :, :), carr3_vv_c(:, :, :)
REAL :: coulomb_mt1(hybrid%maxindxm1 - 1, hybrid%maxindxm1 - 1, 0:hybrid%maxlcutm1, atoms%ntype)
REAL :: coulomb_mt2_r(hybrid%maxindxm1 - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1, 0:hybrid%maxlcutm1 + 1, atoms%nat)
REAL :: coulomb_mt3_r(hybrid%maxindxm1 - 1, atoms%nat, atoms%nat)
COMPLEX :: coulomb_mt2_c(hybrid%maxindxm1 - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1, 0:hybrid%maxlcutm1 + 1, atoms%nat)
COMPLEX :: coulomb_mt3_c(hybrid%maxindxm1 - 1, atoms%nat, atoms%nat)
REAL :: coulomb_mt1(maxval(hybrid%nindxm1) - 1, maxval(hybrid%nindxm1) - 1, 0:hybrid%maxlcutm1, atoms%ntype)
REAL :: coulomb_mt2_r(maxval(hybrid%nindxm1) - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1, 0:hybrid%maxlcutm1 + 1, atoms%nat)
REAL :: coulomb_mt3_r(maxval(hybrid%nindxm1) - 1, atoms%nat, atoms%nat)
COMPLEX :: coulomb_mt2_c(maxval(hybrid%nindxm1) - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1, 0:hybrid%maxlcutm1 + 1, atoms%nat)
COMPLEX :: coulomb_mt3_c(maxval(hybrid%nindxm1) - 1, atoms%nat, atoms%nat)
REAL :: coulomb_mtir_r(((hybrid%maxlcutm1 + 1)**2*atoms%nat + maxval(hybrid%ngptm))* &
((hybrid%maxlcutm1 + 1)**2*atoms%nat + maxval(hybrid%ngptm) + 1)/2)
......@@ -243,7 +243,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, hybrid%maxlcutm1, hybrid%nindxm1, hybrid%maxindxm1, hybrid%gptm, &
hybrid%lcutm1, hybrid%maxlcutm1, hybrid%nindxm1, maxval(hybrid%nindxm1), hybrid%gptm, &
hybrid%ngptm(ikpt0), hybrid%pgptm(:, ikpt0), hybrid%gptmd, 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), :, :), &
......
......@@ -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(hybrid%maxindxm1, hybrid%maxindxp1, 0:hybrid%maxlcutm1, atoms%ntype), stat=ok)
allocate(hybdat%prodm(maxval(hybrid%nindxm1), hybrid%maxindxp1, 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)
......
......@@ -436,9 +436,9 @@ CONTAINS
hybrid%nindxm1(l, itype) = n*input%jspins
END DO
END DO
hybrid%maxindxm1 = MAXVAL(hybrid%nindxm1)
maxval(hybrid%nindxm1) = MAXVAL(hybrid%nindxm1)
allocate(hybrid%basm1(atoms%jmtd, hybrid%maxindxm1, 0:hybrid%maxlcutm1, atoms%ntype))
allocate(hybrid%basm1(atoms%jmtd, maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, atoms%ntype))
hybrid%basm1 = 0
! Define product bases and reduce them according to overlap
......@@ -620,13 +620,13 @@ CONTAINS
IF (mpi%irank == 0) WRITE (6, '(6X,A,I7)') 'Total:', SUM(hybrid%nindxm1(0:hybrid%lcutm1(itype), itype))
END DO ! itype
hybrid%maxindxm1 = MAXVAL(hybrid%nindxm1)
maxval(hybrid%nindxm1) = MAXVAL(hybrid%nindxm1)
allocate(basmhlp(atoms%jmtd, hybrid%maxindxm1, 0:hybrid%maxlcutm1, atoms%ntype))
basmhlp(1:atoms%jmtd, 1:hybrid%maxindxm1, 0:hybrid%maxlcutm1, 1:atoms%ntype) &
= hybrid%basm1(1:atoms%jmtd, 1:hybrid%maxindxm1, 0:hybrid%maxlcutm1, 1:atoms%ntype)
allocate(basmhlp(atoms%jmtd, maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, atoms%ntype))
basmhlp(1:atoms%jmtd, 1:maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, 1:atoms%ntype) &
= hybrid%basm1(1:atoms%jmtd, 1:maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, 1:atoms%ntype)
deallocate(hybrid%basm1)
allocate(hybrid%basm1(atoms%jmtd, hybrid%maxindxm1, 0:hybrid%maxlcutm1, atoms%ntype))
allocate(hybrid%basm1(atoms%jmtd, maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, atoms%ntype))
hybrid%basm1 = basmhlp
deallocate(basmhlp, seleco, selecu, selecmat)
......
......@@ -24,9 +24,9 @@ MODULE m_spmvec
INTEGER, INTENT(IN) :: ikpt
! - arrays -
REAL, INTENT(IN) :: coulomb_mt1(hybrid%maxindxm1 - 1, hybrid%maxindxm1 - 1,&
REAL, INTENT(IN) :: coulomb_mt1(maxval(hybrid%nindxm1) - 1, maxval(hybrid%nindxm1) - 1,&
& 0:hybrid%maxlcutm1, atoms%ntype)
REAL, INTENT(IN) :: coulomb_mt2(hybrid%maxindxm1 - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1,&
REAL, INTENT(IN) :: coulomb_mt2(maxval(hybrid%nindxm1) - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1,&
& 0:hybrid%maxlcutm1 + 1, atoms%nat)
REAL, INTENT(IN) :: coulomb_mt3(:,:,:)
REAL, INTENT(IN) :: coulomb_mtir(:)
......@@ -228,9 +228,9 @@ MODULE m_spmvec
INTEGER, INTENT(IN) :: ikpt
! - arrays -
REAL, INTENT(IN) :: coulomb_mt1(hybrid%maxindxm1 - 1, hybrid%maxindxm1 - 1,&
REAL, INTENT(IN) :: coulomb_mt1(maxval(hybrid%nindxm1) - 1, maxval(hybrid%nindxm1) - 1,&
& 0:hybrid%maxlcutm1, atoms%ntype)
COMPLEX, INTENT(IN) :: coulomb_mt2(hybrid%maxindxm1 - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1,&
COMPLEX, INTENT(IN) :: coulomb_mt2(maxval(hybrid%nindxm1) - 1, -hybrid%maxlcutm1:hybrid%maxlcutm1,&
& 0:hybrid%maxlcutm1 + 1, atoms%nat)
COMPLEX, INTENT(IN) :: coulomb_mt3(:,:,:)
COMPLEX, INTENT(IN) :: coulomb_mtir(:)
......@@ -250,7 +250,7 @@ MODULE m_spmvec
COMPLEX, PARAMETER :: img = (0.0, 1.0)
! - local arrays -
REAL :: vecr(hybrid%maxindxm1 - 1), veci(hybrid%maxindxm1 - 1)
REAL :: vecr(maxval(hybrid%nindxm1) - 1), veci(maxval(hybrid%nindxm1) - 1)
COMPLEX :: vecinhlp(hybrid%nbasm(ikpt))
COMPLEX, ALLOCATABLE :: coulhlp(:, :)
......
......@@ -575,7 +575,7 @@ CONTAINS
! - arrays -
INTEGER :: rrot(3, 3), invrot(3, 3)
INTEGER :: pnt(hybrid%maxindxm1, 0:hybrid%maxlcutm1, atoms%nat)
INTEGER :: pnt(maxval(hybrid%nindxm1), 0:hybrid%maxlcutm1, atoms%nat)
INTEGER :: g(3), g1(3)
REAL :: rkpt(3), rkpthlp(3), rtaual(3), trans(3)
REAL :: arg
......
......@@ -68,9 +68,9 @@ contains
#else
! if the sparse matrix technique is used, several entries of the
! matrix vanish so that the size of each entry is smaller
irecl_coulomb = ( atoms%ntype*(hybrid%maxlcutm1+1)*(hybrid%maxindxm1-1)**2&
+ atoms%nat *(hybrid%maxlcutm1+2)*(2*hybrid%maxlcutm1+1)*(hybrid%maxindxm1-1)&
+ (hybrid%maxindxm1-1)*atoms%nat**2&
irecl_coulomb = ( atoms%ntype*(hybrid%maxlcutm1+1)*(maxval(hybrid%nindxm1)-1)**2&
+ atoms%nat *(hybrid%maxlcutm1+2)*(2*hybrid%maxlcutm1+1)*(maxval(hybrid%nindxm1)-1)&
+ (maxval(hybrid%nindxm1)-1)*atoms%nat**2&
+ ((hybrid%maxlcutm1+1)**2*atoms%nat+hybrid%maxgptm)&
*((hybrid%maxlcutm1+1)**2*atoms%nat+hybrid%maxgptm+1)/2 )*8
if (.not.l_real) irecl_coulomb =irecl_coulomb *2
......
......@@ -11,7 +11,6 @@ MODULE m_types_hybrid
INTEGER :: bands1 !Only read in
INTEGER :: nbasp
INTEGER :: maxlcutm1
INTEGER :: maxindxm1
INTEGER :: maxbasm1
INTEGER :: maxindxp1
INTEGER :: maxgptm
......
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