Commit 8c13527f authored by Matthias Redies's avatar Matthias Redies

move maxlmindx from hybinp to hybdat

parent b7b9f318
......@@ -163,8 +163,9 @@ CONTAINS
input,kpts,jsp,results,xcpot,noco,hmat)
IF(hybinp%l_subvxc) THEN
CALL subvxc(lapw,kpts%bk(:,nk),input,jsp,v%mt(:,0,:,:),atoms,ud,mpdata,hybinp,enpara%el0,enpara%ello0,&
sym,cell,sphhar,stars,xcpot,mpi,oneD,hmat,vx)
CALL subvxc(lapw,kpts%bk(:,nk),input,jsp,v%mt(:,0,:,:),atoms,ud,&
mpdata,hybinp,hybdat,enpara%el0,enpara%ello0,sym,&
cell,sphhar,stars,xcpot,mpi,oneD,hmat,vx)
END IF
END IF ! hybinp%l_hybrid
......
......@@ -21,7 +21,6 @@ MODULE m_types_hybinp
INTEGER :: nbasp = -1
INTEGER :: maxbasm1 = -1
INTEGER :: max_indx_p_1 = -1 !new
INTEGER :: maxlmindx = -1
INTEGER, ALLOCATABLE :: select1(:, :)
INTEGER, ALLOCATABLE :: lcutm1(:)
INTEGER, ALLOCATABLE :: lcutwf(:)
......@@ -60,7 +59,6 @@ CONTAINS
CALL mpi_bc(this%nbasp, rank, mpi_comm)
CALL mpi_bc(this%maxbasm1, rank, mpi_comm)
CALL mpi_bc(this%max_indx_p_1, rank, mpi_comm)
CALL mpi_bc(this%maxlmindx, rank, mpi_comm)
CALL mpi_bc(this%select1, rank, mpi_comm)
CALL mpi_bc(this%lcutm1, rank, mpi_comm)
CALL mpi_bc(this%lcutwf, rank, mpi_comm)
......
......@@ -60,7 +60,7 @@
REAL, ALLOCATABLE :: olapcv_avg(:, :, :, :), olapcv_max(:, :, :, :)
TYPE(t_mat), ALLOCATABLE :: z(:)
COMPLEX :: cmt(input%neig, hybinp%maxlmindx, atoms%nat, nkpti)
COMPLEX :: cmt(input%neig, hybdat%maxlmindx, atoms%nat, nkpti)
COMPLEX :: y((atoms%lmaxd + 1)**2)
COMPLEX, ALLOCATABLE :: olapcv(:, :)
COMPLEX, ALLOCATABLE :: carr1(:, :), carr2(:, :), carr3(:, :)
......
......@@ -65,7 +65,7 @@ CONTAINS
REAL, ALLOCATABLE :: fprod(:, :), fprod2(:, :)
REAL, ALLOCATABLE :: integral(:, :)
COMPLEX :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX :: exchange(hybdat%nbands(nk), hybdat%nbands(nk))
COMPLEX, ALLOCATABLE :: carr(:, :), carr2(:, :), carr3(:, :)
......
......@@ -176,9 +176,9 @@ CONTAINS
IF (ok /= 0) call judft_error('gen_wavf: failure allocation bcof')
allocate(ccof(-atoms%llod:atoms%llod, input%neig, atoms%nlod, atoms%nat), stat=ok)
IF (ok /= 0) call judft_error('gen_wavf: failure allocation ccof')
allocate(cmt(input%neig, hybinp%maxlmindx, atoms%nat), stat=ok)
allocate(cmt(input%neig, hybdat%maxlmindx, atoms%nat), stat=ok)
IF (ok /= 0) call judft_error('gen_wavf: Failure allocation cmt')
allocate(cmthlp(input%neig, hybinp%maxlmindx, atoms%nat), stat=ok)
allocate(cmthlp(input%neig, hybdat%maxlmindx, atoms%nat), stat=ok)
IF (ok /= 0) call judft_error('gen_wavf: failure allocation cmthlp')
DO ikpt0 = 1, nkpti
......
......@@ -271,7 +271,7 @@ CONTAINS
hybdat%nobd(nk,jsp) = COUNT(results%w_iks(:hybdat%ne_eig(nk), nk, jsp) > 0.0)
END DO
hybinp%maxlmindx = MAXVAL([(SUM([(mpdata%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))]), itype=1, atoms%ntype)])
hybdat%maxlmindx = MAXVAL([(SUM([(mpdata%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))]), itype=1, atoms%ntype)])
hybdat%nbands = MIN(hybinp%bands1, input%neig)
ENDIF ! hybinp%l_calhf
......
......@@ -828,10 +828,10 @@ CONTAINS
REAL :: qg(lapw%nv(jsp), 3)
COMPLEX :: hlp(3, 3)
COMPLEX :: cvec1(hybinp%maxlmindx), cvec2(hybinp%maxlmindx), cvec3(hybinp%maxlmindx)
COMPLEX :: cmt1(hybinp%maxlmindx, bandi1:bandf1), cmt2(hybinp%maxlmindx, bandi2:bandf2)
COMPLEX :: cvec1(hybdat%maxlmindx), cvec2(hybdat%maxlmindx), cvec3(hybdat%maxlmindx)
COMPLEX :: cmt1(hybdat%maxlmindx, bandi1:bandf1), cmt2(hybdat%maxlmindx, bandi2:bandf2)
COMPLEX :: carr1(3), carr2(3)
COMPLEX :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
REAL :: olap_r(lapw%nv(jsp)*(lapw%nv(jsp) + 1)/2)
COMPLEX :: olap_c(lapw%nv(jsp)*(lapw%nv(jsp) + 1)/2)
REAL :: vec1_r(lapw%nv(jsp)), vec2_r(lapw%nv(jsp)), vec3_r(lapw%nv(jsp))
......
......@@ -38,7 +38,8 @@ MODULE m_mixedbasis
CONTAINS
SUBROUTINE mixedbasis(atoms, kpts, input, cell, xcpot, mpdata, hybinp, enpara, mpi, v, iterHF)
SUBROUTINE mixedbasis(atoms, kpts, input, cell, xcpot, mpdata, hybinp, hybdat,&
enpara, mpi, v, iterHF)
USE m_judft
USE m_loddop, ONLY: loddop
......@@ -55,6 +56,7 @@ CONTAINS
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_enpara), INTENT(IN) :: enpara
TYPE(t_input), INTENT(IN) :: input
TYPE(t_cell), INTENT(IN) :: cell
......@@ -378,9 +380,9 @@ CONTAINS
hybinp%maxbasm1 = hybinp%nbasp + maxval(mpdata%n_g)
hybinp%nbasm = hybinp%nbasp + mpdata%n_g
hybinp%maxlmindx = 0
hybdat%maxlmindx = 0
do itype = 1,atoms%ntype
hybinp%maxlmindx = max(hybinp%maxlmindx,&
hybdat%maxlmindx = max(hybdat%maxlmindx,&
SUM([(mpdata%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))])&
)
enddo
......
......@@ -8,8 +8,8 @@ MODULE m_subvxc
CONTAINS
SUBROUTINE subvxc(lapw, bk, input, jsp, vr0, atoms, usdus, mpdata, hybinp, el, ello, sym, &
cell, sphhar, stars, xcpot, mpi, oneD, hmat, vx)
SUBROUTINE subvxc(lapw, bk, input, jsp, vr0, atoms, usdus, mpdata, hybinp, hybdat,&
el, ello, sym, cell, sphhar, stars, xcpot, mpi, oneD, hmat, vx)
USE m_types
USE m_judft
......@@ -29,6 +29,7 @@ CONTAINS
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_input), INTENT(IN) :: input
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_stars), INTENT(IN) :: stars
......@@ -81,8 +82,8 @@ CONTAINS
COMPLEX :: vpw(stars%ng3)
COMPLEX :: vxc(hmat%matsize1*(hmat%matsize1 + 1)/2)
COMPLEX :: vrmat(hybinp%maxlmindx, hybinp%maxlmindx)
COMPLEX :: carr(hybinp%maxlmindx, lapw%dim_nvd()), carr1(lapw%dim_nvd(), lapw%dim_nvd())
COMPLEX :: vrmat(hybdat%maxlmindx, hybdat%maxlmindx)
COMPLEX :: carr(hybdat%maxlmindx, lapw%dim_nvd()), carr1(lapw%dim_nvd(), lapw%dim_nvd())
COMPLEX, ALLOCATABLE :: ahlp(:, :, :), bhlp(:, :, :)
COMPLEX, ALLOCATABLE :: bascof(:, :, :)
#ifndef CPP_OLDINTEL
......
......@@ -134,8 +134,8 @@ CONTAINS
REAL :: rotkpt(3), g(3)
REAL, ALLOCATABLE :: olapmt(:, :, :, :)
COMPLEX :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: carr1(hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX :: carr1(hybdat%maxlmindx, atoms%nat)
COMPLEX, ALLOCATABLE :: carr(:), wavefolap(:, :)
COMPLEX, ALLOCATABLE :: cmthlp(:, :, :)
COMPLEX, ALLOCATABLE :: cpwhlp(:, :)
......@@ -291,7 +291,7 @@ CONTAINS
CALL wfolap_init(olappw, olapmt, lapw%gvec(:, :, jsp), atoms, mpdata, &
cell, hybdat%bas1, hybdat%bas2)
allocate(cmthlp(hybinp%maxlmindx, atoms%nat, maxndb), cpwhlp(lapw%nv(jsp), maxndb), stat=ok)
allocate(cmthlp(hybdat%maxlmindx, atoms%nat, maxndb), cpwhlp(lapw%nv(jsp), maxndb), stat=ok)
IF (ok /= 0) call judft_error('symm: failure allocation cmthlp/cpwhlp')
DO isym = 1, nsymop
......@@ -306,7 +306,7 @@ CONTAINS
cpwhlp = 0
CALL waveftrafo_symm(cmthlp(:, :, :ndb), cpwhlp(:, :ndb), cmt, z%l_real, z%data_r, z%data_c, &
i, ndb, nk, iop, atoms,input, mpdata, hybinp, kpts, sym, jsp, lapw)
i, ndb, nk, iop, atoms, mpdata, hybinp, hybdat, kpts, sym, jsp, lapw)
DO iband = 1, ndb
carr1 = cmt(iband + i - 1, :, :)
......
......@@ -9,8 +9,8 @@ MODULE m_trafo
CONTAINS
SUBROUTINE waveftrafo_symm(cmt_out, z_out, cmt, l_real, z_r, z_c, bandi, ndb, &
nk, iop, atoms, input,mpdata, hybinp, kpts, sym, &
jsp, lapw)
nk, iop, atoms, mpdata, hybinp, hybdat, kpts, &
sym, jsp, lapw)
USE m_constants
USE m_wrapper
......@@ -18,9 +18,9 @@ CONTAINS
USE m_juDFT
IMPLICIT NONE
TYPE(t_input), INTENT(IN) :: input
TYPE(t_mpdata), INTENT(IN) :: mpdata
TYPE(t_mpdata), INTENT(IN) :: mpdata
TYPE(t_hybinp), INTENT(IN) :: hybinp
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_atoms), INTENT(IN) :: atoms
......@@ -35,7 +35,7 @@ CONTAINS
LOGICAL, INTENT(IN) :: l_real
REAL, INTENT(IN) :: z_r(:,:)
COMPLEX, INTENT(IN) :: z_c(:,:)
COMPLEX, INTENT(OUT) :: cmt_out(hybinp%maxlmindx, atoms%nat, ndb)
COMPLEX, INTENT(OUT) :: cmt_out(hybdat%maxlmindx, atoms%nat, ndb)
COMPLEX, INTENT(OUT) :: z_out(lapw%nv(jsp), ndb)
! - local -
......
......@@ -72,8 +72,8 @@ CONTAINS
! COMPLEX :: chelp(maxbasm,mnobd,bandf-bandi+1,nkpt_EIBZ)
COMPLEX :: cexp
COMPLEX :: z_help(lapw%nv(jsp))
COMPLEX :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt_nk(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX :: cmt_nk(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX, ALLOCATABLE :: cprod_ir(:, :, :)
TYPE(t_mat) :: z_nk, z_kqpt
TYPE(t_lapw) :: lapw_nkqpt
......@@ -338,11 +338,11 @@ CONTAINS
REAL :: z_help(lapw%nv(jsp))
REAL :: cmt_nk(input%neig, hybinp%maxlmindx, atoms%nat)
REAL :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
REAL :: cmt_nk(input%neig, hybdat%maxlmindx, atoms%nat)
REAL :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX :: ccmt_nk(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: ccmt(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: ccmt_nk(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX :: ccmt(input%neig, hybdat%maxlmindx, atoms%nat)
REAL :: rarr1(1:mnobd, bandf - bandi + 1)
REAL :: rarr(2, 1:mnobd, bandf - bandi + 1)
......@@ -1268,8 +1268,8 @@ CONTAINS
REAL :: kqpt(3), kqpthlp(3)
REAL :: bkpt(3)
REAL :: cmt_nk(input%neig, hybinp%maxlmindx, atoms%nat)
REAL :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
REAL :: cmt_nk(input%neig, hybdat%maxlmindx, atoms%nat)
REAL :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
REAL :: rarr1(bandoi:bandof)
REAL :: rarr2(bandoi:bandof, bandf - bandi + 1)
REAL :: rarr3(2, bandoi:bandof, bandf - bandi + 1)
......@@ -1451,7 +1451,7 @@ CONTAINS
END DO
! read in cmt coefficient at k-point nk
ALLOCATE (ccmt_nk(input%neig, hybinp%maxlmindx, atoms%nat), ccmt(input%neig, hybinp%maxlmindx, atoms%nat), stat=ok)
ALLOCATE (ccmt_nk(input%neig, hybdat%maxlmindx, atoms%nat), ccmt(input%neig, hybdat%maxlmindx, atoms%nat), stat=ok)
IF (ok /= 0) STOP 'wavefproducts_inv5: error allocation ccmt_nk/ccmt'
call read_cmt(ccmt_nk, nk)
......@@ -2290,8 +2290,8 @@ CONTAINS
COMPLEX :: carr1(bandoi:bandof)
COMPLEX :: carr2(bandoi:bandof, bandf - bandi + 1)
TYPE(t_mat) :: z_nk, z_kqpt
COMPLEX :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt_nk(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX :: cmt_nk(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX, ALLOCATABLE :: z0(:, :)
call timestart("wavefproducts_noinv5")
......
......@@ -228,8 +228,8 @@ CONTAINS
! - local arrays -
INTEGER :: lmstart(0:atoms%lmaxd, atoms%ntype)
REAL :: cmt_nk(input%neig, hybinp%maxlmindx, atoms%nat)
REAL :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
REAL :: cmt_nk(input%neig, hybdat%maxlmindx, atoms%nat)
REAL :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
REAL :: rarr2(bandoi:bandof, bandf - bandi + 1)
REAL :: rarr3(2, bandoi:bandof, bandf - bandi + 1)
......@@ -245,8 +245,8 @@ CONTAINS
END DO
! read in cmt coefficient at k-point nk
allocate(ccmt_nk(input%neig, hybinp%maxlmindx, atoms%nat), &
ccmt(input%neig, hybinp%maxlmindx, atoms%nat), &
allocate(ccmt_nk(input%neig, hybdat%maxlmindx, atoms%nat), &
ccmt(input%neig, hybdat%maxlmindx, atoms%nat), &
source=cmplx(0.0, 0.0), stat=ok)
IF (ok /= 0) call juDFT_error('wavefproducts_inv5: error allocation ccmt_nk/ccmt')
......
......@@ -235,8 +235,8 @@ CONTAINS
INTEGER :: lmstart(0:atoms%lmaxd, atoms%ntype)
COMPLEX :: carr(bandoi:bandof, bandf - bandi + 1)
COMPLEX :: cmt(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt_nk(input%neig, hybinp%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
COMPLEX :: cmt_nk(input%neig, hybdat%maxlmindx, atoms%nat)
call timestart("wavefproducts_noinv5 MT")
! lmstart = lm start index for each l-quantum number and atom type (for cmt-coefficients)
......
......@@ -44,13 +44,14 @@ contains
END SUBROUTINE open_hybinp_io1b
SUBROUTINE open_hybinp_io2(mpdata,hybinp,input,atoms,l_real)
SUBROUTINE open_hybinp_io2(mpdata,hybinp,hybdat,input,atoms,l_real)
IMPLICIT NONE
type(t_mpdata), intent(in) :: mpdata
TYPE(t_hybinp),INTENT(IN) :: hybinp
TYPE(t_input),INTENT(IN):: input
TYPE(t_atoms),INTENT(IN) :: atoms
LOGICAL,INTENT(IN) :: l_real
TYPE(t_hybinp),INTENT(IN) :: hybinp
TYPE(t_hybdat),INTENT(IN) :: hybdat
TYPE(t_input),INTENT(IN) :: input
TYPE(t_atoms),INTENT(IN) :: atoms
LOGICAL,INTENT(IN) :: l_real
INTEGER:: irecl_coulomb
LOGICAL :: opened=.FALSE.
......@@ -59,7 +60,7 @@ contains
if (opened) return
opened=.true.
OPEN(unit=777,file='cmt',form='unformatted',access='direct',&
& recl=input%neig*hybinp%maxlmindx*atoms%nat*16)
& recl=input%neig*hybdat%maxlmindx*atoms%nat*16)
#ifdef CPP_NOSPMVEC
irecl_coulomb = hybinp%maxbasm1 * (hybinp%maxbasm1+1) * 8 / 2
......
......@@ -23,6 +23,7 @@ MODULE m_types_hybdat
INTEGER, ALLOCATABLE :: ne_eig(:)
INTEGER, ALLOCATABLE :: nbands(:)
INTEGER, ALLOCATABLE :: nobd(:, :)
INTEGER :: maxlmindx = -1
COMPLEX, ALLOCATABLE :: stepfunc(:,:,:)
contains
procedure :: set_stepfunction => set_stepfunction
......
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