Commit fca0bfdd authored by Daniel Wortmann's avatar Daniel Wortmann

Modified hybrid directory to delete dimension datatype. Not fully done yet to simplify merge

parent 2bb6598d
......@@ -42,7 +42,7 @@ MODULE m_add_vnonlocal
! c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
CONTAINS
SUBROUTINE add_vnonlocal(nk, lapw, atoms, hybrid, dimension, kpts, jsp, results, xcpot, noco, hmat)
SUBROUTINE add_vnonlocal(nk, lapw, atoms, hybrid, input, kpts, jsp, results, xcpot, noco, hmat)
USE m_symm_hf, ONLY: symm_hf
USE m_util, ONLY: intgrf, intgrf_init
......@@ -58,7 +58,7 @@ CONTAINS
TYPE(t_results), INTENT(INOUT) :: results
CLASS(t_xcpot), INTENT(IN) :: xcpot
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_input), INTENT(IN) :: input
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_lapw), INTENT(IN) :: lapw
......@@ -73,7 +73,7 @@ CONTAINS
INTEGER :: n, nn, iband, nbasfcn
REAL :: a_ex
TYPE(t_mat) :: olap, tmp, v_x, z
COMPLEX :: exch(dimension%neigd, dimension%neigd)
COMPLEX :: exch(input%neig, input%neig)
! initialize weighting factor for HF exchange part
a_ex = xcpot%get_exchange_weight()
......@@ -104,7 +104,7 @@ CONTAINS
CALL read_olap(olap, kpts%nkpt*(jsp - 1) + nk)
IF (.NOT. olap%l_real) olap%data_c = conjg(olap%data_c)
CALL z%init(olap%l_real, nbasfcn, dimension%neigd)
CALL z%init(olap%l_real, nbasfcn, input%neig)
CALL read_z(z, kpts%nkptf*(jsp - 1) + nk)
......
......@@ -62,7 +62,7 @@
REAL, ALLOCATABLE :: olapcv_avg(:, :, :, :), olapcv_max(:, :, :, :)
TYPE(t_mat), ALLOCATABLE :: z(:)
COMPLEX :: cmt(dimension%neigd, hybrid%maxlmindx, atoms%nat, nkpti)
COMPLEX :: cmt(input%neig, hybrid%maxlmindx, atoms%nat, nkpti)
COMPLEX :: y((atoms%lmaxd + 1)**2)
COMPLEX, ALLOCATABLE :: olapcv(:, :), olapww(:, :)
COMPLEX, ALLOCATABLE :: carr1(:, :), carr2(:, :), carr3(:, :)
......@@ -77,7 +77,7 @@
DO ikpt = 1, nkpti
CALL lapw%init(input, noco, kpts, atoms, sym, ikpt, cell, sym%zrfs)
nbasfcn = MERGE(lapw%nv(1) + lapw%nv(2) + 2*atoms%nlotot, lapw%nv(1) + atoms%nlotot, noco%l_noco)
call z(ikpt)%alloc(sym%invs, nbasfcn, dimension%neigd)
call z(ikpt)%alloc(sym%invs, nbasfcn, input%neig)
ENDDO
IF (mpi%irank == 0) WRITE (6, '(//A)') '### checkolap ###'
......
......@@ -19,7 +19,7 @@ MODULE m_exchange_core
CONTAINS
SUBROUTINE exchange_vccv(nk, atoms, hybrid, hybdat, DIMENSION, jsp, lapw, &
SUBROUTINE exchange_vccv(nk, atoms, hybrid, hybdat, input, jsp, lapw, &
maxbands, mnobd, mpi, degenerat, symequivalent, results, &
ex_vv_r, ex_vv_c, l_real)
......@@ -33,7 +33,7 @@ CONTAINS
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_results), INTENT(INOUT) :: results
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_dimension), INTENT(IN) :: DIMENSION
TYPE(t_input), INTENT(IN) :: input
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_lapw), INTENT(IN) :: lapw
......@@ -68,7 +68,7 @@ CONTAINS
REAL, ALLOCATABLE :: fprod(:, :), fprod2(:, :)
REAL, ALLOCATABLE :: integral(:, :)
COMPLEX :: cmt(DIMENSION%neigd, hybrid%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybrid%maxlmindx, atoms%nat)
COMPLEX :: exchange(hybrid%nbands(nk), hybrid%nbands(nk))
COMPLEX, ALLOCATABLE :: carr(:, :), carr2(:, :), carr3(:, :)
......@@ -234,7 +234,7 @@ CONTAINS
END SUBROUTINE exchange_vccv
SUBROUTINE exchange_vccv1(nk, atoms, hybrid, hybdat, DIMENSION, jsp, lapw, &
SUBROUTINE exchange_vccv1(nk, atoms, hybrid, hybdat, input, jsp, lapw, &
nsymop, nsest, indx_sest, mpi, a_ex, results, mat_ex)
USE m_constants
......@@ -247,7 +247,7 @@ CONTAINS
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_results), INTENT(INOUT) :: results
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_dimension), INTENT(IN) :: DIMENSION
TYPE(t_input), INTENT(IN) :: input
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_lapw), INTENT(IN) :: lapw
......@@ -281,7 +281,7 @@ CONTAINS
REAL, ALLOCATABLE :: fprod(:, :), fprod2(:, :)
REAL, ALLOCATABLE :: integral(:, :)
COMPLEX :: cmt(DIMENSION%neigd, hybrid%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybrid%maxlmindx, atoms%nat)
COMPLEX :: exchange(hybrid%nbands(nk), hybrid%nbands(nk))
COMPLEX, ALLOCATABLE :: carr(:, :), carr2(:, :), carr3(:, :)
......@@ -549,7 +549,7 @@ CONTAINS
END SUBROUTINE exchange_cccc
SUBROUTINE exchange_cccv(nk, atoms, hybdat, hybrid, DIMENSION, maxbands, ncstd, &
SUBROUTINE exchange_cccv(nk, atoms, hybdat, hybrid, input, maxbands, ncstd, &
bkpt, sym, mpi, exch_cv_r, exch_cv_c, l_real)
USE m_constants
......@@ -562,7 +562,7 @@ CONTAINS
IMPLICIT NONE
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_dimension), INTENT(IN) :: DIMENSION
TYPE(t_input), INTENT(IN) :: input
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_sym), INTENT(IN) :: sym
TYPE(t_atoms), INTENT(IN) :: atoms
......@@ -593,7 +593,7 @@ CONTAINS
REAL :: integrand(atoms%jmtd)
COMPLEX :: cexp(atoms%nat)
COMPLEX :: exch(hybrid%nbands(nk), ncstd)
COMPLEX :: cmt(DIMENSION%neigd, hybrid%maxlmindx, atoms%nat), carr(hybrid%nbands(nk))
COMPLEX :: cmt(input%neig, hybrid%maxlmindx, atoms%nat), carr(hybrid%nbands(nk))
IF (mpi%irank == 0) THEN
WRITE (6, '(//A)') '### core-core-core-valence exchange ###'
......
......@@ -102,8 +102,8 @@ CONTAINS
INTEGER, INTENT(IN) :: nsest(hybrid%nbands(nk))
INTEGER, INTENT(IN) :: indx_sest(hybrid%nbands(nk), hybrid%nbands(nk))
REAL, INTENT(IN) :: eig_irr(dimension%neigd, kpts%nkpt)
REAL, INTENT(IN) :: wl_iks(dimension%neigd, kpts%nkptf)
REAL, INTENT(IN) :: eig_irr(input%neig, kpts%nkpt)
REAL, INTENT(IN) :: wl_iks(input%neig, kpts%nkptf)
! local scalars
INTEGER :: iband, iband1, ibando, ikpt, ikpt0
......@@ -168,7 +168,7 @@ CONTAINS
((hybrid%maxlcutm1 + 1)**2*atoms%nat + maxval(hybrid%ngptm) + 1)/2)
#endif
LOGICAL :: occup(dimension%neigd)
LOGICAL :: occup(input%neig)
CALL timestart("valence exchange calculation")
IF (initialize) THEN !it .eq. 1 .and. nk .eq. 1) THEN
......@@ -367,7 +367,7 @@ CONTAINS
IF (zero_order) THEN
CALL dwavefproducts(dcprod, nk, 1, hybrid%nbands(nk), 1, hybrid%nbands(nk), .false., atoms, hybrid, &
cell, hybdat, kpts, kpts%nkpt, lapw, dimension, jsp, eig_irr)
cell, hybdat, kpts, kpts%nkpt, lapw, input, jsp, eig_irr)
! make dcprod hermitian
DO n1 = 1, hybrid%nbands(nk)
......
......@@ -181,15 +181,15 @@ CONTAINS
! (acof,bcof,ccof) and APW-basis coefficients
! (a,b,bascofold_lo) at irred. kpoints
ALLOCATE (acof(dimension%neigd, 0:dimension%lmd, atoms%nat), stat=ok)
ALLOCATE (acof(input%neig, 0:atoms%lmaxd*(atoms%lmaxd+2), atoms%nat), stat=ok)
IF (ok /= 0) STOP 'gen_wavf: failure allocation acof'
ALLOCATE (bcof(dimension%neigd, 0:dimension%lmd, atoms%nat), stat=ok)
ALLOCATE (bcof(input%neig, 0:atoms%lmaxd*(atoms%lmaxd+2), atoms%nat), stat=ok)
IF (ok /= 0) STOP 'gen_wavf: failure allocation bcof'
ALLOCATE (ccof(-atoms%llod:atoms%llod, dimension%neigd, atoms%nlod, atoms%nat), stat=ok)
ALLOCATE (ccof(-atoms%llod:atoms%llod, input%neig, atoms%nlod, atoms%nat), stat=ok)
IF (ok /= 0) STOP 'gen_wavf: failure allocation ccof'
ALLOCATE (cmt(Dimension%Neigd, hybrid%maxlmindx, atoms%nat), stat=ok)
ALLOCATE (cmt(input%neig, hybrid%maxlmindx, atoms%nat), stat=ok)
IF (ok /= 0) STOP 'gen_wavf: Failure allocation cmt'
ALLOCATE (cmthlp(Dimension%Neigd, hybrid%maxlmindx, atoms%nat), stat=ok)
ALLOCATE (cmthlp(input%neig, hybrid%maxlmindx, atoms%nat), stat=ok)
IF (ok /= 0) STOP 'gen_wavf: failure allocation cmthlp'
DO ikpt0 = lower, upper
......@@ -282,7 +282,7 @@ CONTAINS
IF ((kpts%bkp(ikpt) == ikpt0) .AND. (ikpt0 /= ikpt)) THEN
iop = kpts%bksym(ikpt)
CALL waveftrafo_genwavf(cmthlp, zhlp%data_r, zhlp%data_c, cmt(:, :, :), zmat(1)%l_real, zmat(ikpt0)%data_r(:, :), &
zmat(ikpt0)%data_c(:, :), ikpt0, iop, atoms, hybrid, kpts, sym, jsp, zmat(ikpt0)%matsize1, dimension, &
zmat(ikpt0)%data_c(:, :), ikpt0, iop, atoms, hybrid, kpts, sym, jsp, zmat(ikpt0)%matsize1, input, &
hybrid%nbands(ikpt0), cell, lapw(ikpt0), lapw(ikpt), .true.)
CALL write_cmt(cmthlp, ikpt)
......
......@@ -52,12 +52,12 @@ CONTAINS
! local arrays
REAL, ALLOCATABLE :: basprod(:)
INTEGER :: degenerat(merge(dimension%neigd*2,dimension%neigd,noco%l_soc) + 1, kpts%nkpt)
INTEGER :: degenerat(merge(input%neig*2,input%neig,noco%l_soc) + 1, kpts%nkpt)
LOGICAL :: skip_kpt(kpts%nkpt)
INTEGER :: g(3)
REAL :: zDebug_r(DIMENSION%nbasfcn,Dimension%Neigd)
COMPLEX :: zDebug_c(DIMENSION%nbasfcn,Dimension%Neigd)
REAL :: zDebug_r(lapw_dim_nbasfcn,input%neig)
COMPLEX :: zDebug_c(lapw_dim_nbasfcn,input%neig)
skip_kpt = .FALSE.
......@@ -65,12 +65,12 @@ CONTAINS
! Preparations for HF and hybrid functional calculation
CALL timestart("gen_bz and gen_wavf")
WRITE(9333,*) DIMENSION%nbasfcn, Dimension%Neigd, atoms%nlotot, kpts%nkpt
WRITE(9333,*) lapw%dim_nbasfcn(), input%neig, atoms%nlotot, kpts%nkpt
WRITE(9333,*) ALLOCATED(hybdat%kveclo_eig)
ALLOCATE (zmat(kpts%nkptf), stat=ok)
IF (ok /= 0) STOP 'eigen_hf: failure allocation z_c'
ALLOCATE (eig_irr(merge(dimension%neigd*2,dimension%neigd,noco%l_soc), kpts%nkpt), stat=ok)
ALLOCATE (eig_irr(merge(input%neig*2,input%neig,noco%l_soc), kpts%nkpt), stat=ok)
IF (ok /= 0) STOP 'eigen_hf: failure allocation eig_irr'
IF(ALLOCATED(hybdat%kveclo_eig)) DEALLOCATE (hybdat%kveclo_eig) ! for spinpolarized systems
ALLOCATE (hybdat%kveclo_eig(atoms%nlotot, kpts%nkpt), stat=ok)
......@@ -80,8 +80,8 @@ CONTAINS
INQUIRE(file ="z",exist= l_exist)
IF(l_exist) THEN
IF (l_real) OPEN(unit=993,file='z',form='unformatted',access='direct',recl=DIMENSION%nbasfcn*Dimension%Neigd*8)
IF (.NOT.l_real) OPEN(unit=993,file='z',form='unformatted',access='direct',recl=DIMENSION%nbasfcn*Dimension%Neigd*16)
IF (l_real) OPEN(unit=993,file='z',form='unformatted',access='direct',recl=lapw%dim_nbasfcn()*input%neig*8)
IF (.NOT.l_real) OPEN(unit=993,file='z',form='unformatted',access='direct',recl=lapw%dim_nbasfcn()*input%neig*16)
END IF
! Reading the eig file
......@@ -89,18 +89,18 @@ CONTAINS
nrec1 = kpts%nkpt*(jsp - 1) + nk
CALL lapw%init(input, noco, kpts, atoms, sym, nk, cell, sym%zrfs)
nbasfcn = MERGE(lapw%nv(1) + lapw%nv(2) + 2*atoms%nlotot, lapw%nv(1) + atoms%nlotot, noco%l_noco)
CALL zMat(nk)%init(l_real, nbasfcn, merge(dimension%neigd*2,dimension%neigd,noco%l_soc))
CALL zMat(nk)%init(l_real, nbasfcn, merge(input%neig*2,input%neig,noco%l_soc))
CALL read_eig(eig_id_hf, nk, jsp, zmat=zMat(nk))
IF(l_exist.AND.zmat(1)%l_real) THEN
READ(993,rec=nk) zDebug_r(:,:)
zMat(nk)%data_r = 0.0
zMat(nk)%data_r(:nbasfcn,:Dimension%Neigd) = zDebug_r(:nbasfcn,:Dimension%Neigd)
zMat(nk)%data_r(:nbasfcn,:input%neig) = zDebug_r(:nbasfcn,:input%neig)
END IF
IF(l_exist.AND..NOT.zmat(1)%l_real) THEN
READ(993,rec=nk) zDebug_c(:,:)
zMat(nk)%data_c = 0.0
zMat(nk)%data_c(:nbasfcn,:Dimension%Neigd) = zDebug_c(:nbasfcn,:Dimension%Neigd)
zMat(nk)%data_c(:nbasfcn,:input%neig) = zDebug_c(:nbasfcn,:input%neig)
END IF
WRITE(9333,*) SHAPE(eig_irr)
......@@ -115,7 +115,7 @@ CONTAINS
!Allocate further space
DO nk = kpts%nkpt + 1, kpts%nkptf
nbasfcn = zMat(kpts%bkp(nk))%matsize1
CALL zMat(nk)%init(l_real, nbasfcn, merge(dimension%neigd*2,dimension%neigd,noco%l_soc))
CALL zMat(nk)%init(l_real, nbasfcn, merge(input%neig*2,input%neig,noco%l_soc))
END DO
!determine degenerate states at each k-point
......@@ -279,7 +279,7 @@ CONTAINS
END DO
hybrid%maxlmindx = MAXVAL((/(SUM((/(hybrid%nindx(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))/)), itype=1, atoms%ntype)/))
hybrid%nbands = MIN(hybrid%bands1, DIMENSION%neigd)
hybrid%nbands = MIN(hybrid%bands1, input%neig)
ENDIF ! hybrid%l_calhf
......
......@@ -80,7 +80,7 @@ CONTAINS
INTEGER, INTENT(IN) :: mnobd
! arrays
REAL, INTENT(IN) :: eig_irr(dimension%neigd, kpts%nkpt)
REAL, INTENT(IN) :: eig_irr(input%neig, kpts%nkpt)
! local scalars
INTEGER :: i, j, ic, ic1, l, itype, n, nn
......@@ -104,10 +104,10 @@ CONTAINS
INTEGER, ALLOCATABLE :: pointer_EIBZ(:)
INTEGER, ALLOCATABLE :: n_q(:)
REAL :: wl_iks(dimension%neigd, kpts%nkptf)
REAL :: wl_iks(input%neig, kpts%nkptf)
TYPE(t_mat) :: olap, trafo, invtrafo, ex, tmp, v_x, z
COMPLEX :: exch(dimension%neigd, dimension%neigd)
COMPLEX :: exch(input%neig, input%neig)
COMPLEX, ALLOCATABLE :: carr(:)
CALL timestart("total time hsfock")
......@@ -154,13 +154,13 @@ CONTAINS
CALL timestart("symm_hf")
CALL symm_hf_init(sym, kpts, nk, nsymop, rrot, psym)
CALL symm_hf(kpts, nk, sym, dimension, hybdat, eig_irr, atoms, hybrid, cell, lapw, jsp, mpi, &
CALL symm_hf(kpts, nk, sym, input, hybdat, eig_irr, atoms, hybrid, cell, lapw, jsp, mpi, &
rrot, nsymop, psym, nkpt_EIBZ, n_q, parent, pointer_EIBZ, nsest, indx_sest)
CALL timestop("symm_hf")
! remove weights(wtkpt) in w_iks
DO ikpt = 1, kpts%nkptf
DO iband = 1, dimension%neigd
DO iband = 1, input%neig
ikpt0 = kpts%bkp(ikpt)
wl_iks(iband, ikpt) = results%w_iks(iband, ikpt0, jsp)/(kpts%wtkpt(ikpt0)*kpts%nkptf)
END DO
......@@ -179,7 +179,7 @@ CONTAINS
IF (xcpot%is_name("hse") .OR. xcpot%is_name("vhse")) THEN
STOP "HSE not implemented in hsfock"
ELSE
CALL exchange_vccv1(nk, atoms, hybrid, hybdat, dimension, jsp, lapw, nsymop, nsest, indx_sest, mpi, a_ex, results, ex)
CALL exchange_vccv1(nk, atoms, hybrid, hybdat, input, jsp, lapw, nsymop, nsest, indx_sest, mpi, a_ex, results, ex)
CALL exchange_cccc(nk, atoms, hybdat, ncstd, sym, kpts, a_ex, mpi, results)
END IF
......@@ -188,9 +188,9 @@ CONTAINS
CALL timestart("time for performing T^-1*mat_ex*T^-1*")
!calculate trafo from wavefunctions to APW basis
IF (dimension%neigd < hybrid%nbands(nk)) STOP " mhsfock: neigd < nbands(nk) ;trafo from wavefunctions to APW requires at least nbands(nk)"
IF (input%neig < hybrid%nbands(nk)) STOP " mhsfock: neigd < nbands(nk) ;trafo from wavefunctions to APW requires at least nbands(nk)"
call z%init(olap%l_real, nbasfcn, dimension%neigd)
call z%init(olap%l_real, nbasfcn, input%neig)
call read_z(z, kpts%nkptf*(jsp - 1) + nk)
z%matsize2 = hybrid%nbands(nk) ! reduce "visible matsize" for the following computations
......
......@@ -24,9 +24,9 @@ CONTAINS
! ..
! .. Array Arguments ..
COMPLEX, INTENT(INOUT) :: acof(:, 0:, :) !(dimension%neigd,0:dimension%lmd,atoms%natd)
COMPLEX, INTENT(INOUT) :: bcof(:, 0:, :) !(dimension%neigd,0:dimension%lmd,atoms%natd)
COMPLEX, INTENT(INOUT) :: ccof(-atoms%llod:, :, :, :)!(-llod:llod,dimension%neigd,atoms%nlod,atoms%natd)
COMPLEX, INTENT(INOUT) :: acof(:, 0:, :) !(input%neig,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%natd)
COMPLEX, INTENT(INOUT) :: bcof(:, 0:, :) !(input%neig,0:atoms%lmaxd*(atoms%lmaxd+2),atoms%natd)
COMPLEX, INTENT(INOUT) :: ccof(-atoms%llod:, :, :, :)!(-llod:llod,input%neig,atoms%nlod,atoms%natd)
! ..
! .. Local Scalars ..
INTEGER itype, ineq, iatom, iop, ilo, i, l, lm, lmp, ifac
......
......@@ -10,7 +10,7 @@ MODULE m_calc_hybrid
CONTAINS
SUBROUTINE calc_hybrid(eig_id, hybrid, kpts, atoms, input, DIMENSION, mpi, noco, cell, oneD, &
SUBROUTINE calc_hybrid(eig_id, hybrid, kpts, atoms, input, mpi, noco, cell, oneD, &
enpara, results, sym, xcpot, v, iter, iterHF)
USE m_types
......@@ -26,7 +26,7 @@ CONTAINS
TYPE(t_xcpot_inbuild), INTENT(IN) :: xcpot
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_dimension), INTENT(IN) :: DIMENSION
TYPE(t_dimension) :: DIMENSION !to be deleted
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_input), INTENT(IN) :: input
......@@ -56,7 +56,7 @@ CONTAINS
CALL timestart("Hybrid code")
INQUIRE (file="v_x.mat", exist=hybrid%l_addhf)
CALL open_hybrid_io1(DIMENSION, sym%invs)
CALL open_hybrid_io1( sym%invs)
IF (kpts%nkptf == 0) THEN
CALL judft_error("kpoint-set of full BZ not available", &
......@@ -76,19 +76,19 @@ CONTAINS
results%te_hfex%core = 0
!Check if we are converged well enough to calculate a new potential
CALL open_hybrid_io1b(DIMENSION, sym%invs)
CALL open_hybrid_io1b( sym%invs)
hybrid%l_addhf = .TRUE.
!In first iteration allocate some memory
IF (init_vex) THEN
ALLOCATE (hybrid%ne_eig(kpts%nkpt), hybrid%nbands(kpts%nkpt), hybrid%nobd(kpts%nkptf))
ALLOCATE (hybrid%nbasm(kpts%nkptf))
ALLOCATE (hybrid%div_vv(DIMENSION%neigd, kpts%nkpt, input%jspins))
ALLOCATE (hybrid%div_vv(input%neig, kpts%nkpt, input%jspins))
init_vex = .FALSE.
END IF
hybrid%l_subvxc = (hybrid%l_subvxc .AND. hybrid%l_addhf)
IF (.NOT. ALLOCATED(results%w_iks)) ALLOCATE (results%w_iks(merge(dimension%neigd*2,dimension%neigd,noco%l_soc), kpts%nkpt, input%jspins))
IF (.NOT. ALLOCATED(results%w_iks)) ALLOCATE (results%w_iks(merge(input%neig*2,input%neig,noco%l_soc), kpts%nkpt, input%jspins))
IF (hybrid%l_calhf) THEN
iterHF = iterHF + 1
......@@ -108,7 +108,7 @@ CONTAINS
CALL mixedbasis(atoms, kpts, dimension, input, cell, sym, xcpot, hybrid, enpara, mpi, v, l_restart)
CALL timestop("generation of mixed basis")
CALL open_hybrid_io2(hybrid, DIMENSION, atoms, sym%invs)
CALL open_hybrid_io2(hybrid, input, atoms, sym%invs)
CALL coulombmatrix(mpi, atoms, kpts, cell, sym, hybrid, xcpot, l_restart)
......
......@@ -86,8 +86,8 @@ MODULE m_kp_perturbation
COMPLEX, ALLOCATABLE :: cmt_lo(:, :, :, :)
COMPLEX, ALLOCATABLE :: cmt_apw(:, :, :)
TYPE(t_mat) :: z
REAL :: work_r(dimension%neigd)
COMPLEX :: work_c(dimension%neigd)
REAL :: work_r(input%neig)
COMPLEX :: work_c(input%neig)
!CALL intgrf_init(atoms%ntype,atoms%jmtd,atoms%jri,atoms%dx,atoms%rmsh,hybdat%gridf)
......@@ -146,7 +146,7 @@ MODULE m_kp_perturbation
END DO
! calculate lo wavefunction coefficients
ALLOCATE (cmt_lo(dimension%neigd, -atoms%llod:atoms%llod, atoms%nlod, atoms%nat))
ALLOCATE (cmt_lo(input%neig, -atoms%llod:atoms%llod, atoms%nlod, atoms%nat))
cmt_lo = 0
iatom = 0
ic = 0
......@@ -223,7 +223,7 @@ MODULE m_kp_perturbation
END DO
idum = maxval(lmp_start)
ALLOCATE (cmt_apw(dimension%neigd, idum, atoms%nat))
ALLOCATE (cmt_apw(input%neig, idum, atoms%nat))
cmt_apw = 0
DO i = 1, lapw%nv(jsp)
kvec = kpts%bk(:, nk) + (/lapw%k1(i, jsp), lapw%k2(i, jsp), lapw%k3(i, jsp)/)
......@@ -708,7 +708,7 @@ MODULE m_kp_perturbation
atoms, hybrid, &
cell, &
hybdat, kpts, nkpti, lapw, &
dimension, jsp, &
input, jsp, &
eig_irr)
USE m_wrapper
......@@ -717,7 +717,7 @@ MODULE m_kp_perturbation
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_input), INTENT(IN) :: input
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_kpts), INTENT(IN) :: kpts
......@@ -731,7 +731,7 @@ MODULE m_kp_perturbation
! - arrays -
REAL, INTENT(IN) :: eig_irr(dimension%neigd, nkpti)
REAL, INTENT(IN) :: eig_irr(input%neig, nkpti)
COMPLEX, INTENT(OUT) :: dcprod(bandi2:bandf2, bandi1:bandf1, 3)
! - local scalars -
......@@ -747,7 +747,7 @@ MODULE m_kp_perturbation
atoms, hybrid, &
cell, &
hybdat, kpts, lapw, &
dimension, jsp)
input,jsp)
! __
! Calculate expansion coefficients -i < uj | \/ | ui > / ( ei - ej ) for periodic function ui
......@@ -782,7 +782,7 @@ MODULE m_kp_perturbation
atoms, hybrid, &
cell, &
hybdat, kpts, lapw, &
dimension, jsp)
input, jsp)
USE m_olap
USE m_wrapper
......@@ -794,7 +794,7 @@ MODULE m_kp_perturbation
IMPLICIT NONE
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_input), INTENT(IN) :: input
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_cell), INTENT(IN) :: cell
TYPE(t_kpts), INTENT(IN) :: kpts
......@@ -829,7 +829,7 @@ MODULE m_kp_perturbation
COMPLEX :: cvec1(hybrid%maxlmindx), cvec2(hybrid%maxlmindx), cvec3(hybrid%maxlmindx)
COMPLEX :: cmt1(hybrid%maxlmindx, bandi1:bandf1), cmt2(hybrid%maxlmindx, bandi2:bandf2)
COMPLEX :: carr1(3), carr2(3)
COMPLEX :: cmt(dimension%neigd, hybrid%maxlmindx, atoms%nat)
COMPLEX :: cmt(input%neig, hybrid%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))
......
......@@ -428,13 +428,13 @@ CONTAINS
SUBROUTINE olap_cv(hybrid, kpts, maxlcutc, maxindxc, atoms,&
& lmaxc, lmaxcd, nindxc,&
& core1, core2, bas1, bas2, cmt, dimension,&
& core1, core2, bas1, bas2, cmt, input,&
& gridf)
USE m_util, ONLY: intgrf, intgrf_init, chr
USE m_types
IMPLICIT NONE
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_input), INTENT(IN) :: input
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_atoms), INTENT(IN) :: atoms
......@@ -449,7 +449,7 @@ CONTAINS
& core2(atoms%jmtd, 0:lmaxcd, maxindxc, atoms%ntype)
REAL, INTENT(IN) :: bas1(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype),&
& bas2(atoms%jmtd, hybrid%maxindx, 0:atoms%lmaxd, atoms%ntype)
COMPLEX, INTENT(IN) :: cmt(dimension%neigd, kpts%nkpt, hybrid%maxlmindx, atoms%nat)
COMPLEX, INTENT(IN) :: cmt(input%neig, kpts%nkpt, hybrid%maxlmindx, atoms%nat)
! - local scalars -
INTEGER :: itype, icent, l, m, lm, i, j
......@@ -467,7 +467,7 @@ CONTAINS
! CALL intgrf_init(ntype,jmtd,jri,dx,rmsh,gridf)
WRITE (6, '(/A)') 'Overlap <core|basis>'
ALLOCATE (olapcb(hybrid%maxindx), olapcv(dimension%neigd, kpts%nkpt),&
ALLOCATE (olapcb(hybrid%maxindx), olapcv(input%neig, kpts%nkpt),&
& olapcv_avg(-maxlcutc:maxlcutc, maxindxc, 0:maxlcutc, atoms%ntype),&
& olapcv_max(-maxlcutc:maxlcutc, maxindxc, 0:maxlcutc, atoms%ntype),&
& olapcv_loc(2, -maxlcutc:maxlcutc, maxindxc, 0:maxlcutc, atoms%ntype))
......@@ -498,7 +498,7 @@ CONTAINS
olapcv(:, :) = olapcv(:, :) + olapcb(j)*cmt(:, :, lm, icent)
END DO
olapcv_avg(M, i, l, itype) = sqrt(sum(abs(olapcv(:, :))**2)&
& /kpts%nkpt/dimension%neigd)
& /kpts%nkpt/input%neig)
olapcv_max(M, i, l, itype) = maxval(abs(olapcv(:, :)))
olapcv_loc(:, M, i, l, itype) = maxloc(abs(olapcv(:, :)))
END DO
......
......@@ -8,7 +8,7 @@ MODULE m_subvxc
CONTAINS
SUBROUTINE subvxc(lapw, bk, DIMENSION, input, jsp, vr0, atoms, usdus, hybrid, el, ello, sym, &
SUBROUTINE subvxc(lapw, bk, input, jsp, vr0, atoms, usdus, hybrid, el, ello, sym, &
cell, sphhar, stars, xcpot, mpi, oneD, hmat, vx)
USE m_types
......@@ -26,7 +26,6 @@ CONTAINS
CLASS(t_xcpot), INTENT(IN) :: xcpot
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_input), INTENT(IN) :: input
......@@ -82,7 +81,7 @@ CONTAINS
COMPLEX :: vpw(stars%ng3)
COMPLEX :: vxc(hmat%matsize1*(hmat%matsize1 + 1)/2)
COMPLEX :: vrmat(hybrid%maxlmindx, hybrid%maxlmindx)
COMPLEX :: carr(hybrid%maxlmindx, DIMENSION%nvd), carr1(DIMENSION%nvd, DIMENSION%nvd)
COMPLEX :: carr(hybrid%maxlmindx, lapw%dim_nvd()), carr1(lapw%dim_nvd(), lapw%dim_nvd())
COMPLEX, ALLOCATABLE :: ahlp(:, :, :), bhlp(:, :, :)
COMPLEX, ALLOCATABLE :: bascof(:, :, :)
#ifndef CPP_OLDINTEL
......@@ -136,12 +135,12 @@ CONTAINS
! Compute APW coefficients
! Calculate bascof
ALLOCATE (ahlp(DIMENSION%nvd, 0:DIMENSION%lmd, atoms%nat), bhlp(DIMENSION%nvd, 0:DIMENSION%lmd, atoms%nat), stat=ok)
ALLOCATE (ahlp(lapw%dim_nvd(), 0:atoms%lmaxd*(atoms%lmaxd+2), atoms%nat), bhlp(lapw%dim_nvd(), 0:atoms%lmaxd*(atoms%lmaxd+2), atoms%nat), stat=ok)
IF (ok /= 0) STOP 'subvxc: error in allocation of ahlp/bhlp'
#ifndef CPP_OLDINTEL
CALL abcof3(input, atoms, sym, jsp, cell, bk, lapw, usdus, oneD, ahlp, bhlp, bascof_lo)
#endif
ALLOCATE (bascof(DIMENSION%nvd, 2*(DIMENSION%lmd + 1), atoms%nat), stat=ok)
ALLOCATE (bascof(lapw%dim_nvd(), 2*(atoms%lmaxd*(atoms%lmaxd+2) + 1), atoms%nat), stat=ok)
IF (ok /= 0) STOP 'subvxc: error in allocation of bascof'