Commit 790265bf authored by Matthias Redies's avatar Matthias Redies

put usdus in hybdat

parent 72d9a41d
set(fleur_F90 ${fleur_F90}
hybrid/hyb_abcrot.F90
hybrid/exchange_core.F90
hybrid/mixedbasis.F90
hybrid/symmetrizeh.F90
hybrid/checkolap.F90
hybrid/exchange_val_hf.F90
hybrid/hybrid_core.f90
hybrid/coulombmatrix.F90
hybrid/gen_wavf.F90
hybrid/spmvec.F90
hybrid/calc_hybrid.F90
hybrid/HF_init.F90
hybrid/hsfock.F90
hybrid/subvxc.F90
hybrid/add_Vnonlocal.F90
hybrid/hf_setup.F90
hybrid/kp_perturbation.f90
hybrid/symm_hf.f90
hybrid/trafo.F90
hybrid/exponential_integral.f90
hybrid/hsefunctional.F90
hybrid/olap.F90
hybrid/wrapper.f90
hybrid/wavefproducts.f90
hybrid/wavefproducts_aux.f90
hybrid/wavefproducts_inv.f90
hybrid/wavefproducts_noinv.f90
hybrid/util/util.f90
hybrid/util/rorder.f90
hybrid/util/intgrf.f90
hybrid/calc_cmt.f90
hybrid/hyb_abcrot.F90
hybrid/exchange_core.F90
hybrid/mixedbasis.F90
hybrid/symmetrizeh.F90
hybrid/checkolap.F90
hybrid/exchange_val_hf.F90
hybrid/hybrid_core.f90
hybrid/coulombmatrix.F90
hybrid/gen_wavf.F90
hybrid/spmvec.F90
hybrid/calc_hybrid.F90
hybrid/HF_init.F90
hybrid/hsfock.F90
hybrid/subvxc.F90
hybrid/add_Vnonlocal.F90
hybrid/hf_setup.F90
hybrid/kp_perturbation.f90
hybrid/symm_hf.f90
hybrid/trafo.F90
hybrid/exponential_integral.f90
hybrid/hsefunctional.F90
hybrid/olap.F90
hybrid/wrapper.f90
hybrid/wavefproducts.f90
hybrid/wavefproducts_aux.f90
hybrid/wavefproducts_inv.f90
hybrid/wavefproducts_noinv.f90
hybrid/util/util.f90
hybrid/util/rorder.f90
hybrid/util/intgrf.f90
)
module m_calc_cmt
contains
! subroutine calc_cmt(atoms, cell, input, noco, hybinp, hybdat, kpts, sym, oneD,&
! zmat_ikp, jsp, ik)
! use m_types
! use m_judft
! implicit none
! type(t_atoms), intent(in) :: atoms
! type(t_cell), intent(in) :: cell
! type(t_enpara), intent(in) :: enpara
! type(t_input), intent(in) :: input
! type(t_noco), intent(in) :: noco
! type(t_hybinp), intent(in) :: hybinp
! type(t_hybdat), intent(in) :: hybdat
! type(t_kpts), intent(in) :: kpts
! type(t_sym), intent(in) :: sym
! type(t_oneD), intent(in) :: oneD
! type(t_mat), intent(in) :: zmat_ikp ! zmat of parent k-point
! integer, intent(in) :: jsp
! integer, intent(in) :: ik ! k-point index
!
!
!
! complex, allocatable :: acof(:, :, :), bcof(:, :, :), ccof(:, :, :, :)
! complex :: cmt(input%neig, hybdat%maxlmindx, atoms%nat)
! complex :: cmthlp(input%neig, hybdat%maxlmindx, atoms%nat)
!
! integer :: ikp, nbands, ok(3), maxp ! index of parent k-point
!
! type(t_lapw) :: lapw_ik, lapw_ikp
! type(t_usdus) :: usdus
!
! ikp = kpts%bkp(ik)
! nbands = hybdat%nbands(ikp)
!
! allocate(acof(nbands, 0:atoms%lmaxd*(atoms%lmaxd+2), atoms%nat), stat=ok(1))
! allocate(bcof(nbands, 0:atoms%lmaxd*(atoms%lmaxd+2), atoms%nat), stat=ok(2))
! allocate(ccof(-atoms%llod:atoms%llod, nbands, atoms%nlod, atoms%nat), stat=ok(3))
! ! allocate(cmt(input%neig, hybdat%maxlmindx, atoms%nat), stat=ok)
! ! allocate(cmthlp(input%neig, hybdat%maxlmindx, atoms%nat), stat=ok)
!
! CALL usdus%init(atoms, input%jspins)
! DO itype = 1, atoms%ntype
! DO l = 0, atoms%lmax(itype)
! CALL radfun(l, itype, jsp, enpara%el0(l,itype, jsp)), vr(:, itype, jsp), &
! atoms, u(:, :, l), du(:, :, l), usdus, nodem, noded, wronk)
! END DO
!
! IF (atoms%nlo(itype) >= 1) THEN
! CALL radflo(atoms, itype, jsp, ello_eig, vr(:, itype, jsp), u, du, mpi, usdus, uuilon, duilon, ulouilopn, flo)
! END IF
! END DO
!
! if(any(ok /= 0)) then
! maxp = maxloc(abs(ok))
! call judft_error("Error in allocating array no" // int2str(maxp))
! endif
! acof = 0; bcof = 0; ccof = 0
!
! CALL lapw_ik%init(input, noco, kpts, atoms, sym, ik, cell, sym%zrfs)
! CALL lapw_ikp%init(input, noco, kpts, atoms, sym, ikp, cell, sym%zrfs)
!
! lapw_ikp%nmat = lapw_ikp%nv(jsp) + atoms%nlotot
!
! CALL abcof(input, atoms, sym, cell, lapw_ikp, nbands, usdus, noco, jsp, &
! oneD, acof, bcof, ccof, zmat_ikp)
! CALL hyb_abcrot(hybinp, atoms, nbands, sym, acof, bcof, ccof)
!
! end subroutine calc_cmt
end module m_calc_cmt
MODULE m_types_hybdat
IMPLICIT NONE
use m_types_usdus
IMPLICIT NONE
TYPE t_hybdat
LOGICAL :: l_subvxc = .false.
......@@ -8,30 +8,31 @@ MODULE m_types_hybdat
LOGICAL :: l_addhf = .false.
INTEGER :: lmaxcd, maxindxc
INTEGER :: maxfac
REAL, ALLOCATABLE :: gridf(:,:)
INTEGER, ALLOCATABLE :: nindxc(:,:)
REAL, ALLOCATABLE :: gridf(:, :)
INTEGER, ALLOCATABLE :: nindxc(:, :)
INTEGER, ALLOCATABLE :: lmaxc(:)
REAL, ALLOCATABLE :: core1(:,:,:,:), core2(:,:,:,:)
REAL, ALLOCATABLE :: eig_c(:,:,:)
INTEGER, ALLOCATABLE :: kveclo_eig(:,:)
REAL, ALLOCATABLE :: core1(:, :, :, :), core2(:, :, :, :)
REAL, ALLOCATABLE :: eig_c(:, :, :)
INTEGER, ALLOCATABLE :: kveclo_eig(:, :)
REAL, ALLOCATABLE :: sfac(:), fac(:)
REAL, ALLOCATABLE :: gauntarr(:,:,:,:,:,:)
REAL, ALLOCATABLE :: bas1(:,:,:,:), bas2(:,:,:,:)
REAL, ALLOCATABLE :: bas1_MT(:,:,:), drbas1_MT(:,:,:)
REAL, ALLOCATABLE :: prodm(:,:,:,:)
REAL, ALLOCATABLE :: gauntarr(:, :, :, :, :, :)
REAL, ALLOCATABLE :: bas1(:, :, :, :), bas2(:, :, :, :)
REAL, ALLOCATABLE :: bas1_MT(:, :, :), drbas1_MT(:, :, :)
REAL, ALLOCATABLE :: prodm(:, :, :, :)
REAL, ALLOCATABLE :: div_vv(:, :, :)
INTEGER, ALLOCATABLE :: pntgptd(:)
INTEGER, ALLOCATABLE :: pntgpt(:,:,:,:)
INTEGER, ALLOCATABLE :: nindxp1(:,:)
INTEGER, ALLOCATABLE :: pntgpt(:, :, :, :)
INTEGER, ALLOCATABLE :: nindxp1(:, :)
INTEGER, ALLOCATABLE :: ne_eig(:)
INTEGER, ALLOCATABLE :: nbands(:)
INTEGER, ALLOCATABLE :: nobd(:, :)
INTEGER :: maxlmindx = -1
COMPLEX, ALLOCATABLE :: stepfunc(:,:,:)
COMPLEX, ALLOCATABLE :: stepfunc(:, :, :)
INTEGER :: nbasp = -1
INTEGER :: maxbasm1 = -1
INTEGER :: eig_id = -1
INTEGER, ALLOCATABLE :: nbasm(:)
type(t_usdus) :: usdus
contains
procedure :: set_stepfunction => set_stepfunction
procedure :: free => free_hybdat
......@@ -47,43 +48,42 @@ contains
class(t_hybdat), intent(inout) :: hybdat
type(t_atoms), intent(in) :: atoms
type(t_hybinp), intent(in) :: hybinp
integer, intent(in) :: num_radfun_per_l(:,:)
integer, intent(in) :: num_radfun_per_l(:, :)
integer :: ok(12)
character(len=2000) :: error_message
ok = -1
allocate(hybdat%lmaxc(atoms%ntype),&
stat=ok(1), source=0)
allocate(hybdat%bas1(atoms%jmtd, maxval(num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype),&
stat=ok(2), source=0.0)
allocate(hybdat%bas2(atoms%jmtd, maxval(num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype),&
stat=ok(3), source=0.0)
allocate(hybdat%bas1_MT(maxval(num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype),&
stat=ok(4), source=0.0)
allocate(hybdat%drbas1_MT(maxval(num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype),&
stat=ok(5), source=0.0)
allocate(hybdat%lmaxc(atoms%ntype), &
stat=ok(1), source=0)
allocate(hybdat%bas1(atoms%jmtd, maxval(num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), &
stat=ok(2), source=0.0)
allocate(hybdat%bas2(atoms%jmtd, maxval(num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), &
stat=ok(3), source=0.0)
allocate(hybdat%bas1_MT(maxval(num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), &
stat=ok(4), source=0.0)
allocate(hybdat%drbas1_MT(maxval(num_radfun_per_l), 0:atoms%lmaxd, atoms%ntype), &
stat=ok(5), source=0.0)
! core allocs
allocate(hybdat%nindxc(0:hybdat%lmaxcd, atoms%ntype),&
allocate(hybdat%nindxc(0:hybdat%lmaxcd, atoms%ntype), &
stat=ok(6), source=0)
allocate(hybdat%core1(atoms%jmtd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype),&
allocate(hybdat%core1(atoms%jmtd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), &
stat=ok(7), source=0.0)
allocate(hybdat%core2(atoms%jmtd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype),&
allocate(hybdat%core2(atoms%jmtd, hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), &
stat=ok(8), source=0.0)
allocate(hybdat%eig_c(hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype),&
allocate(hybdat%eig_c(hybdat%maxindxc, 0:hybdat%lmaxcd, atoms%ntype), &
stat=ok(9), source=0.0)
allocate(hybdat%fac(0:hybdat%maxfac), stat=ok(10), source=0.0)
allocate(hybdat%sfac(0:hybdat%maxfac), stat=ok(11), source=0.0)
ALLOCATE(hybdat%gauntarr(2, 0:atoms%lmaxd, 0:atoms%lmaxd, 0:maxval(hybinp%lcutm1),&
-atoms%lmaxd:atoms%lmaxd, -maxval(hybinp%lcutm1):maxval(hybinp%lcutm1)),&
stat=ok(12), source=0.0)
ALLOCATE(hybdat%gauntarr(2, 0:atoms%lmaxd, 0:atoms%lmaxd, 0:maxval(hybinp%lcutm1), &
-atoms%lmaxd:atoms%lmaxd, -maxval(hybinp%lcutm1):maxval(hybinp%lcutm1)), &
stat=ok(12), source=0.0)
if(any(ok /= 0)) then
write (*,*) "allocation of hybdat failed. Error in array no.:"
write (*,*) maxloc(abs(ok))
write(*, *) "allocation of hybdat failed. Error in array no.:"
write(*, *) maxloc(abs(ok))
call juDFT_error("allocation of hybdat failed. Error in array no is the outfile")
endif
end subroutine allocate_hybdat
......@@ -111,24 +111,24 @@ contains
use m_types_atoms
use m_judft
implicit none
class(t_hybdat),INTENT(INOUT) :: hybdat
type(t_cell), INTENT(in) :: cell
class(t_hybdat), INTENT(INOUT) :: hybdat
type(t_cell), INTENT(in) :: cell
type(t_atoms), INTENT(in) :: atoms
integer, INTENT(in) :: g(3)
real, INTENT(in) :: svol
integer, INTENT(in) :: g(3)
real, INTENT(in) :: svol
integer :: i, j, k, ok
if (.not. allocated(hybdat%stepfunc)) then
if(.not. allocated(hybdat%stepfunc)) then
call timestart("setup stepfunction")
ALLOCATE (hybdat%stepfunc(-g(1):g(1), -g(2):g(2), -g(3):g(3)), stat=ok)
IF (ok /= 0) then
ALLOCATE(hybdat%stepfunc(-g(1):g(1), -g(2):g(2), -g(3):g(3)), stat=ok)
IF(ok /= 0) then
call juDFT_error('wavefproducts_inv5: error allocation stepfunc')
endif
DO i = -g(1), g(1)
DO j = -g(2), g(2)
DO k = -g(3), g(3)
hybdat%stepfunc(i,j,k) = stepfunction(cell, atoms, [i, j, k])/svol
hybdat%stepfunc(i, j, k) = stepfunction(cell, atoms,[i, j, k])/svol
END DO
END DO
END DO
......@@ -154,7 +154,7 @@ contains
gnorm = gptnorm(g, cell%bmat)
gnorm3 = gnorm**3
IF (abs(gnorm) < 1e-12) THEN
IF(abs(gnorm) < 1e-12) THEN
stepfunction = 1
DO itype = 1, atoms%ntype
stepfunction = stepfunction - atoms%neq(itype)*atoms%volmts(itype)/cell%omtil
......@@ -167,7 +167,7 @@ contains
fgr = fpi_const*(sin(r) - r*cos(r))/gnorm3/cell%omtil
DO ieq = 1, atoms%neq(itype)
icent = icent + 1
stepfunction = stepfunction - fgr*exp(-cmplx(0., tpi_const*dot_product(atoms%taual(:,icent), g)))
stepfunction = stepfunction - fgr*exp(-cmplx(0., tpi_const*dot_product(atoms%taual(:, icent), g)))
ENDDO
ENDDO
ENDIF
......@@ -180,8 +180,8 @@ contains
INTEGER, INTENT(IN) :: gpt(3)
REAL, INTENT(IN) :: bmat(3, 3)
gptnorm = norm2(matmul(gpt(:), bmat(:,:)))
gptnorm = norm2(matmul(gpt(:), bmat(:, :)))
END FUNCTION gptnorm
END MODULE m_types_hybdat
END MODULE m_types_hybdat
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