Commit 8ea58cfa authored by Daniel Wortmann's avatar Daniel Wortmann

Fixed initializations of variables

parent c3d29487
......@@ -222,9 +222,11 @@ CONTAINS
WRITE (*,*) 'the Hamilton Matrix: ',err,' size: ',matsize
CALL juDFT_error("eigen: Error during allocation of Hamilton" //"matrix",calledby ="eigen")
ENDIF
IF (l_real) THEN
IF (l_real) THEN
ALLOCATE ( hamOvlp%b_c(0))
ALLOCATE ( hamOvlp%b_r(matsize), stat = err )
ELSE
ELSE
ALLOCATE ( hamOvlp%b_r(0))
ALLOCATE ( hamOvlp%b_c(matsize), stat = err )
ENDIF
......
......@@ -431,6 +431,7 @@ MODULE m_types
REAL ,ALLOCATABLE :: basm1(:,:,:,:)
COMPLEX,ALLOCATABLE :: d_wgn2(:,:,:,:)
INTEGER,ALLOCATABLE :: ne_eig(:),nbands(:),nobd(:) !alloc in eigen_HF_init
REAL ,ALLOCATABLE :: div_vv(:,:,:)
END TYPE t_hybrid
TYPE prodtype
......
......@@ -36,9 +36,11 @@ module m_types_rcmat
IF (mat%l_real) THEN
ALLOCATE(mat%data_r(mat%matsize1,mat%matsize2),STAT=err)
ALLOCATE(mat%data_c(0,0))
mat%data_r=0.0
ELSE
ALLOCATE(mat%data_r(0,0))
ALLOCATE(mat%data_c(mat%matsize1,mat%matsize2),STAT=err)
mat%data_c=0.0
ENDIF
IF (err>0) CALL judft_error("Allocation of memmory failed for mat datatype",hint="You probably run out of memory")
......
......@@ -68,8 +68,6 @@ MODULE m_add_vnonlocal
INTEGER :: iband
REAL :: a_ex
! - local arrays -
REAL :: div_vv(hybrid%nbands(nk))
TYPE(t_mat) :: olap,tmp,v_x,z
COMPLEX :: exch(dimension%neigd,dimension%neigd)
......@@ -102,7 +100,7 @@ MODULE m_add_vnonlocal
IF( hybrid%l_calhf ) THEN
WRITE(6,'(A)') new_line('n')//new_line('n')//' ### '// ' diagonal HF exchange elements (eV) ###'
WRITE(6,'(A)') new_line('n') // ' k-point '// 'band tail pole input%total(valence+core)'
WRITE(6,'(A)') new_line('n') // ' k-point '// 'band tail pole total(valence+core)'
END IF
......@@ -117,7 +115,7 @@ MODULE m_add_vnonlocal
! calculate exchange contribution of current k-point nk to total energy (te_hfex)
! in the case of a spin-unpolarized calculation the factor 2 is added in eigen_hf.F TODO
! in the case of a spin-unpolarized calculation the factor 2 is added in eigen.F90
if (.not.v_x%l_real) v_x%data_c=conjg(v_x%data_c)
exch = 0
print *,"sizes:",shape(z%data_r),shape(v_x%data_r)
......@@ -133,8 +131,8 @@ MODULE m_add_vnonlocal
END IF
IF(hybrid%l_calhf) THEN
WRITE(6, '( '' ('',F5.3,'','',F5.3,'','',F5.3,'')'',I4,4X,3F10.5)')&
& kpts%bkf(:,nk),iband, (REAL(exch(iband,iband))-div_vv(iband))*(-27.211608),&
& div_vv(iband)*(-27.211608),REAL(exch(iband,iband))*(-27.211608)
& kpts%bkf(:,nk),iband, (REAL(exch(iband,iband))-hybrid%div_vv(iband,nk,jsp))*(-27.211608),&
& hybrid%div_vv(iband,nk,jsp)*(-27.211608),REAL(exch(iband,iband))*(-27.211608)
END IF
END DO
......
......@@ -54,7 +54,7 @@
cell, dimension,input,jsp, hybdat, mnobd, lapw,&
eig_irr,results,parent,pointer_EIBZ,n_q,wl_iks,&
it,xcpot, noco,nsest,indx_sest,&
mpi,irank2,isize2,comm, div_vv,mat_ex)
mpi,irank2,isize2,comm,mat_ex)
USE m_wrapper
......@@ -106,8 +106,7 @@
REAL ,INTENT(IN) :: eig_irr(dimension%neigd,kpts%nkpt)
REAL ,INTENT(IN) :: wl_iks(dimension%neigd,kpts%nkptf)
REAL ,INTENT(OUT) :: div_vv(hybrid%nbands(nk))
TYPE(t_mat),INTENT(INOUT):: mat_ex
! - local scalars -
......@@ -250,11 +249,11 @@
! read in coulomb matrix from direct access file coulomb
#if( !defined CPP_NOSPMVEC && !defined CPP_IRAPPROX )
if (mat_ex%l_real) THEN
call read_coulomb_spm_r(kpts%bkp(ikpt0),coulomb_mt1,coulomb_mt2_r,coulomb_mt3_r,coulomb_mtir_r)
else
call read_coulomb_spm_c(kpts%bkp(ikpt0),coulomb_mt1,coulomb_mt2_c,coulomb_mt3_c,coulomb_mtir_c)
end if
IF (mat_ex%l_real) THEN
CALL read_coulomb_spm_r(kpts%bkp(ikpt0),coulomb_mt1,coulomb_mt2_r,coulomb_mt3_r,coulomb_mtir_r)
ELSE
CALL read_coulomb_spm_c(kpts%bkp(ikpt0),coulomb_mt1,coulomb_mt2_c,coulomb_mt3_c,coulomb_mtir_c)
END IF
#else
call read_coulomb(kpts%bkp(ikpt0),coulomb)
#endif
......@@ -533,15 +532,13 @@ endif
! due to the symmetrization afterwards the factor 1/n_q(1) must be added
IF( n1 .eq. nn2 ) div_vv(n1) = real(cdum2)
IF( n1 .EQ. nn2 ) hybrid%div_vv(n1,nk,jsp) = REAL(cdum2)
exch_vv(nn2,n1) = exch_vv(nn2,n1) + (exch0 + cdum2)/n_q(1)
END DO !n2
END DO !n1
ELSE
div_vv = 0.
END IF ! xcpot%icorr .ne. icorr_hse
END IF ! xcpot%icorr .ne. icorr_hse
if (.not.mat_ex%l_real) THEN
......
......@@ -77,11 +77,8 @@ CONTAINS
ALLOCATE(zmat(nk)%z_c(dimension%nbasfcn,dimension%neigd2))
ALLOCATE(zmat(nk)%z_r(0,0))
endif
print *,"eigen_HF_Setup: read_eig:",nk
print *,zmat(nk)%nbasfcn,zmat(nk)%nbands,hybrid%ne_eig(nk)
CALL read_eig(eig_id_hf,nk,jsp,el=el_eig,ello=ello_eig, neig=hybrid%ne_eig(nk),eig=eig_irr(:,nk), w_iks=results%w_iks(:,nk,jsp),kveclo=hybdat%kveclo_eig(:,nk),zmat=zmat(nk))
print *,"Done"
END DO
!Allocate further space
DO nk=kpts%nkpt+1,kpts%nkptf
......
......@@ -112,8 +112,7 @@ MODULE m_hsfock
INTEGER,ALLOCATABLE :: n_q(:)
REAL :: wl_iks(dimension%neigd,kpts%nkptf)
REAL :: div_vv(hybrid%nbands(nk))
TYPE(t_mat) :: olap,trafo,invtrafo,ex,tmp,v_x,z
COMPLEX :: exch(dimension%neigd,dimension%neigd)
COMPLEX,ALLOCATABLE :: carr(:)
......@@ -194,7 +193,7 @@ MODULE m_hsfock
& it,xcpot,&
& noco,nsest,indx_sest,&
& mpi,irank2,isize2,comm,&
& div_vv,ex)
& ex)
DEALLOCATE ( rep_c )
CALL timestop("valence exchange calculation")
......
......@@ -62,6 +62,7 @@ CONTAINS
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))
init_vex=.false.
ENDIF
hybrid%l_calhf = .TRUE.
......
......@@ -80,8 +80,8 @@ contains
subroutine write_coulomb(nk,l_real,coulomb)
implicit none
complex,intent(in) :: coulomb(:)
integer,intent(in) :: l_real
logical,intent(in) :: nk
integer,intent(in) :: nk
logical,intent(in) :: l_real
if (l_real) THEN
write(id_coulomb,rec=nk) real(coulomb)
......@@ -134,7 +134,7 @@ contains
subroutine read_coulomb_r(nk,coulomb)
implicit none
real ,intent(out) :: coulomb(:)
logical,intent(in) :: nk
integer,intent(in) :: nk
read(id_coulomb,rec=nk) coulomb
end subroutine read_coulomb_r
......@@ -142,7 +142,7 @@ contains
subroutine read_coulomb_c(nk,coulomb)
implicit none
complex,intent(out) :: coulomb(:)
logical,intent(in) :: nk
integer,intent(in) :: nk
read(id_coulomb,rec=nk) coulomb
end subroutine read_coulomb_c
......
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