Commit 09b6c67a authored by Daniel Wortmann's avatar Daniel Wortmann

More fixes..

parent f10fd0f8
...@@ -49,6 +49,11 @@ CONTAINS ...@@ -49,6 +49,11 @@ CONTAINS
REAL, ALLOCATABLE :: rk_help(:) REAL, ALLOCATABLE :: rk_help(:)
INTEGER, ALLOCATABLE :: k_help(:,:) ,pos(:) INTEGER, ALLOCATABLE :: k_help(:,:) ,pos(:)
#endif #endif
IF (.not.allocated(lapw%k1)) THEN
ALLOCATE ( lapw%k1(DIMENSION%nvd,DIMENSION%jspd),lapw%k2(DIMENSION%nvd,DIMENSION%jspd),&
lapw%k3(DIMENSION%nvd,DIMENSION%jspd),lapw%rk(DIMENSION%nvd,DIMENSION%jspd) )
ENDIF
lapw%rk = 0 ; lapw%k1 = 0 ; lapw%k2 = 0 ; lapw%k3 = 0
! .. ! ..
! .. ! ..
!---> in a spin-spiral calculation different basis sets are used for !---> in a spin-spiral calculation different basis sets are used for
......
...@@ -82,7 +82,6 @@ CONTAINS ...@@ -82,7 +82,6 @@ CONTAINS
INTEGER nspins,isp,i,j,err INTEGER nspins,isp,i,j,err
INTEGER mlotot,mlolotot INTEGER mlotot,mlolotot
LOGICAL l_wu,l_file,l_real,l_zref LOGICAL l_wu,l_file,l_real,l_zref
INTEGER ::eig_id_hf=-1
! .. ! ..
! .. Local Arrays .. ! .. Local Arrays ..
...@@ -120,8 +119,7 @@ CONTAINS ...@@ -120,8 +119,7 @@ CONTAINS
call ud%init(atoms,DIMENSION%jspd) call ud%init(atoms,DIMENSION%jspd)
ALLOCATE ( nv2(DIMENSION%jspd) ) ALLOCATE ( nv2(DIMENSION%jspd) )
ALLOCATE ( eig(DIMENSION%neigd),bkpt(3) ) ALLOCATE ( eig(DIMENSION%neigd),bkpt(3) )
ALLOCATE ( lapw%k1(DIMENSION%nvd,DIMENSION%jspd),lapw%k2(DIMENSION%nvd,DIMENSION%jspd),&
lapw%k3(DIMENSION%nvd,DIMENSION%jspd),lapw%rk(DIMENSION%nvd,DIMENSION%jspd) )
! !
! --> some parameters first ! --> some parameters first
! !
...@@ -216,16 +214,14 @@ CONTAINS ...@@ -216,16 +214,14 @@ CONTAINS
IF (matsize<2) CALL judft_error("Wrong size of matrix",calledby="eigen",hint="Your basis might be too large or the parallelization fail or ??") IF (matsize<2) CALL judft_error("Wrong size of matrix",calledby="eigen",hint="Your basis might be too large or the parallelization fail or ??")
ne = MAX(5,DIMENSION%neigd) ne = MAX(5,DIMENSION%neigd)
IF (hybrid%l_hybrid.OR.hybrid%l_calhf) THEN IF (.not.hybrid%l_calhf) THEN
eig_id_hf=eig_id eig_id=open_eig(&
ENDIF
eig_id=open_eig(&
mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,kpts%nkpt,DIMENSION%jspd,atoms%lmaxd,& mpi%mpi_comm,DIMENSION%nbasfcn,DIMENSION%neigd,kpts%nkpt,DIMENSION%jspd,atoms%lmaxd,&
atoms%nlod,atoms%ntype,atoms%nlotot,noco%l_noco,.TRUE.,l_real,noco%l_soc,.FALSE.,& atoms%nlod,atoms%ntype,atoms%nlotot,noco%l_noco,.TRUE.,l_real,noco%l_soc,.FALSE.,&
mpi%n_size,layers=vacuum%layers,nstars=vacuum%nstars,ncored=DIMENSION%nstd,& mpi%n_size,layers=vacuum%layers,nstars=vacuum%nstars,ncored=DIMENSION%nstd,&
nsld=atoms%nat,nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,l_mcd=banddos%l_mcd,& nsld=atoms%nat,nat=atoms%nat,l_dos=banddos%dos.OR.input%cdinf,l_mcd=banddos%l_mcd,&
l_orb=banddos%l_orb) l_orb=banddos%l_orb)
endif
IF (l_real) THEN IF (l_real) THEN
ALLOCATE ( hamOvlp%a_r(matsize), stat = err ) ALLOCATE ( hamOvlp%a_r(matsize), stat = err )
ELSE ELSE
...@@ -270,7 +266,7 @@ CONTAINS ...@@ -270,7 +266,7 @@ CONTAINS
!---> loop over k-points: each can be a separate task !---> loop over k-points: each can be a separate task
DO jsp = 1,nspins DO jsp = 1,nspins
CALL eigen_HF_setup(hybrid,input,sym,kpts,dimension,atoms,mpi,noco,cell,oneD,results,jsp,eig_id_hf,& CALL eigen_HF_setup(hybrid,input,sym,kpts,dimension,atoms,mpi,noco,cell,oneD,results,jsp,eig_id,&
hybdat,irank2,it,l_real,vr0) hybdat,irank2,it,l_real,vr0)
! !
...@@ -331,7 +327,6 @@ CONTAINS ...@@ -331,7 +327,6 @@ CONTAINS
!---> set up lapw list !---> set up lapw list
! !
CALL timestart("Setup of LAPW") CALL timestart("Setup of LAPW")
lapw%rk = 0 ; lapw%k1 = 0 ; lapw%k2 = 0 ; lapw%k3 = 0
CALL apws(DIMENSION,input,noco, kpts,nk,cell,l_zref, mpi%n_size,jsp, bkpt,lapw,matind,nred) CALL apws(DIMENSION,input,noco, kpts,nk,cell,l_zref, mpi%n_size,jsp, bkpt,lapw,matind,nred)
CALL timestop("Setup of LAPW") CALL timestop("Setup of LAPW")
...@@ -359,7 +354,7 @@ CONTAINS ...@@ -359,7 +354,7 @@ CONTAINS
! !
IF( hybrid%l_hybrid ) THEN IF( hybrid%l_hybrid ) THEN
CALL hsfock(nk,atoms,hybrid,lapw,DIMENSION,kpts,kpts%nkpt,jsp,input,hybdat,eig_irr,& CALL hsfock(nk,atoms,hybrid,lapw,DIMENSION,kpts,jsp,input,hybdat,eig_irr,&
sym,cell,noco,results,it,maxval(hybdat%nobd),xcpot,& sym,cell,noco,results,it,maxval(hybdat%nobd),xcpot,&
mpi,irank2(nk),isize2(nk),comm(nk), hamovlp) mpi,irank2(nk),isize2(nk),comm(nk), hamovlp)
...@@ -508,7 +503,7 @@ ENDIF ...@@ -508,7 +503,7 @@ ENDIF
#ifdef CPP_MPI #ifdef CPP_MPI
CALL MPI_BARRIER(mpi%MPI_COMM,ierr) CALL MPI_BARRIER(mpi%MPI_COMM,ierr)
#endif #endif
IF (hybrid%l_hybrid.OR.hybrid%l_calhf) CALL close_eig(eig_id_hf) !IF (hybrid%l_hybrid.OR.hybrid%l_calhf) CALL close_eig(eig_id)
atoms%n_u=n_u_in atoms%n_u=n_u_in
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
! This file is part of FLEUR and available as free software under the conditions ! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail. ! of the MIT license as expressed in the LICENSE file in more detail.
!-------------------------------------------------------------------------------- !--------------------------------------------------------------------------------
MODULE m_types MODULE m_types
!************************************************************* !*************************************************************
! This module contains definitions for all kind of types ! This module contains definitions for all kind of types
...@@ -764,6 +764,15 @@ MODULE m_types ...@@ -764,6 +764,15 @@ MODULE m_types
REAL, ALLOCATABLE :: a_r(:), b_r(:) REAL, ALLOCATABLE :: a_r(:), b_r(:)
COMPLEX, ALLOCATABLE :: a_c(:), b_c(:) COMPLEX, ALLOCATABLE :: a_c(:), b_c(:)
END TYPE t_hamOvlp END TYPE t_hamOvlp
TYPE t_lapwmat
LOGICAL :: l_real
INTEGER :: matsize
REAL, ALLOCATABLE :: mat_r(:)
COMPLEX, ALLOCATABLE :: mat_c(:)
CONTAINS
PROCEDURE allocate_space =>t_lapwmat_allocate
END TYPE t_lapwmat
! !
! type for wannier-functions ! type for wannier-functions
! !
...@@ -937,4 +946,20 @@ CONTAINS ...@@ -937,4 +946,20 @@ CONTAINS
pd%vacxy=0.0 pd%vacxy=0.0
ENDIF ENDIF
END SUBROUTINE init_potden_simple END SUBROUTINE init_potden_simple
SUBROUTINE t_lapwmat_allocate(mat)
USE m_judft
IMPLICIT NONE
CLASS(t_lapwmat),INTENT(INOUT) :: mat
INTEGER:: err
IF (mat%l_real) THEN
if (allocated(mat%mat_r)) CALL juDFT_error("Matrix already allocated",hint="this is a bug in the code,please report")
allocate(mat%mat_r(mat%matsize),stat=err)
ELSE
if (allocated(mat%mat_c)) CALL juDFT_error("Matrix already allocated",hint="this is a bug in the code,please report")
allocate(mat%mat_c(mat%matsize),stat=err)
endif
IF (err>0) CALL judft_error("Not enough memory allocating a lapw-matrix")
end SUBROUTINE t_lapwmat_allocate
END MODULE m_types END MODULE m_types
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
rrot(:,:,isym) = transpose(sym%mrot(:,:,inviop)) rrot(:,:,isym) = transpose(sym%mrot(:,:,inviop))
DO l = 0,hybrid%maxlcutm1 DO l = 0,hybrid%maxlcutm1
dwgn(:,:,l,isym) = transpose( & dwgn(:,:,l,isym) = transpose( &
& sym%d_wgn(-hybrid%maxlcutm1:hybrid%maxlcutm1,-hybrid%maxlcutm1:hybrid%maxlcutm1,l,isym) ) & hybrid%d_wgn2(-hybrid%maxlcutm1:hybrid%maxlcutm1,-hybrid%maxlcutm1:hybrid%maxlcutm1,l,isym) )
END DO END DO
ELSE ELSE
inviop = isym - sym%nop inviop = isym - sym%nop
...@@ -339,8 +339,8 @@ ...@@ -339,8 +339,8 @@
nsym1(ikpt) = isym1 nsym1(ikpt) = isym1
END DO END DO
! Define reduced lists of G points -> pgptm1(:,ikpt), ikpt=1,..,nkpt ! Define reduced lists of G points -> pgptm1(:,ikpt), ikpt=1,..,nkpt
ALLOCATE ( hybrid%pgptm1(hybrid%maxgptm,kpts%nkpt),iarr(hybrid%maxgptm),& !ALLOCATE ( hybrid%pgptm1(hybrid%maxgptm,kpts%nkpt)) !in mixedbasis
& pointer(kpts%nkpt,& ALLOCATE (iarr(hybrid%maxgptm), pointer(kpts%nkpt,&
& minval(hybrid%gptm(1,:))-1:maxval(hybrid%gptm(1,:))+1,& & minval(hybrid%gptm(1,:))-1:maxval(hybrid%gptm(1,:))+1,&
& minval(hybrid%gptm(2,:))-1:maxval(hybrid%gptm(2,:))+1,& & minval(hybrid%gptm(2,:))-1:maxval(hybrid%gptm(2,:))+1,&
& minval(hybrid%gptm(3,:))-1:maxval(hybrid%gptm(3,:))+1)) & minval(hybrid%gptm(3,:))-1:maxval(hybrid%gptm(3,:))+1))
...@@ -1296,7 +1296,7 @@ ...@@ -1296,7 +1296,7 @@
ALLOCATE( olapm(hybrid%ngptm(ikpt),hybrid%ngptm(ikpt)) ) ALLOCATE( olapm(hybrid%ngptm(ikpt),hybrid%ngptm(ikpt)) )
olapm = 0 olapm = 0
CALL olap_pw(olapm,hybrid%gptm(:hybrid%ngptm(ikpt),ikpt),hybrid%ngptm(ikpt), atoms,cell ) CALL olap_pw(olapm,hybrid%gptm(:,hybrid%pgptm(:hybrid%ngptm(ikpt),ikpt)),hybrid%ngptm(ikpt), atoms,cell )
! !calculate eigenvalues of olapm ! !calculate eigenvalues of olapm
! ALLOCATE( eval(ngptm(ikpt)),evec(ngptm(ikpt),ngptm(ikpt)) ) ! ALLOCATE( eval(ngptm(ikpt)),evec(ngptm(ikpt),ngptm(ikpt)) )
......
...@@ -30,7 +30,7 @@ CONTAINS ...@@ -30,7 +30,7 @@ CONTAINS
TYPE(t_hybdat),INTENT(INOUT):: hybdat TYPE(t_hybdat),INTENT(INOUT):: hybdat
INTEGER:: ok,nk,nrec1,i,j,bands,ll,l1,l2,ng,itype,n,l,n1,n2,nn INTEGER:: ok,nk,nrec1,i,j,ll,l1,l2,ng,itype,n,l,n1,n2,nn
TYPE(t_zmat),ALLOCATABLE :: zmat(:) TYPE(t_zmat),ALLOCATABLE :: zmat(:)
...@@ -51,7 +51,7 @@ CONTAINS ...@@ -51,7 +51,7 @@ CONTAINS
! !
CALL timestart("gen_bz and gen_wavf") CALL timestart("gen_bz and gen_wavf")
ALLOCATE(zmat(kpts%nkpt)) ALLOCATE(zmat(kpts%nkptf),stat=ok)
IF( ok .NE. 0 ) STOP 'eigen_hf: failure allocation z_c' IF( ok .NE. 0 ) STOP 'eigen_hf: failure allocation z_c'
ALLOCATE ( eig_irr(DIMENSION%neigd2,kpts%nkpt) ,stat=ok ) ALLOCATE ( eig_irr(DIMENSION%neigd2,kpts%nkpt) ,stat=ok )
IF( ok .NE. 0 ) STOP'eigen_hf: failure allocation eig_irr' IF( ok .NE. 0 ) STOP'eigen_hf: failure allocation eig_irr'
...@@ -74,8 +74,10 @@ CONTAINS ...@@ -74,8 +74,10 @@ CONTAINS
else else
ALLOCATE(zmat(nk)%z_c(dimension%nbasfcn,dimension%neigd2)) ALLOCATE(zmat(nk)%z_c(dimension%nbasfcn,dimension%neigd2))
endif endif
print *,"eigen_HF_Setup: read_eig:",nk
print *,zmat(nk)%nbasfcn,zmat(nk)%nbands,hybdat%ne_eig(nk)
CALL read_eig(eig_id_hf,nk,jsp,el=el_eig,ello=ello_eig, neig=hybdat%ne_eig(nk),eig=eig_irr(:,nk), kveclo=hybdat%kveclo_eig(:,nk),zmat=zmat(nk)) !TODO introduce zmat!!,z=z_irr(:,:,nk)) CALL read_eig(eig_id_hf,nk,jsp,el=el_eig,ello=ello_eig, neig=hybdat%ne_eig(nk),eig=eig_irr(:,nk), kveclo=hybdat%kveclo_eig(:,nk),zmat=zmat(nk)) !TODO introduce zmat!!,z=z_irr(:,:,nk))
print *,"Done"
END DO END DO
...@@ -114,7 +116,7 @@ CONTAINS ...@@ -114,7 +116,7 @@ CONTAINS
! set the size of the exchange matrix in the space of the wavefunctions ! set the size of the exchange matrix in the space of the wavefunctions
hybdat%nbands(nk)=bands hybdat%nbands(nk)=hybrid%bands1
IF(hybdat%nbands(nk).GT.hybdat%ne_eig(nk)) THEN IF(hybdat%nbands(nk).GT.hybdat%ne_eig(nk)) THEN
IF ( mpi%irank == 0 ) THEN IF ( mpi%irank == 0 ) THEN
WRITE(*,*) ' maximum for hybdat%nbands is', hybdat%ne_eig(nk) WRITE(*,*) ' maximum for hybdat%nbands is', hybdat%ne_eig(nk)
...@@ -290,7 +292,7 @@ CONTAINS ...@@ -290,7 +292,7 @@ CONTAINS
DEALLOCATE ( eig_irr , hybdat%kveclo_eig ) DEALLOCATE ( eig_irr , hybdat%kveclo_eig )
hybrid%maxlmindx = MAXVAL((/ ( SUM( (/ (hybrid%nindx(l,itype)*(2*l+1), l=0,atoms%lmax(itype)) /) ),itype=1,atoms%ntype) /) ) hybrid%maxlmindx = MAXVAL((/ ( SUM( (/ (hybrid%nindx(l,itype)*(2*l+1), l=0,atoms%lmax(itype)) /) ),itype=1,atoms%ntype) /) )
hybdat%nbands = MIN( bands, DIMENSION%neigd ) hybdat%nbands = MIN( hybrid%bands1, DIMENSION%neigd )
ENDIF ! hybrid%l_calhf ENDIF ! hybrid%l_calhf
END SUBROUTINE eigen_hf_setup END SUBROUTINE eigen_hf_setup
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
CONTAINS CONTAINS
SUBROUTINE exchange_vccv(& SUBROUTINE exchange_vccv(&
& nk,bkpt,kpts,nkpti,atoms,& & nk,atoms,&
& hybrid,hybdat,& & hybrid,hybdat,&
& dimension,jsp,lapw,& & dimension,jsp,lapw,&
& maxbands,mnobd,mpi,irank2,& & maxbands,mnobd,mpi,irank2,&
...@@ -40,22 +40,20 @@ ...@@ -40,22 +40,20 @@
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: dimension TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(IN) :: hybrid TYPE(t_hybrid),INTENT(IN) :: hybrid
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_lapw),INTENT(IN) :: lapw TYPE(t_lapw),INTENT(IN) :: lapw
! -scalars - ! -scalars -
INTEGER,INTENT(IN) :: jsp INTEGER,INTENT(IN) :: jsp
INTEGER,INTENT(IN) ::nk ,maxbands, mnobd INTEGER,INTENT(IN) ::nk ,maxbands, mnobd
INTEGER,INTENT(IN) :: nkpti ,irank2 INTEGER,INTENT(IN) :: irank2
! - arays - ! - arays -
INTEGER,INTENT(IN) :: degenerat(hybdat%ne_eig(nk)) INTEGER,INTENT(IN) :: degenerat(hybdat%ne_eig(nk))
REAL,INTENT(IN) :: bkpt(3)
#ifdef CPP_INVERSION #ifdef CPP_INVERSION
REAL ,INTENT(INOUT) :: ex_vv(maxbands,mnobd,nkpti) REAL ,INTENT(INOUT) :: ex_vv(:,:,:)!(maxbands,mnobd,nkpti)
#else #else
COMPLEX ,INTENT(INOUT) :: ex_vv(maxbands,mnobd,nkpti) COMPLEX ,INTENT(INOUT) :: ex_vv(:,:,:)!(maxbands,mnobd,nkpti)
#endif #endif
LOGICAL :: symequivalent(count(degenerat .ge. 1),& LOGICAL :: symequivalent(count(degenerat .ge. 1),&
& count(degenerat .ge. 1)) & count(degenerat .ge. 1))
...@@ -251,7 +249,7 @@ ...@@ -251,7 +249,7 @@
END SUBROUTINE exchange_vccv END SUBROUTINE exchange_vccv
SUBROUTINE exchange_vccv1(nk,kpts,nkpti,atoms,& SUBROUTINE exchange_vccv1(nk,atoms,&
& hybrid,hybdat,& & hybrid,hybdat,&
& dimension,jsp,& & dimension,jsp,&
& lapw,& & lapw,&
...@@ -270,14 +268,12 @@ ...@@ -270,14 +268,12 @@
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: dimension TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(IN) :: hybrid TYPE(t_hybrid),INTENT(IN) :: hybrid
TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_lapw),INTENT(IN) :: lapw TYPE(t_lapw),INTENT(IN) :: lapw
! -scalars - ! -scalars -
INTEGER,INTENT(IN) :: jsp INTEGER,INTENT(IN) :: jsp
INTEGER,INTENT(IN) :: nk INTEGER,INTENT(IN) :: nk
INTEGER,INTENT(IN) :: nkpti
INTEGER,INTENT(IN) :: nsymop INTEGER,INTENT(IN) :: nsymop
REAL,INTENT(IN) :: a_ex REAL,INTENT(IN) :: a_ex
! - arays - ! - arays -
...@@ -445,7 +441,7 @@ ...@@ -445,7 +441,7 @@
END SUBROUTINE exchange_vccv1 END SUBROUTINE exchange_vccv1
SUBROUTINE exchange_cccc(nk,nkpti,atoms,hybdat, ncstd,& SUBROUTINE exchange_cccc(nk,atoms,hybdat, ncstd,&
sym,kpts,a_ex,mpi, results) sym,kpts,a_ex,mpi, results)
...@@ -464,7 +460,7 @@ ...@@ -464,7 +460,7 @@
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
! - scalars - ! - scalars -
INTEGER,INTENT(IN) :: nk,nkpti ,ncstd INTEGER,INTENT(IN) :: nk, ncstd
REAL ,INTENT(IN) :: a_ex REAL ,INTENT(IN) :: a_ex
...@@ -593,7 +589,7 @@ ...@@ -593,7 +589,7 @@
END SUBROUTINE exchange_cccc END SUBROUTINE exchange_cccc
SUBROUTINE exchange_cccv( & SUBROUTINE exchange_cccv( &
& nk,nkpti,atoms,hybdat,& & nk,atoms,hybdat,&
& hybrid,dimension,maxbands,ncstd,& & hybrid,dimension,maxbands,ncstd,&
& bkpt,sym,mpi,& & bkpt,sym,mpi,&
& exch_cv ) & exch_cv )
...@@ -613,15 +609,15 @@ ...@@ -613,15 +609,15 @@
TYPE(t_sym),INTENT(IN) :: sym TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
! - scalars - ! - scalars -
INTEGER,INTENT(IN) :: nk,nkpti ,ncstd INTEGER,INTENT(IN) :: nk ,ncstd
INTEGER,INTENT(IN) :: maxbands INTEGER,INTENT(IN) :: maxbands
! - arays - ! - arays -
REAL ,INTENT(IN) :: bkpt(3) REAL ,INTENT(IN) :: bkpt(3)
#ifdef CPP_INVERSION #ifdef CPP_INVERSION
REAL ,INTENT(INOUT) :: exch_cv(maxbands,ncstd,nkpti) REAL ,INTENT(INOUT) :: exch_cv(:,:,:)!(maxbands,ncstd,nkpti)
#else #else
COMPLEX,INTENT(INOUT) :: exch_cv(maxbands,ncstd,nkpti) COMPLEX,INTENT(INOUT) :: exch_cv(:,:,:) !(maxbands,ncstd,nkpti)
#endif #endif
! - local scalars - ! - local scalars -
INTEGER :: itype,ieq,icst,icst1,icst2,iatom,iatom0,& INTEGER :: itype,ieq,icst,icst1,icst2,iatom,iatom0,&
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
CONTAINS CONTAINS
SUBROUTINE exchange_valence_hf(& SUBROUTINE exchange_valence_hf(&
nk,kpts,nkpti,nkpt_EIBZ, sym,atoms,hybrid,& nk,kpts,nkpt_EIBZ, sym,atoms,hybrid,&
cell, dimension,input,jsp, hybdat, mnobd, lapw,& cell, dimension,input,jsp, hybdat, mnobd, lapw,&
eig_irr,results,parent,pointer_EIBZ,n_q,wl_iks,& eig_irr,results,parent,pointer_EIBZ,n_q,wl_iks,&
it,xcpot, noco,nsest,indx_sest,& it,xcpot, noco,nsest,indx_sest,&
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
! - scalars - ! - scalars -
INTEGER,INTENT(IN) :: it ,irank2 ,isize2,comm INTEGER,INTENT(IN) :: it ,irank2 ,isize2,comm
INTEGER,INTENT(IN) :: jsp INTEGER,INTENT(IN) :: jsp
INTEGER,INTENT(IN) :: nk ,nkpti ,nkpt_EIBZ INTEGER,INTENT(IN) :: nk ,nkpt_EIBZ
INTEGER,INTENT(IN) :: mnobd INTEGER,INTENT(IN) :: mnobd
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
INTEGER,INTENT(IN) :: nsest(hybdat%nbands(nk)),indx_sest(hybdat%nbands(nk),hybdat%nbands(nk)) INTEGER,INTENT(IN) :: nsest(hybdat%nbands(nk)),indx_sest(hybdat%nbands(nk),hybdat%nbands(nk))
REAL ,INTENT(IN) :: eig_irr(dimension%neigd,nkpti) REAL ,INTENT(IN) :: eig_irr(dimension%neigd,kpts%nkpt)
REAL ,INTENT(IN) :: wl_iks(dimension%neigd,kpts%nkptf) REAL ,INTENT(IN) :: wl_iks(dimension%neigd,kpts%nkptf)
REAL ,INTENT(OUT) :: div_vv(hybdat%nbands(nk)) REAL ,INTENT(OUT) :: div_vv(hybdat%nbands(nk))
...@@ -377,14 +377,14 @@ ...@@ -377,14 +377,14 @@
#ifdef CPP_IRAPPROX #ifdef CPP_IRAPPROX
CALL wavefproducts_inv(& CALL wavefproducts_inv(&
1,hybdat,dimension,jsp,atoms,& 1,hybdat,dimension,jsp,atoms,&
lapw,obsolete,nkpti,kpts,kpts,nkpt_EIBZ,& lapw,obsolete,kpts,&
nk,ikpt0,mnobd,hybrid, parent,cell, sym,& nk,ikpt0,mnobd,hybrid, parent,cell, sym,&
time_mt,time_ir,nkqpt,cprod_vv) time_mt,time_ir,nkqpt,cprod_vv)
#else #else
CALL wavefproducts_inv5(& CALL wavefproducts_inv5(&
1,hybdat,ibando,ibando+psize-1,& 1,hybdat,ibando,ibando+psize-1,&
dimension,input,jsp,atoms,& dimension,input,jsp,atoms,&
lapw,obsolete,nkpti,kpts,kpts,nkpt_EIBZ,& lapw,obsolete,kpts,&
nk,ikpt0,mnobd,hybrid,& nk,ikpt0,mnobd,hybrid,&
parent,cell, sym,& parent,cell, sym,&
noco,noco,& noco,noco,&
...@@ -424,7 +424,7 @@ ...@@ -424,7 +424,7 @@
IF ( xcpot%icorr == icorr_hse .OR. xcpot%icorr == icorr_vhse ) THEN IF ( xcpot%icorr == icorr_hse .OR. xcpot%icorr == icorr_vhse ) THEN
iband1 = hybdat%nobd(nkqpt) iband1 = hybdat%nobd(nkqpt)
exch_vv = exch_vv + dynamic_hse_adjustment(& exch_vv = exch_vv + dynamic_hse_adjustment(&
atoms%rmsh,atoms%rmt,atoms%dx,atoms%jri,atoms%jmtd,kpts%bk(:,ikpt0),ikpt0,kpts%nkptf,& atoms%rmsh,atoms%rmt,atoms%dx,atoms%jri,atoms%jmtd,kpts%bkf(:,ikpt0),ikpt0,kpts%nkptf,&
cell%bmat,vol,atoms%ntype,atoms%neq,atoms%nat,atoms%taual,hybrid%lcutm1,hybrid%maxlcutm1,& cell%bmat,vol,atoms%ntype,atoms%neq,atoms%nat,atoms%taual,hybrid%lcutm1,hybrid%maxlcutm1,&
hybrid%nindxm1,hybrid%maxindxm1,hybrid%gptm,hybrid%ngptm(ikpt0),hybrid%pgptm(:,ikpt0),& hybrid%nindxm1,hybrid%maxindxm1,hybrid%gptm,hybrid%ngptm(ikpt0),hybrid%pgptm(:,ikpt0),&
hybrid%gptmd,hybrid%basm1,hybdat%nbasm(ikpt0),iband1,hybdat%nbands(nk),nsest,& hybrid%gptmd,hybrid%basm1,hybdat%nbasm(ikpt0),iband1,hybdat%nbands(nk),nsest,&
...@@ -545,7 +545,7 @@ ...@@ -545,7 +545,7 @@
IF( zero_order ) THEN IF( zero_order ) THEN
CALL dwavefproducts( & CALL dwavefproducts( &
dcprod,nk,1,hybdat%nbands(nk),1,hybdat%nbands(nk),.false., atoms,hybrid,& dcprod,nk,1,hybdat%nbands(nk),1,hybdat%nbands(nk),.false., atoms,hybrid,&
cell,hybdat, kpts,nkpti,lapw,& cell,hybdat, kpts,kpts%nkpt,lapw,&
dimension,jsp,& dimension,jsp,&
eig_irr ) eig_irr )
...@@ -563,7 +563,7 @@ ...@@ -563,7 +563,7 @@
nk,atoms,& nk,atoms,&
dimension,input,jsp,& dimension,input,jsp,&
hybdat,hybrid,& hybdat,hybrid,&
lapw,kpts,nkpti,& lapw,kpts,kpts%nkpt,&
cell,mnobd,& cell,mnobd,&
sym,& sym,&
proj_ibsc,olap_ibsc) proj_ibsc,olap_ibsc)
...@@ -643,10 +643,10 @@ ...@@ -643,10 +643,10 @@
! Calculate distances from the eight reciprocal unit-cell corners ! Calculate distances from the eight reciprocal unit-cell corners
knorm = k0 knorm = k0
DO i = 1,8 DO i = 1,8
rdum=sqrt(sum(matmul(kpts%bk(:,ikpt)-kcorner(:,i),cell%bmat)**2)) rdum=sqrt(sum(matmul(kpts%bkf(:,ikpt)-kcorner(:,i),cell%bmat)**2))
IF(rdum.lt.k0) THEN IF(rdum.lt.k0) THEN
knorm = rdum knorm = rdum
kvec = ( kpts%bk(:,ikpt) - kcorner(:,i) ) / knorm kvec = ( kpts%bkf(:,ikpt) - kcorner(:,i) ) / knorm
END IF END IF
END DO END DO
......
...@@ -137,9 +137,10 @@ ...@@ -137,9 +137,10 @@
TYPE(t_lapw) :: lapw TYPE(t_lapw) :: lapw
TYPE(t_usdus):: usdus TYPE(t_usdus):: usdus
CALL CPU_TIME(time1)
CALL CPU_TIME(time1)
call usdus%init(atoms,dimension%jspd)
! setup rotations in reciprocal space ! setup rotations in reciprocal space
DO iop=1,sym%nsym DO iop=1,sym%nsym
IF( iop .le. sym%nop ) THEN IF( iop .le. sym%nop ) THEN
......
...@@ -20,8 +20,8 @@ MODULE m_hsfock ...@@ -20,8 +20,8 @@ MODULE m_hsfock
! | calculate valence-core contribution c ! | calculate valence-core contribution c
! c ! c
! variables: c ! variables: c
! nkptf := number of kpoints c ! kpts%nkptf := number of kpoints c
! nkpti := number of irreducible kpoints c ! kpts%nkpt := number of irreducible kpoints c
! nbands := number of bands for which the exchange matrix (mat_ex) c ! nbands := number of bands for which the exchange matrix (mat_ex) c
! in the space of the wavefunctions is calculated c ! in the space of the wavefunctions is calculated c
! te_hfex := hf exchange contribution to the total energy c ! te_hfex := hf exchange contribution to the total energy c
...@@ -38,7 +38,7 @@ MODULE m_hsfock ...@@ -38,7 +38,7 @@ MODULE m_hsfock
SUBROUTINE hsfock(& SUBROUTINE hsfock(&
& nk,atoms,hybrid,lapw,dimension,& & nk,atoms,hybrid,lapw,dimension,&
& kpts,nkpti,jsp,input,& & kpts,jsp,input,&
& hybdat,& & hybdat,&
& eig_irr,sym,& & eig_irr,sym,&
& cell,noco,& & cell,noco,&
...@@ -59,30 +59,30 @@ MODULE m_hsfock ...@@ -59,30 +59,30 @@ MODULE m_hsfock
USE m_icorrkeys USE m_icorrkeys
USE m_types USE m_types
IMPLICIT NONE IMPLICIT NONE
TYPE(t_hybdat),INTENT(IN) :: hybdat TYPE(t_hybdat),INTENT(IN) :: hybdat
TYPE(t_results),INTENT(INOUT) :: results TYPE(t_results),INTENT(INOUT) :: results
TYPE(t_xcpot),INTENT(IN) :: xcpot TYPE(t_xcpot),INTENT(IN) :: xcpot
TYPE(t_mpi),INTENT(IN) :: mpi TYPE(t_mpi),INTENT(IN) :: mpi
TYPE(t_dimension),INTENT(IN) :: dimension TYPE(t_dimension),INTENT(IN) :: dimension
TYPE(t_hybrid),INTENT(INOUT) :: hybrid TYPE(t_hybrid),INTENT(INOUT) :: hybrid
TYPE(t_input),INTENT(IN) :: input TYPE(t_input),INTENT(IN) :: input
TYPE(t_noco),INTENT(IN) :: noco TYPE(t_noco),INTENT(IN) :: noco
TYPE(t_sym),INTENT(IN) :: sym TYPE(t_sym),INTENT(IN) :: sym
TYPE(t_cell),INTENT(IN) :: cell TYPE(t_cell),INTENT(IN) :: cell
TYPE(t_kpts),INTENT(IN) :: kpts TYPE(t_kpts),INTENT(IN) :: kpts
TYPE(t_atoms),INTENT(IN) :: atoms TYPE(t_atoms),INTENT(IN) :: atoms
TYPE(t_lapw),INTENT(IN) :: lapw TYPE(t_lapw),INTENT(IN) :: lapw
! - scalars - ! - scalars -
INTEGER,INTENT(IN) :: jsp INTEGER,INTENT(IN) :: jsp
INTEGER,INTENT(IN) :: it INTEGER,INTENT(IN) :: it
INTEGER,INTENT(IN) :: irank2 ,isize2,comm INTEGER,INTENT(IN) :: irank2 ,isize2,comm
INTEGER,INTENT(IN) :: nkpti ,nk INTEGER,INTENT(IN) :: nk
INTEGER,INTENT(IN) :: mnobd INTEGER,INTENT(IN) :: mnobd
! - arrays - ! - arrays -
REAL,INTENT(IN) :: eig_irr(dimension%neigd,nkpti) REAL,INTENT(IN) :: eig_irr(dimension%neigd,kpts%nkpt)
TYPE(t_hamovlp),INTENT(INOUT)::hamovlp TYPE(t_hamovlp),INTENT(INOUT)::hamovlp
#if ( !defined(CPP_INVERSION) ) #if ( !defined(CPP_INVERSION) )
...@@ -184,7 +184,7 @@ MODULE m_hsfock ...@@ -184,7 +184,7 @@ MODULE m_hsfock
#else