Commit 55719b61 authored by Daniel Wortmann's avatar Daniel Wortmann

Merge branch 'develop' of iffgit.fz-juelich.de:fleur/fleur into develop

parents 14d7c1c0 3d62903b
......@@ -152,7 +152,7 @@ CONTAINS
PRINT *,"TODO"
! STOP "TODO"
PRINT *,"BASIS:", lapw%nv(jsp), atoms%nlotot
IF (hybrid%l_addhf) CALL add_Vnonlocal(nk,hybrid,dimension,kpts,jsp,results,xcpot,hmat)
IF (hybrid%l_addhf) CALL add_Vnonlocal(nk,lapw,atoms,hybrid,dimension,kpts,jsp,results,xcpot,noco,hmat)
IF(hybrid%l_subvxc) THEN
CALL subvxc(lapw,kpts%bk(:,nk),DIMENSION,input,jsp,v%mt(:,0,:,:),atoms,ud,hybrid,enpara%el0,enpara%ello0,&
......
......@@ -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,hybrid,dimension,kpts,jsp,results,xcpot,hmat)
SUBROUTINE add_vnonlocal(nk,lapw,atoms,hybrid,dimension,kpts,jsp,results,xcpot,noco,hmat)
USE m_symm_hf, ONLY: symm_hf
USE m_util, ONLY: intgrf,intgrf_init
......@@ -61,22 +61,25 @@ MODULE m_add_vnonlocal
TYPE(t_dimension), INTENT(IN) :: dimension
TYPE(t_hybrid), INTENT(INOUT) :: hybrid
TYPE(t_kpts), INTENT(IN) :: kpts
TYPE(t_lapw), INTENT(IN) :: lapw
TYPE(t_atoms), INTENT(IN) :: atoms
TYPE(t_noco), INTENT(IN) :: noco
TYPE(t_mat), INTENT(INOUT) :: hmat
INTEGER, INTENT(IN) :: jsp
INTEGER, INTENT(IN) :: nk
! local scalars
INTEGER :: n,nn,iband
INTEGER :: n,nn,iband,nbasfcn
REAL :: a_ex
TYPE(t_mat) :: olap,tmp,v_x,z
COMPLEX :: exch(dimension%neigd,dimension%neigd)
! initialize weighting factor for HF exchange part
a_ex=xcpot%get_exchange_weight()
v_x%l_real=hmat%l_real
v_x%matsize1=dimension%nbasfcn
nbasfcn = MERGE(lapw%nv(1)+lapw%nv(2)+2*atoms%nlotot,lapw%nv(1)+atoms%nlotot,noco%l_noco)
CALL v_x%init(hmat%l_real,nbasfcn,nbasfcn)
CALL read_v_x(v_x,kpts%nkpt*(jsp-1) + nk)
! add non-local x-potential to the hamiltonian hmat
......@@ -101,12 +104,12 @@ MODULE m_add_vnonlocal
END IF
! read in lower triangle part of overlap matrix from direct acces file olap
CALL olap%alloc(hmat%l_real,dimension%nbasfcn)
CALL olap%init(hmat%l_real,nbasfcn,nbasfcn)
CALL read_olap(olap,kpts%nkpt*(jsp-1) + nk)
IF (.NOT.olap%l_real) olap%data_c=conjg(olap%data_c)
CALL z%alloc(olap%l_real,dimension%nbasfcn,dimension%neigd)
CALL z%init(olap%l_real,nbasfcn,dimension%neigd)
CALL read_z(z,nk) !what about spin?
WRITE(*,*) 'What about spin (in add_Vnonlocal)?'
......
......@@ -44,7 +44,7 @@
INTEGER :: j,m
INTEGER :: l
INTEGER :: lm,lm1
INTEGER :: n,nred
INTEGER :: n,nred, nbasfcn
REAL :: rdum,rdum1
REAL :: qnorm
......@@ -79,7 +79,9 @@
ALLOCATE(z(nkpti))
DO ikpt=1,nkpti
call z(ikpt)%alloc(sym%invs,dimension%nbasfcn,dimension%neigd)
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)
ENDDO
IF ( mpi%irank == 0 ) WRITE(6,'(//A)') '### checkolap ###'
......
......@@ -276,8 +276,8 @@ SUBROUTINE exchange_valence_hf(nk,kpts,nkpt_EIBZ,sym,atoms,hybrid,cell,dimension
IF (mat_ex%l_real) THEN
#ifdef CPP_IRAPPROX
CALL wavefproducts_inv(1,hybdat,dimension,jsp,atoms,lapw,obsolete,kpts,nk,ikpt0,&
mnobd,hybrid,parent,cell,sym,nkqpt,cprod_vv)
CALL wavefproducts_inv(1,hybdat,dimension,input,jsp,atoms,lapw,obsolete,kpts,nk,ikpt0,&
mnobd,hybrid,parent,cell,sym,noco,nkqpt,cprod_vv)
#else
CALL wavefproducts_inv5(1,hybrid%nbands(nk),ibando,ibando+psize-1,dimension,input,jsp,atoms,&
lapw,kpts,nk,ikpt0,hybdat,mnobd,hybrid,parent,cell,hybrid%nbasp,sym,&
......@@ -285,8 +285,8 @@ SUBROUTINE exchange_valence_hf(nk,kpts,nkpt_EIBZ,sym,atoms,hybrid,cell,dimension
#endif
ELSE
#ifdef CPP_IRAPPROX
CALL wavefproducts_noinv(1,hybdat,nk,ikpt0,dimension,jsp,cell,atoms,hybrid,
kpts,mnobd,lapw,sym,nkqpt,cprod_vv)
CALL wavefproducts_noinv(1,hybdat,nk,ikpt0,dimension,input,jsp,cell,atoms,hybrid,
kpts,mnobd,lapw,sym,noco,nkqpt,cprod_vv)
#else
CALL wavefproducts_noinv5(1,hybrid%nbands(nk),ibando,ibando+psize-1,nk,ikpt0,dimension,input,jsp,&!jsp,&
cell,atoms,hybrid,hybdat,kpts,mnobd,lapw,sym,hybrid%nbasp,noco,nkqpt,cprod_vv_c)
......@@ -374,6 +374,13 @@ SUBROUTINE exchange_valence_hf(nk,kpts,nkpt_EIBZ,sym,atoms,hybrid,cell,dimension
END DO !ibando
END DO !ikpt
! WRITE(7001,'(a,i7)') 'nk: ', nk
! DO n1=1,hybrid%nbands(nk)
! DO n2=1,n1
! WRITE(7001,'(2i7,2f15.8)') n2, n1, exch_vv(n2,n1)
! END DO
! END DO
! add contribution of the gamma point to the different cases (exch_vv,exch_cv,exch_cc)
! valence-valence-valence-valence exchange
......@@ -487,6 +494,13 @@ SUBROUTINE exchange_valence_hf(nk,kpts,nkpt_EIBZ,sym,atoms,hybrid,cell,dimension
calledby='exchange_val_hf.F90')
END IF
! WRITE(7000,'(a,i7)') 'nk: ', nk
! DO n1=1,hybrid%nbands(nk)
! DO n2=1,n1
! WRITE(7000,'(2i7,2f15.8)') n2, n1, exch_vv(n2,n1)
! END DO
! END DO
! write exch_vv in mat_ex
CALL mat_ex%alloc(matsize1=hybrid%nbands(nk))
IF (mat_ex%l_real) THEN
......
......@@ -283,7 +283,7 @@ CONTAINS
! write cmt at irreducible k-points in direct-access file cmt
CALL write_cmt(cmt,ikpt0)
CALL zhlp%alloc(zmat(1)%l_real,zmat(1)%matsize1,zmat(1)%matsize2)
CALL zhlp%alloc(zmat(ikpt0)%l_real,zmat(ikpt0)%matsize1,zmat(ikpt0)%matsize2)
IF (zhlp%l_real) THEN
zhlp%data_r = zmat(ikpt0)%data_r
......@@ -294,7 +294,7 @@ CONTAINS
! generate wavefunctions coefficients at all k-points from
! irreducible k-points
DO ikpt = 1, kpts%nkptf
IF ((kpts%bkp(ikpt).EQ.ikpt0).AND.(ikpt0.NE.ikpt)) THEN
iop = kpts%bksym(ikpt)
......
......@@ -89,7 +89,7 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
INTEGER :: ikpt,ikpt0
INTEGER :: irec
INTEGER :: irecl_olap,irecl_z,irecl_vx
INTEGER :: maxndb
INTEGER :: maxndb, nbasfcn
INTEGER :: nddb
INTEGER :: nsymop
INTEGER :: nkpt_EIBZ
......@@ -131,7 +131,8 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
END DO
! read in lower triangle part of overlap matrix from direct acces file olap
call olap%alloc(sym%invs,dimension%nbasfcn)
nbasfcn = MERGE(lapw%nv(1)+lapw%nv(2)+2*atoms%nlotot,lapw%nv(1)+atoms%nlotot,noco%l_noco)
call olap%alloc(sym%invs,nbasfcn)
call read_olap(olap, kpts%nkpt*(jsp-1) + nk)
if (.not.olap%l_real) olap%data_c=conjg(olap%data_c)
......@@ -193,7 +194,7 @@ SUBROUTINE hsfock(nk,atoms,hybrid,lapw,dimension,kpts,jsp,input,hybdat,eig_irr,s
IF(dimension%neigd.LT.hybrid%nbands(nk)) STOP 'mhsfock: neigd < nbands(nk) ; '&
'trafo from wavefunctions to APW requires at least nbands(nk) '
call z%alloc(olap%l_real,dimension%nbasfcn,dimension%neigd)
call z%alloc(olap%l_real,nbasfcn,dimension%neigd)
call read_z(z,nk) !what about spin?
! calculate trafo
......
......@@ -87,7 +87,13 @@ CONTAINS
l_real=mat%l_real
READ(id,rec=rec,iostat=err) matsize1,matsize2
if (matsize1<1) call judft_error("Data not found in file")
IF (mat%matsize1.NE.matsize1.OR.mat%matsize2.NE.matsize2) CALL mat%alloc(l_real,matsize1,matsize2)
IF (mat%matsize1.NE.matsize1.OR.mat%matsize2.NE.matsize2) THEN
WRITE(*,*) 'mat%matsize1 = ', mat%matsize1
WRITE(*,*) 'mat%matsize2 = ', mat%matsize2
WRITE(*,*) 'stored matsize1 = ', matsize1
WRITE(*,*) 'stored matsize2 = ', matsize2
CALL juDFT_error("matrix size wrong", calledby="read_matrix_DA")
END IF
IF (mat%l_real) THEN
READ(id,rec=rec,iostat=err) matsize1,matsize2,mat%data_r
ELSE
......
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