Commit 6e48196e authored by Matthias Redies's avatar Matthias Redies

remove maxindx variable

parent 45025da2
......@@ -23,10 +23,10 @@ CONTAINS
!Alloc variables
allocate(hybdat%lmaxc(atoms%ntype), source=0)
allocate(hybdat%bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas1_MT(hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%drbas1_MT(hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas1(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas2(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas1_MT(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%drbas1_MT(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
! preparations for core states
CALL core_init(dimension, input, atoms, hybdat%lmaxcd, hybdat%maxindxc)
......
......@@ -107,7 +107,7 @@
END DO
IF (mpi%irank == 0) WRITE (6, '(/A)') ' Overlap <core|basis>'
allocate(olapcb(hybrid%maxindx), olapcv(maxval(hybrid%nbands), nkpti),&
allocate(olapcb(maxval(hybrid%num_radfun_per_l)), olapcv(maxval(hybrid%nbands), nkpti),&
& olapcv_avg(-hybdat%lmaxcd:hybdat%lmaxcd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype),&
& olapcv_max(-hybdat%lmaxcd:hybdat%lmaxcd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype),&
& olapcv_loc(2, -hybdat%lmaxcd:hybdat%lmaxcd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype))
......
......@@ -68,10 +68,10 @@ CONTAINS
u2_lo(atoms%jmtd, atoms%nlod, atoms%ntype)
REAL :: kvec(3), qvec(3)
REAL :: sbes(0:atoms%lmaxd + 1), dsbes(0:atoms%lmaxd + 1)
REAL :: bas1_tmp(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd + 1, atoms%ntype), &
bas2_tmp(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd + 1, atoms%ntype)
REAL :: bas1_MT_tmp(hybrid%maxindx, 0:atoms%lmaxd + 1, atoms%ntype), &
drbas1_MT_tmp(hybrid%maxindx, 0:atoms%lmaxd + 1, atoms%ntype)
REAL :: bas1_tmp(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%ntype), &
bas2_tmp(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%ntype)
REAL :: bas1_MT_tmp(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%ntype), &
drbas1_MT_tmp(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%ntype)
REAL :: ru1(atoms%jmtd, 3, mnobd), ru2(atoms%jmtd, 3, mnobd)
REAL :: iu1(atoms%jmtd, 3, mnobd), iu2(atoms%jmtd, 3, mnobd)
REAL :: rintegrand(atoms%jmtd), iintegrand(atoms%jmtd), &
......@@ -821,8 +821,8 @@ CONTAINS
INTEGER :: gpt(3, lapw%nv(jsp))
REAL :: fcoeff((atoms%lmaxd + 1)**2, -1:1), gcoeff((atoms%lmaxd + 1)**2, -1:1)
REAL :: qmat1(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), dbas1(atoms%jmtd)
REAL :: qmat2(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), dbas2(atoms%jmtd)
REAL :: qmat1(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), dbas1(atoms%jmtd)
REAL :: qmat2(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), dbas2(atoms%jmtd)
REAL :: qg(lapw%nv(jsp), 3)
COMPLEX :: hlp(3, 3)
......
......@@ -117,12 +117,6 @@ CONTAINS
CALL usdus%init(atoms, input%jspins)
call hybrid%set_num_radfun_per_l(atoms)
hybrid%maxindx = 0
DO itype = 1, atoms%ntype
DO l = 0, atoms%lmax(itype)
hybrid%maxindx = MAX(hybrid%maxindx, 2 + COUNT(atoms%llo(:atoms%nlo(itype), itype) == l))
END DO
END DO
! maxindx = maxval(nlo) + 2
! initialize gridf for radial integration
......@@ -138,8 +132,8 @@ CONTAINS
allocate( f(atoms%jmtd, 2, 0:atoms%lmaxd), &
df(atoms%jmtd, 2, 0:atoms%lmaxd), source=0.0)
allocate(bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype, input%jspins), source=0.0)
allocate(bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype, input%jspins), source=0.0)
allocate(bas1(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype, input%jspins), source=0.0)
allocate(bas2(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype, input%jspins), source=0.0)
DO itype = 1, atoms%ntype
ng = atoms%jri(itype) ! number of radial gridpoints
......@@ -379,8 +373,8 @@ CONTAINS
hybrid%maxlcutm1 = MAXVAL(hybrid%lcutm1)
allocate(hybrid%nindxm1(0:hybrid%maxlcutm1, atoms%ntype))
allocate(seleco(hybrid%maxindx, 0:atoms%lmaxd), selecu(hybrid%maxindx, 0:atoms%lmaxd))
allocate(selecmat(hybrid%maxindx, 0:atoms%lmaxd, hybrid%maxindx, 0:atoms%lmaxd))
allocate(seleco(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd), selecu(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd))
allocate(selecmat(maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd))
hybrid%nindxm1 = 0 !!! 01/12/10 jij%M.b.
! determine maximal indices of (radial) mixed-basis functions (->nindxm1)
......@@ -395,7 +389,7 @@ CONTAINS
selecu(2, 0:hybrid%select1(4, itype)) = .TRUE.
! include local orbitals
IF (hybrid%maxindx >= 3) THEN
IF (maxval(hybrid%num_radfun_per_l) >= 3) THEN
seleco(3:,:) = .TRUE.
selecu(3:,:) = .TRUE.
END IF
......@@ -410,8 +404,8 @@ CONTAINS
! Condense seleco and seleco into selecmat (each product corresponds to a matrix element)
selecmat = RESHAPE((/((((seleco(n1, l1) .AND. selecu(n2, l2), &
n1=1, hybrid%maxindx), l1=0, atoms%lmaxd), n2=1, hybrid%maxindx), l2=0, atoms%lmaxd)/), &
(/hybrid%maxindx, atoms%lmaxd + 1, hybrid%maxindx, atoms%lmaxd + 1/))
n1=1, maxval(hybrid%num_radfun_per_l)), l1=0, atoms%lmaxd), n2=1, maxval(hybrid%num_radfun_per_l)), l2=0, atoms%lmaxd)/), &
(/maxval(hybrid%num_radfun_per_l), atoms%lmaxd + 1, maxval(hybrid%num_radfun_per_l), atoms%lmaxd + 1/))
DO l1 = 0, atoms%lmax(itype)
DO l2 = 0, atoms%lmax(itype)
......@@ -449,7 +443,7 @@ CONTAINS
seleco(2, 0:hybrid%select1(2, itype)) = .TRUE.
selecu(2, 0:hybrid%select1(4, itype)) = .TRUE.
! include lo's
IF (hybrid%maxindx >= 3) THEN
IF (maxval(hybrid%num_radfun_per_l) >= 3) THEN
seleco(3:,:) = .TRUE.
selecu(3:,:) = .TRUE.
END IF
......@@ -474,8 +468,8 @@ CONTAINS
! Condense seleco and seleco into selecmat (each product corresponds to a matrix element)
selecmat = RESHAPE((/((((seleco(n1, l1) .AND. selecu(n2, l2), &
n1=1, hybrid%maxindx), l1=0, atoms%lmaxd), n2=1, hybrid%maxindx), l2=0, atoms%lmaxd)/), &
(/hybrid%maxindx, atoms%lmaxd + 1, hybrid%maxindx, atoms%lmaxd + 1/))
n1=1, maxval(hybrid%num_radfun_per_l)), l1=0, atoms%lmaxd), n2=1, maxval(hybrid%num_radfun_per_l)), l2=0, atoms%lmaxd)/), &
(/maxval(hybrid%num_radfun_per_l), atoms%lmaxd + 1, maxval(hybrid%num_radfun_per_l), atoms%lmaxd + 1/))
DO l1 = 0, atoms%lmax(itype)
DO l2 = 0, atoms%lmax(itype)
......
......@@ -166,9 +166,9 @@ CONTAINS
! - arrays -
INTEGER, INTENT(IN) :: gpt(:, :)!(3,ngpt)
REAL, INTENT(IN) :: bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype),&
& bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
REAL, INTENT(OUT) :: olapmt(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
REAL, INTENT(IN) :: bas1(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype),&
& bas2(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype)
REAL, INTENT(OUT) :: olapmt(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype)
TYPE(t_mat), INTENT(INOUT):: olappw
! - local -
......@@ -214,7 +214,7 @@ CONTAINS
REAL, INTENT(IN) :: cpw1(:)
COMPLEX, INTENT(IN) :: cpw2(:)
REAL, INTENT(IN) :: olappw(:,:)
REAL, INTENT(IN) :: olapmt(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
REAL, INTENT(IN) :: olapmt(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype)
! - local -
INTEGER :: itype, ieq, iatom, l, m, lm, nn
COMPLEX :: carr(ngpt1), cdum
......@@ -267,7 +267,7 @@ CONTAINS
COMPLEX, INTENT(IN) :: cpw1(:)
COMPLEX, INTENT(IN) :: cpw2(:)
COMPLEX, INTENT(IN) :: olappw(:,:)
REAL, INTENT(IN) :: olapmt(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
REAL, INTENT(IN) :: olapmt(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype)
! - local -
INTEGER :: itype, ieq, iatom, l, m, lm, nn
COMPLEX :: carr(ngpt1), cdum
......@@ -329,7 +329,7 @@ CONTAINS
#else
COMPLEX, INTENT(IN) :: olappw(:,:)
#endif
REAL, INTENT(IN) :: olapmt(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
REAL, INTENT(IN) :: olapmt(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype)
! - local -
INTEGER :: itype, ieq, iatom, l, m, lm, nn
......@@ -381,7 +381,7 @@ CONTAINS
#else
COMPLEX, INTENT(IN) :: olappw(:,:)
#endif
REAL, INTENT(IN) :: olapmt(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
REAL, INTENT(IN) :: olapmt(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype)
! - local -
INTEGER :: itype, ieq, ic, l, m, lm, nn
......
......@@ -68,7 +68,7 @@ CONTAINS
INTEGER :: gg(3)
INTEGER :: pointer_lo(atoms%nlod, atoms%ntype)
REAL :: integ(0:sphhar%nlhd, hybrid%maxindx, 0:atoms%lmaxd, hybrid%maxindx, 0:atoms%lmaxd)
REAL :: integ(0:sphhar%nlhd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd)
REAL :: grid(atoms%jmtd)
REAL :: vr(atoms%jmtd, 0:sphhar%nlhd)
REAL :: f(atoms%jmtd, 2, 0:atoms%lmaxd), g(atoms%jmtd, 2, 0:atoms%lmaxd)
......@@ -76,8 +76,8 @@ CONTAINS
REAL :: uuilon(atoms%nlod, atoms%ntype), duilon(atoms%nlod, atoms%ntype)
REAL :: ulouilopn(atoms%nlod, atoms%nlod, atoms%ntype)
REAL :: bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
REAL :: bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
REAL :: bas1(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype)
REAL :: bas2(atoms%jmtd, maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype)
COMPLEX :: vpw(stars%ng3)
COMPLEX :: vxc(hmat%matsize1*(hmat%matsize1 + 1)/2)
......
......@@ -278,7 +278,7 @@ CONTAINS
IF (ok /= 0) call judft_error('symm: failure allocation rep_v')
call olappw%alloc(z%l_real, lapw%nv(jsp), lapw%nv(jsp))
allocate(olapmt(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), stat=ok)
allocate(olapmt(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), stat=ok)
IF (ok /= 0) call judft_error('symm: failure allocation olapmt')
olapmt = 0
......@@ -378,7 +378,7 @@ CONTAINS
!CALL intgrf_init(atoms%ntype,atoms%jmtd,atoms%jri,atoms%dx,atoms%rmsh,hybdat%gridf)
IF (allocated(olapmt)) deallocate(olapmt)
allocate(olapmt(hybrid%maxindx, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype), stat=ok)
allocate(olapmt(maxval(hybrid%num_radfun_per_l), maxval(hybrid%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), stat=ok)
IF (ok /= 0) call judft_error('symm: failure allocation olapmt')
olapmt = 0
......@@ -396,7 +396,7 @@ CONTAINS
END DO
END DO
allocate(wavefolap(hybrid%nbands(nk), hybrid%nbands(nk)), carr(hybrid%maxindx), stat=ok)
allocate(wavefolap(hybrid%nbands(nk), hybrid%nbands(nk)), carr(maxval(hybrid%num_radfun_per_l)), stat=ok)
IF (ok /= 0) call judft_error('symm: failure allocation wfolap/maxindx')
wavefolap = 0
......
......@@ -15,7 +15,6 @@ MODULE m_types_hybrid
INTEGER :: max_indx_p_1
INTEGER :: maxgptm
INTEGER :: maxgptm1
INTEGER :: maxindx
INTEGER :: maxlmindx
INTEGER :: gptmd
INTEGER, ALLOCATABLE :: num_radfun_per_l(:,:)
......
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