Commit 3ac4539e authored by Matthias Redies's avatar Matthias Redies

finish renaming mpbasis => mpdata

parent a3f44ec1
......@@ -19,7 +19,7 @@ CONTAINS
!> The matrices generated and diagonalized here are of type m_mat as defined in m_types_mat.
!>@author D. Wortmann
SUBROUTINE eigen(mpi,stars,sphhar,atoms,xcpot,sym,kpts,vacuum,input,&
cell,enpara,banddos,noco,oneD,mpbasis,hybrid,iter,eig_id,results,inden,v,vx,hub1)
cell,enpara,banddos,noco,oneD,mpdata,hybrid,iter,eig_id,results,inden,v,vx,hub1)
#include"cpp_double.h"
USE m_types
......@@ -48,7 +48,7 @@ CONTAINS
TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_oneD),INTENT(IN) :: oneD
TYPE(t_mpbasis), intent(inout) :: mpbasis
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybrid),INTENT(INOUT) :: hybrid
TYPE(t_enpara),INTENT(INOUT) :: enpara
TYPE(t_input),INTENT(IN) :: input
......@@ -160,7 +160,7 @@ CONTAINS
IF (hybrid%l_addhf) CALL add_Vnonlocal(nk,lapw,atoms,hybrid,input,kpts,jsp,results,xcpot,noco,hmat)
IF(hybrid%l_subvxc) THEN
CALL subvxc(lapw,kpts%bk(:,nk),input,jsp,v%mt(:,0,:,:),atoms,ud,mpbasis,hybrid,enpara%el0,enpara%ello0,&
CALL subvxc(lapw,kpts%bk(:,nk),input,jsp,v%mt(:,0,:,:),atoms,ud,mpdata,hybrid,enpara%el0,enpara%ello0,&
sym,cell,sphhar,stars,xcpot,mpi,oneD,hmat,vx)
END IF
END IF ! hybrid%l_hybrid
......
......@@ -4,7 +4,7 @@ MODULE m_hf_init
! preparations for HF and hybrid functional calculation
!
CONTAINS
SUBROUTINE hf_init(mpbasis, hybrid, atoms, input, hybdat)
SUBROUTINE hf_init(mpdata, hybrid, atoms, input, hybdat)
USE m_types
USE m_hybrid_core
USE m_util
......@@ -12,7 +12,7 @@ CONTAINS
USE m_io_hybrid
USE m_types_hybdat
IMPLICIT NONE
TYPE(t_mpbasis), intent(inout) :: mpbasis
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_input), INTENT(IN) :: input
......@@ -25,10 +25,10 @@ CONTAINS
!Alloc variables
allocate(hybdat%lmaxc(atoms%ntype), source=0)
allocate(hybdat%bas1(atoms%jmtd, maxval(mpbasis%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas2(atoms%jmtd, maxval(mpbasis%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas1_MT(maxval(mpbasis%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%drbas1_MT(maxval(mpbasis%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas1(atoms%jmtd, maxval(mpdata%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas2(atoms%jmtd, maxval(mpdata%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%bas1_MT(maxval(mpdata%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
allocate(hybdat%drbas1_MT(maxval(mpdata%num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), source=0.0)
! preparations for core states
CALL core_init( input, atoms, hybdat%lmaxcd, hybdat%maxindxc)
......
......@@ -3,7 +3,7 @@
CONTAINS
SUBROUTINE checkolap(atoms, hybdat,&
mpbasis,hybrid,&
mpdata,hybrid,&
nkpti, kpts,&
mpi, &
input, sym, noco,&
......@@ -20,7 +20,7 @@
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_mpbasis), intent(in) :: mpbasis
TYPE(t_mpdata), intent(in) :: mpdata
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_input), INTENT(IN) :: input
TYPE(t_noco), INTENT(IN) :: noco
......@@ -110,7 +110,7 @@
END DO
IF (mpi%irank == 0) WRITE (6, '(/A)') ' Overlap <core|basis>'
allocate(olapcb(maxval(mpbasis%num_radfun_per_l)), olapcv(maxval(hybrid%nbands), nkpti),&
allocate(olapcb(maxval(mpdata%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))
......@@ -122,11 +122,11 @@
IF (l > atoms%lmax(itype)) EXIT ! very improbable case
IF (mpi%irank == 0) &
WRITE (6, "(9X,'u(',A,')',4X,'udot(',A,')',:,3X,'ulo(',A,"//&
"') ...')") (lchar(l), i=1, min(3, mpbasis%num_radfun_per_l(l, itype)))
"') ...')") (lchar(l), i=1, min(3, mpdata%num_radfun_per_l(l, itype)))
DO i = 1, hybdat%nindxc(l, itype)
IF (mpi%irank == 0)&
WRITE (6, '(1x,I1,A,2X)', advance='no') i + l, lchar(l)
DO j = 1, mpbasis%num_radfun_per_l(l, itype)
DO j = 1, mpdata%num_radfun_per_l(l, itype)
integrand = hybdat%core1(:, i, l, itype)*hybdat%bas1(:, j, l, itype)&
+ hybdat%core2(:, i, l, itype)*hybdat%bas2(:, j, l, itype)
......@@ -138,11 +138,11 @@
WRITE (6, '(F10.6)', advance='no') olapcb(j)
END DO
lm = sum([(mpbasis%num_radfun_per_l(j, itype)*(2*j + 1), j=0, l - 1)])
lm = sum([(mpdata%num_radfun_per_l(j, itype)*(2*j + 1), j=0, l - 1)])
iatom = sum(atoms%neq(1:itype - 1)) + 1 ! take first of group of equivalent atoms
DO m = -l, l
olapcv = 0
DO j = 1, mpbasis%num_radfun_per_l(l, itype)
DO j = 1, mpdata%num_radfun_per_l(l, itype)
lm = lm + 1
olapcv(:, :) = olapcv(:, :) + &
olapcb(j)*cmt(:maxval(hybrid%nbands), lm, iatom, :nkpti)
......@@ -197,7 +197,7 @@
IF (atoms%ntype > 1 .AND. mpi%irank == 0) &
WRITE (6, '(A,I3)') ' Atom type', itype
DO l = 0, atoms%lmax(itype)
DO i = 1, mpbasis%num_radfun_per_l(l, itype)
DO i = 1, mpdata%num_radfun_per_l(l, itype)
IF (mpi%irank == 0) THEN
SELECT CASE (i)
CASE (1)
......@@ -280,7 +280,7 @@
DO l = 0, atoms%lmax(itype)
DO m = -l, l
lm = lm + 1
DO n = 1, mpbasis%num_radfun_per_l(l, itype)
DO n = 1, mpdata%num_radfun_per_l(l, itype)
lm1 = lm1 + 1
rdum = hybdat%bas1(atoms%jri(itype), n, l, itype)/atoms%rmt(itype)
DO iband = 1, hybrid%nbands(ikpt)
......
This diff is collapsed.
......@@ -19,7 +19,7 @@ MODULE m_exchange_core
USE m_types_hybdat
CONTAINS
SUBROUTINE exchange_vccv1(nk, input,atoms, mpbasis, hybrid, hybdat, jsp, lapw, &
SUBROUTINE exchange_vccv1(nk, input,atoms, mpdata, hybrid, hybdat, jsp, lapw, &
nsymop, nsest, indx_sest, mpi, a_ex, results, mat_ex)
USE m_constants
......@@ -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_mpbasis), intent(in) :: mpbasis
TYPE(t_mpdata), intent(in) :: mpdata
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_lapw), INTENT(IN) :: lapw
......@@ -93,7 +93,7 @@ CONTAINS
DO l2 = 0, atoms%lmax(itype)
IF (l < ABS(l1 - l2) .OR. l > l1 + l2) CYCLE
DO p2 = 1, mpbasis%num_radfun_per_l(l2, itype)
DO p2 = 1, mpdata%num_radfun_per_l(l2, itype)
n = n + 1
M = SIZE(fprod, 2)
IF (n > M) THEN
......@@ -142,8 +142,8 @@ CONTAINS
ll = larr(i)
IF (ABS(m2) > ll) CYCLE
lm = SUM([((2*l2 + 1)*mpbasis%num_radfun_per_l(l2, itype), l2=0, ll - 1)]) &
+ (m2 + ll)*mpbasis%num_radfun_per_l(ll, itype) + parr(i)
lm = SUM([((2*l2 + 1)*mpdata%num_radfun_per_l(l2, itype), l2=0, ll - 1)]) &
+ (m2 + ll)*mpdata%num_radfun_per_l(ll, itype) + parr(i)
carr(i, n1) = cmt(n1, lm, iatom)*gaunt(l1, ll, l, m1, m2, M, hybdat%maxfac, hybdat%fac, hybdat%sfac)
......
......@@ -60,7 +60,7 @@ MODULE m_exchange_valence_hf
CONTAINS
SUBROUTINE exchange_valence_hf(nk, kpts, nkpt_EIBZ, sym, atoms, mpbasis, hybrid, cell, input, jsp, hybdat, mnobd, lapw, &
SUBROUTINE exchange_valence_hf(nk, kpts, nkpt_EIBZ, sym, atoms, mpdata, hybrid, cell, input, jsp, hybdat, mnobd, lapw, &
eig_irr, results, pointer_EIBZ, n_q, wl_iks, xcpot, noco, nsest, indx_sest, &
mpi, mat_ex)
......@@ -78,7 +78,7 @@ CONTAINS
TYPE(t_results), INTENT(IN) :: results
TYPE(t_xcpot_inbuild), INTENT(IN) :: xcpot
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_mpbasis), intent(inout) :: mpbasis
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_input), INTENT(IN) :: input
TYPE(t_noco), INTENT(IN) :: noco
......@@ -135,16 +135,16 @@ CONTAINS
REAL, ALLOCATABLE :: cprod_vv_r(:, :, :), carr3_vv_r(:, :, :)
COMPLEX, ALLOCATABLE :: cprod_vv_c(:, :, :), carr3_vv_c(:, :, :)
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_mt1(maxval(mpdata%num_radbasfn) - 1, maxval(mpdata%num_radbasfn) - 1, 0:maxval(hybrid%lcutm1), atoms%ntype)
REAL :: coulomb_mt2_r(maxval(mpdata%num_radbasfn) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
REAL :: coulomb_mt3_r(maxval(mpdata%num_radbasfn) - 1, atoms%nat, atoms%nat)
COMPLEX :: coulomb_mt2_c(maxval(mpdata%num_radbasfn) - 1, -maxval(hybrid%lcutm1):maxval(hybrid%lcutm1), 0:maxval(hybrid%lcutm1) + 1, atoms%nat)
COMPLEX :: coulomb_mt3_c(maxval(mpdata%num_radbasfn) - 1, atoms%nat, atoms%nat)
REAL :: coulomb_mtir_r(((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpbasis%n_g))* &
((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpbasis%n_g) + 1)/2)
COMPLEX :: coulomb_mtir_c(((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpbasis%n_g))* &
((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpbasis%n_g) + 1)/2)
REAL :: coulomb_mtir_r(((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpdata%n_g))* &
((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpdata%n_g) + 1)/2)
COMPLEX :: coulomb_mtir_c(((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpdata%n_g))* &
((maxval(hybrid%lcutm1) + 1)**2*atoms%nat + maxval(mpdata%n_g) + 1)/2)
LOGICAL :: occup(input%neig)
CALL timestart("valence exchange calculation")
......@@ -205,7 +205,7 @@ CONTAINS
ikpt0 = pointer_EIBZ(ikpt)
n = hybrid%nbasp + mpbasis%n_g(ikpt0)
n = hybrid%nbasp + mpdata%n_g(ikpt0)
IF (hybrid%nbasm(ikpt0) /= n) call judft_error('error hybrid%nbasm')
nn = n*(n + 1)/2
......@@ -227,11 +227,11 @@ CONTAINS
IF (mat_ex%l_real) THEN
CALL wavefproducts_inv5(1, hybrid%nbands(nk), ibando, ibando + psize - 1, input, jsp, atoms, &
lapw, kpts, nk, ikpt0, hybdat, mpbasis, hybrid, cell, hybrid%nbasp, sym, &
lapw, kpts, nk, ikpt0, hybdat, mpdata, hybrid, cell, hybrid%nbasp, sym, &
noco, nkqpt, cprod_vv_r)
ELSE
CALL wavefproducts_noinv5(1, hybrid%nbands(nk), ibando, ibando + psize - 1, nk, ikpt0, input, jsp, &!jsp,&
cell, atoms, mpbasis, hybrid, hybdat, kpts, lapw, sym, hybrid%nbasp, noco, nkqpt, cprod_vv_c)
cell, atoms, mpdata, hybrid, hybdat, kpts, lapw, sym, hybrid%nbasp, noco, nkqpt, cprod_vv_c)
END IF
! The sparse matrix technique is not feasible for the HSE
......@@ -245,8 +245,8 @@ 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_radbasfn, maxval(mpbasis%num_radbasfn), mpbasis%g, &
mpbasis%n_g(ikpt0), mpbasis%gptm_ptr(:, ikpt0), mpbasis%num_gpts(), mpbasis%radbasfn_mt, &
hybrid%lcutm1, maxval(hybrid%lcutm1), mpdata%num_radbasfn, maxval(mpdata%num_radbasfn), mpdata%g, &
mpdata%n_g(ikpt0), mpdata%gptm_ptr(:, ikpt0), mpdata%num_gpts(), mpdata%radbasfn_mt, &
hybrid%nbasm(ikpt0), iband1, hybrid%nbands(nk), nsest, ibando, psize, indx_sest, &
sym%invsat, sym%invsatnr, mpi%irank, cprod_vv_r(:hybrid%nbasm(ikpt0), :, :), &
cprod_vv_c(:hybrid%nbasm(ikpt0), :, :), mat_ex%l_real, wl_iks(:iband1, nkqpt), n_q(ikpt))
......@@ -259,7 +259,7 @@ CONTAINS
CALL bra_trafo2(mat_ex%l_real, carr3_vv_r(:hybrid%nbasm(ikpt0), :, :), cprod_vv_r(:hybrid%nbasm(ikpt0), :, :), &
carr3_vv_c(:hybrid%nbasm(ikpt0), :, :), cprod_vv_c(:hybrid%nbasm(ikpt0), :, :), &
hybrid%nbasm(ikpt0), psize, hybrid%nbands(nk), kpts%bkp(ikpt0), ikpt0, kpts%bksym(ikpt0), sym, &
mpbasis, hybrid, kpts, atoms, phase_vv)
mpdata, hybrid, kpts, atoms, phase_vv)
IF (mat_ex%l_real) THEN
cprod_vv_r(:hybrid%nbasm(ikpt0), :, :) = carr3_vv_r(:hybrid%nbasm(ikpt0), :, :)
ELSE
......@@ -280,11 +280,11 @@ CONTAINS
call timestart("sparse matrix products")
IF (mat_ex%l_real) THEN
carr1_v_r(:n) = 0
CALL spmvec_invs(atoms, mpbasis, hybrid, ikpt0, coulomb_mt1, coulomb_mt2_r, coulomb_mt3_r, &
CALL spmvec_invs(atoms, mpdata, hybrid, ikpt0, coulomb_mt1, coulomb_mt2_r, coulomb_mt3_r, &
coulomb_mtir_r, cprod_vv_r(:n, iband, n1), carr1_v_r(:n))
ELSE
carr1_v_c(:n) = 0
CALL spmvec_noinvs(atoms, mpbasis, hybrid, ikpt0, coulomb_mt1, coulomb_mt2_c, coulomb_mt3_c, &
CALL spmvec_noinvs(atoms, mpdata, hybrid, ikpt0, coulomb_mt1, coulomb_mt2_c, coulomb_mt3_c, &
coulomb_mtir_c, cprod_vv_c(:n, iband, n1), carr1_v_c(:n))
END IF
call timestop("sparse matrix products")
......@@ -329,7 +329,7 @@ CONTAINS
END IF
IF (zero_order) THEN
CALL dwavefproducts(dcprod, nk, 1, hybrid%nbands(nk), 1, hybrid%nbands(nk), .false., input,atoms, mpbasis,hybrid, &
CALL dwavefproducts(dcprod, nk, 1, hybrid%nbands(nk), 1, hybrid%nbands(nk), .false., input,atoms, mpdata,hybrid, &
cell, hybdat, kpts, kpts%nkpt, lapw, jsp, eig_irr)
! make dcprod hermitian
......@@ -341,7 +341,7 @@ CONTAINS
END DO
IF (ibs_corr) THEN
CALL ibs_correction(nk, atoms, input, jsp, hybdat, mpbasis, hybrid, lapw, kpts, kpts%nkpt, cell, mnobd, &
CALL ibs_correction(nk, atoms, input, jsp, hybdat, mpdata, hybrid, lapw, kpts, kpts%nkpt, cell, mnobd, &
sym, proj_ibsc, olap_ibsc)
END IF
END IF
......
......@@ -15,7 +15,7 @@ MODULE m_gen_wavf
CONTAINS
SUBROUTINE gen_wavf(nkpti, kpts, sym, atoms, el_eig, ello_eig, cell, mpbasis, hybrid, vr0, &
SUBROUTINE gen_wavf(nkpti, kpts, sym, atoms, el_eig, ello_eig, cell, mpdata, hybrid, vr0, &
hybdat, noco, oneD, mpi, input, jsp, zmat)
! nkpti :: number of irreducible k-points
......@@ -35,7 +35,7 @@ CONTAINS
TYPE(t_hybdat), INTENT(INOUT) :: hybdat
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_oneD), INTENT(IN) :: oneD
TYPE(t_mpbasis), intent(in) :: mpbasis
TYPE(t_mpdata), intent(in) :: mpdata
TYPE(t_hybrid), INTENT(IN) :: hybrid
TYPE(t_input), INTENT(IN) :: input
TYPE(t_noco), INTENT(IN) :: noco
......@@ -158,7 +158,7 @@ CONTAINS
#if CPP_DEBUG
! consistency check
IF (.not. all(iarr == mpbasis%num_radfun_per_l)) call judft_error('gen_wavf: counting error')
IF (.not. all(iarr == mpdata%num_radfun_per_l)) call judft_error('gen_wavf: counting error')
#endif
8000 FORMAT(1x, /, /, ' wavefunction parameters for atom type', i3, ':', /, t32, 'radial function', t79, &
......@@ -216,7 +216,7 @@ CONTAINS
! number l in the list of all local orbitals of the atom type
idum = 0
map_lo = 0
IF (mpbasis%num_radfun_per_l(l, itype) > 2) THEN
IF (mpdata%num_radfun_per_l(l, itype) > 2) THEN
DO j = 1, atoms%nlo(itype)
IF (atoms%llo(j, itype) == l) THEN
idum = idum + 1
......@@ -227,7 +227,7 @@ CONTAINS
DO M = -l, l
lm = ll + M
DO i = 1, mpbasis%num_radfun_per_l(l, itype)
DO i = 1, mpdata%num_radfun_per_l(l, itype)
indx = indx + 1
IF (i == 1) THEN
cmt(:, indx, iatom) = cdum*acof(:, lm, iatom)
......@@ -261,7 +261,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, mpbasis, hybrid, kpts, sym, jsp, zmat(ikpt0)%matsize1,input, &
zmat(ikpt0)%data_c(:, :), ikpt0, iop, atoms, mpdata, hybrid, kpts, sym, jsp, zmat(ikpt0)%matsize1,input, &
hybrid%nbands(ikpt0), lapw(ikpt0), lapw(ikpt), .true.)
CALL write_cmt(cmthlp, ikpt)
......
......@@ -8,7 +8,7 @@ MODULE m_hf_setup
CONTAINS
SUBROUTINE hf_setup(mpbasis, hybrid, input, sym, kpts, atoms, mpi, noco, cell, oneD, results, jsp, enpara, eig_id_hf, &
SUBROUTINE hf_setup(mpdata, hybrid, input, sym, kpts, atoms, mpi, noco, cell, oneD, results, jsp, enpara, eig_id_hf, &
hybdat, l_real, vr0, eig_irr)
USE m_types
USE m_eig66_io
......@@ -21,7 +21,7 @@ CONTAINS
IMPLICIT NONE
TYPE(t_mpbasis), INTENT(inout) :: mpbasis
TYPE(t_mpdata), INTENT(inout) :: mpdata
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_atoms), INTENT(IN) :: atoms
......@@ -178,14 +178,14 @@ CONTAINS
! generate eigenvectors z and MT coefficients from the previous iteration at all k-points
CALL gen_wavf(kpts%nkpt, kpts, sym, atoms, enpara%el0(:, :, jsp), enpara%ello0(:, :, jsp), cell, &
mpbasis, hybrid, vr0, hybdat, noco, oneD, mpi, input, jsp, zmat)
mpdata, hybrid, vr0, hybdat, noco, oneD, mpi, input, jsp, zmat)
! generate core wave functions (-> core1/2(jmtd,hybdat%nindxc,0:lmaxc,ntype) )
CALL corewf(atoms, jsp, input, vr0, hybdat%lmaxcd, hybdat%maxindxc, mpi, &
hybdat%lmaxc, hybdat%nindxc, hybdat%core1, hybdat%core2, hybdat%eig_c)
! check olap between core-basis/core-valence/basis-basis
CALL checkolap(atoms, hybdat, mpbasis, hybrid, kpts%nkpt, kpts, mpi, &
CALL checkolap(atoms, hybdat, mpdata, hybrid, kpts%nkpt, kpts, mpi, &
input, sym, noco, cell, lapw, jsp)
! set up pointer pntgpt
......@@ -216,13 +216,13 @@ CONTAINS
allocate(basprod(atoms%jmtd), stat=ok)
IF (ok /= 0) call judft_error('eigen_hf: failure allocation basprod')
IF(ALLOCATED(hybdat%prodm)) DEALLOCATE(hybdat%prodm)
allocate(hybdat%prodm(maxval(mpbasis%num_radbasfn), hybrid%max_indx_p_1, 0:maxval(hybrid%lcutm1), atoms%ntype), stat=ok)
allocate(hybdat%prodm(maxval(mpdata%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 mpbasis%init(hybrid, atoms)
call mpdata%init(hybrid, atoms)
basprod = 0; hybdat%prodm = 0; mpbasis%l1 = 0; mpbasis%l2 = 0
mpbasis%n1 = 0; mpbasis%n2 = 0
basprod = 0; hybdat%prodm = 0; mpdata%l1 = 0; mpdata%l2 = 0
mpdata%n1 = 0; mpdata%n2 = 0
IF(ALLOCATED(hybdat%nindxp1)) DEALLOCATE(hybdat%nindxp1) ! for spinpolarized systems
ALLOCATE (hybdat%nindxp1(0:maxval(hybrid%lcutm1), atoms%ntype))
hybdat%nindxp1 = 0
......@@ -232,8 +232,8 @@ CONTAINS
ll = l2
DO l1 = 0, ll
IF (ABS(l1 - l2) <= hybrid%lcutm1(itype)) THEN
DO n2 = 1, mpbasis%num_radfun_per_l(l2, itype)
nn = mpbasis%num_radfun_per_l(l1, itype)
DO n2 = 1, mpdata%num_radfun_per_l(l2, itype)
nn = mpdata%num_radfun_per_l(l1, itype)
IF (l1 == l2) nn = n2
DO n1 = 1, nn
! Calculate all basis-function hybdat%products to obtain
......@@ -244,12 +244,12 @@ CONTAINS
IF (MOD(l1 + l2 + l, 2) == 0) THEN
hybdat%nindxp1(l, itype) = hybdat%nindxp1(l, itype) + 1
n = hybdat%nindxp1(l, itype)
mpbasis%l1(n,l,itype) = l1
mpbasis%l2(n,l,itype) = l2
mpbasis%n1(n,l,itype) = n1
mpbasis%n2(n,l,itype) = n2
DO i = 1, mpbasis%num_radbasfn(l, itype)
hybdat%prodm(i, n, l, itype) = intgrf(basprod(:ng)*mpbasis%radbasfn_mt(:ng, i, l, itype), &
mpdata%l1(n,l,itype) = l1
mpdata%l2(n,l,itype) = l2
mpdata%n1(n,l,itype) = n1
mpdata%n2(n,l,itype) = n2
DO i = 1, mpdata%num_radbasfn(l, itype)
hybdat%prodm(i, n, l, itype) = intgrf(basprod(:ng)*mpdata%radbasfn_mt(:ng, i, l, itype), &
atoms, itype, hybdat%gridf)
END DO
END IF
......@@ -271,7 +271,7 @@ CONTAINS
hybrid%nobd(nk,jsp) = COUNT(results%w_iks(:hybrid%ne_eig(nk), nk, jsp) > 0.0)
END DO
hybrid%maxlmindx = MAXVAL([(SUM([(mpbasis%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))]), itype=1, atoms%ntype)])
hybrid%maxlmindx = MAXVAL([(SUM([(mpdata%num_radfun_per_l(l, itype)*(2*l + 1), l=0, atoms%lmax(itype))]), itype=1, atoms%ntype)])
hybrid%nbands = MIN(hybrid%bands1, input%neig)
ENDIF ! hybrid%l_calhf
......
......@@ -54,7 +54,7 @@ MODULE m_hsfock
CONTAINS
SUBROUTINE hsfock(nk, atoms, mpbasis, hybrid, lapw, kpts, jsp, input, hybdat, eig_irr, sym, cell, noco, &
SUBROUTINE hsfock(nk, atoms, mpdata, hybrid, lapw, kpts, jsp, input, hybdat, eig_irr, sym, cell, noco, &
results, mnobd, xcpot, mpi)
IMPLICIT NONE
......@@ -68,7 +68,7 @@ CONTAINS
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_lapw), INTENT(IN) :: lapw
TYPE(t_mpbasis), intent(inout) :: mpbasis
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_hybdat), INTENT(INOUT) :: hybdat
TYPE(t_results), INTENT(INOUT) :: results
......@@ -149,7 +149,7 @@ CONTAINS
CALL timestart("symm_hf")
CALL symm_hf_init(sym, kpts, nk, nsymop, rrot, psym)
CALL symm_hf(kpts, nk, sym, hybdat, eig_irr, input,atoms, mpbasis, hybrid, cell, lapw, jsp, &
CALL symm_hf(kpts, nk, sym, hybdat, eig_irr, input,atoms, mpdata, hybrid, cell, lapw, jsp, &
rrot, nsymop, psym, nkpt_EIBZ, n_q, parent, pointer_EIBZ, nsest, indx_sest)
CALL timestop("symm_hf")
......@@ -164,7 +164,7 @@ CONTAINS
! calculate contribution from valence electrons to the
! HF exchange
ex%l_real = sym%invs
CALL exchange_valence_hf(nk, kpts, nkpt_EIBZ, sym, atoms, mpbasis, hybrid, cell, input, jsp, hybdat, mnobd, lapw, &
CALL exchange_valence_hf(nk, kpts, nkpt_EIBZ, sym, atoms, mpdata, hybrid, cell, input, jsp, hybdat, mnobd, lapw, &
eig_irr, results, pointer_EIBZ, n_q, wl_iks, xcpot, noco, nsest, indx_sest, &
mpi, ex)
......@@ -174,7 +174,7 @@ CONTAINS
IF (xcpot%is_name("hse") .OR. xcpot%is_name("vhse")) THEN
call judft_error('HSE not implemented in hsfock')
ELSE
CALL exchange_vccv1(nk, input,atoms, mpbasis, hybrid, hybdat, jsp, lapw, nsymop, nsest, indx_sest, mpi, a_ex, results, ex)
CALL exchange_vccv1(nk, input,atoms, mpdata, hybrid, hybdat, jsp, lapw, nsymop, nsest, indx_sest, mpi, a_ex, results, ex)
CALL exchange_cccc(nk, atoms, hybdat, ncstd, sym, kpts, a_ex, results)
END IF
......
......@@ -9,7 +9,7 @@ MODULE m_calc_hybrid
CONTAINS
SUBROUTINE calc_hybrid(eig_id, mpbasis, hybrid, kpts, atoms, input, mpi, noco, cell, oneD, &
SUBROUTINE calc_hybrid(eig_id, mpdata, hybrid, kpts, atoms, input, mpi, noco, cell, oneD, &
enpara, results, sym, xcpot, v, iterHF)
USE m_types_hybdat
......@@ -27,7 +27,7 @@ CONTAINS
TYPE(t_xcpot_inbuild), INTENT(IN) :: xcpot
TYPE(t_mpi), INTENT(IN) :: mpi
TYPE(t_oneD), INTENT(IN) :: oneD
type(t_mpbasis), intent(inout) :: mpbasis
type(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_input), INTENT(IN) :: input
TYPE(t_noco), INTENT(IN) :: noco
......@@ -125,19 +125,19 @@ CONTAINS
!construct the mixed-basis
CALL timestart("generation of mixed basis")
write (*,*) "iterHF = ", iterHF
CALL mixedbasis(atoms, kpts, input, cell, xcpot, mpbasis, hybrid, enpara, mpi, v, iterHF)
CALL mixedbasis(atoms, kpts, input, cell, xcpot, mpdata, hybrid, enpara, mpi, v, iterHF)
CALL timestop("generation of mixed basis")
CALL open_hybrid_io2(mpbasis, hybrid, input, atoms, sym%invs)
CALL open_hybrid_io2(mpdata, hybrid, input, atoms, sym%invs)
CALL coulombmatrix(mpi, atoms, kpts, cell, sym, mpbasis, hybrid, xcpot)
CALL coulombmatrix(mpi, atoms, kpts, cell, sym, mpdata, hybrid, xcpot)
CALL hf_init(mpbasis, hybrid, atoms, input, hybdat)
CALL hf_init(mpdata, hybrid, atoms, input, hybdat)
CALL timestop("Preparation for Hybrid functionals")
CALL timestart("Calculation of non-local HF potential")
DO jsp = 1, input%jspins
call timestart("HF_setup")
CALL HF_setup(mpbasis,hybrid, input, sym, kpts, atoms, &
CALL HF_setup(mpdata,hybrid, input, sym, kpts, atoms, &
mpi, noco, cell, oneD, results, jsp, enpara, eig_id, &
hybdat, sym%invs, v%mt(:, 0, :, :), eig_irr)
call timestop("HF_setup")
......@@ -145,7 +145,7 @@ CONTAINS
DO nk = 1, kpts%nkpt
!DO nk = mpi%n_start,kpts%nkpt,mpi%n_stride
CALL lapw%init(input, noco, kpts, atoms, sym, nk, cell, l_zref)
CALL hsfock(nk, atoms, mpbasis, hybrid, lapw, kpts, jsp, input, hybdat, eig_irr, sym, cell, &
CALL hsfock(nk, atoms, mpdata, hybrid, lapw, kpts, jsp, input, hybdat, eig_irr, sym, cell, &
noco, results, MAXVAL(hybrid%nobd(:,jsp)), xcpot, mpi)
END DO
END DO
......
......@@ -6,7 +6,7 @@ CONTAINS
SUBROUTINE ibs_correction( &
nk, atoms, &
input, jsp, &
hybdat, mpbasis,hybrid, &
hybdat, mpdata,hybrid, &
lapw, kpts, nkpti, &
cell, mnobd, &
sym, &
......@@ -23,7 +23,7 @@ CONTAINS
USE m_io_hybrid
IMPLICIT NONE
TYPE(t_hybdat), INTENT(IN) :: hybdat
TYPE(t_mpbasis), intent(inout) :: mpbasis
TYPE(t_mpdata), intent(inout) :: mpdata
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_input), INTENT(IN) :: input
TYPE(t_sym), INTENT(IN) :: sym
......@@ -69,10 +69,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, maxval(mpbasis%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%ntype), &
bas2_tmp(atoms%jmtd, maxval(mpbasis%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%ntype)
REAL :: bas1_MT_tmp(maxval(mpbasis%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%ntype), &
drbas1_MT_tmp(maxval(mpbasis%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%ntype)
REAL :: bas1_tmp(atoms%jmtd, maxval(mpdata%num_radfun_per_l), 0:atoms%lmaxd + 1, atoms%