Commit 92b8d30c authored by Daniel Wortmann's avatar Daniel Wortmann

Some additional fixes of hybrid part. Mainly initializations required by valgrind

parent 44619806
......@@ -101,7 +101,7 @@ module m_types_rcmat
COMPLEX,INTENT(IN) :: packed_c(:)
INTEGER:: n,nn,i
call mat1%alloc(l_real,matsize,matsize)
CALL mat1%alloc(l_real,matsize,matsize,0.0)
i=1
DO n=1,matsize
DO nn=1,n
......
......@@ -98,7 +98,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 total(valence+core)'
WRITE(6,'(A)') new_line('n') // ' k-point '// 'band tail pole total(valence+core)'
END IF
......@@ -128,7 +128,7 @@ MODULE m_add_vnonlocal
results%te_hfex%valence = results%te_hfex%valence -a_ex*results%w_iks(iband,nk,jsp)*exch(iband,iband)
END IF
IF(hybrid%l_calhf) THEN
WRITE(6, '( '' ('',F5.3,'','',F5.3,'','',F5.3,'')'',I4,4X,3F10.5)')&
WRITE(6, '( '' ('',F5.3,'','',F5.3,'','',F5.3,'')'',I4,4X,3F15.5)')&
& 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
......
......@@ -680,7 +680,6 @@ CONTAINS
IF(j.LE. hybrid%nbasp) coulomb(M,ikpt) = coulmat(j,i)
END DO
END DO
END DO
DEALLOCATE( coulmat,olap,integral )
......@@ -766,7 +765,6 @@ CONTAINS
END DO
END DO
! (3b) r,r' in different MT
DO ikpt=ikptmin,ikptmax!1,kpts%nkpt
......@@ -866,7 +864,6 @@ CONTAINS
END DO
DEALLOCATE( carr2,carr2a,carr2b,structconst1 )
END DO !ikpt
! Add corrections from higher orders in (3b) to coulomb(:,1)
! (1) igpt1 > 1 , igpt2 > 1 (finite G vectors)
rdum = (4*pi_const)**(1.5d0)/cell%vol**2 * gmat(1,1)
......@@ -914,7 +911,6 @@ CONTAINS
END DO
END DO
END DO
! (2) igpt1 = 1 , igpt2 > 1 (first G vector vanishes, second finite)
iy = hybrid%nbasp + 1
DO igpt0 = 1,hybrid%ngptm1(1)
......@@ -941,7 +937,6 @@ CONTAINS
END DO
END DO
END DO
! (2) igpt1 = 1 , igpt2 = 1 (vanishing G vectors)
iy = hybrid%nbasp + 1
ix = hybrid%nbasp + 1
......@@ -957,8 +952,7 @@ CONTAINS
END DO
END DO
END DO
! (3c) r,r' in same MT
! Calculate sphbesintegral
......@@ -1029,7 +1023,6 @@ CONTAINS
END DO
END DO
DEALLOCATE( carr2 )
IF ( mpi%irank == 0 ) THEN
......@@ -1105,7 +1098,6 @@ CONTAINS
END DO ! igpt0
END DO ! ikpt
DEALLOCATE ( carr2,iarr,hybrid%pgptm1 )
IF ( mpi%irank == 0 ) THEN
WRITE(6,'(2X,A)',advance='no') 'done'
CALL cpu_TIME(time2)
......@@ -1124,7 +1116,7 @@ CONTAINS
# endif
1 DEALLOCATE (qnrm,pqnrm)
CALL cpu_TIME(time1)
IF ( xcpot%is_name("hse") .OR. xcpot%is_name("vhse")) THEN
!
......@@ -1190,7 +1182,7 @@ CONTAINS
! END IF
!unpack matrix coulomb
call coulhlp%from_packed(sym%invs,nbasm1(ikpt),real(coulomb(:,ikpt)),coulomb(:,ikpt))
CALL coulhlp%from_packed(sym%invs,nbasm1(ikpt),REAL(coulomb(:,ikpt)),coulomb(:,ikpt))
if (olapm%l_real) THEN
!multiply with inverse olap from right hand side
......@@ -1203,7 +1195,7 @@ CONTAINS
!multiply with inverse olap from left side
coulhlp%data_c(hybrid%nbasp+1:,:) = MATMUL(olapm%data_c,coulhlp%data_c(hybrid%nbasp+1:,:))
end if
coulomb(:nbasm1(ikpt)*(nbasm1(ikpt)+1)/2,ikpt) = coulhlp%to_packed()
coulomb(:(nbasm1(ikpt)*(nbasm1(ikpt)+1))/2,ikpt) = coulhlp%to_packed()
END DO
......@@ -1231,6 +1223,7 @@ CONTAINS
ALLOCATE( coulomb_mt3_r(hybrid%maxindxm1-1,atoms%nat,atoms%nat,1) )
# ifdef CPP_IRCOULOMBAPPROX
ALLOCATE( coulomb_mtir_r(ic,ic+hybrid%maxgptm,1) )
coulomb_mtir_r=0
ALLOCATE( coulombp_mtir_r(0,0) )
# else
ALLOCATE( coulomb_mtir_r(ic+hybrid%maxgptm,ic+hybrid%maxgptm,1) )
......@@ -1558,12 +1551,11 @@ CONTAINS
!COMPLEX , ALLOCATABLE :: constfunc(:) !can also be real in inversion case
COMPLEX :: coeff(nbasm1(1)),cderiv(nbasm1(1),-1:1), claplace(nbasm1(1))
call olap%alloc(sym%invs,hybrid%ngptm(1),hybrid%ngptm(1))
CALL olap%alloc(sym%invs,hybrid%ngptm(1),hybrid%ngptm(1),0.)
n = nbasm1(1)
nn = n*(n+1)/2
CALL olap_pw ( olap,hybrid%pgptm(:hybrid%ngptm(1),1),hybrid%ngptm(1),atoms,cell )
CALL olap_pw ( olap,hybrid%gptm(:,hybrid%pgptm(:hybrid%ngptm(1),1)),hybrid%ngptm(1),atoms,cell )
! Define coefficients (coeff) and their derivatives (cderiv,claplace)
coeff = 0
......@@ -1598,11 +1590,11 @@ CONTAINS
END DO
END DO
END DO
if (olap%l_real) THEN
IF (olap%l_real) THEN
coeff(hybrid%nbasp+1:n) = olap%data_r(1,1:n-hybrid%nbasp)
else
coeff(hybrid%nbasp+1:n) = olap%data_c(1,1:n-hybrid%nbasp)
end if
END IF
IF (sym%invs) THEN
CALL symmetrize(coeff, 1,nbasm1(1),2,.FALSE.,&
atoms,hybrid%lcutm1,hybrid%maxlcutm1,&
......
......@@ -183,9 +183,8 @@
IF( initialize ) THEN !it .eq. 1 .and. nk .eq. 1) THEN
print *,divergence
print *,Cell%omtil,kpts%nkpt3,kpts%nkptf
call calc_divergence(cell,kpts,divergence)
PRINT *,"Divergence:",divergence
initialize = .false.
END IF
......
......@@ -55,6 +55,7 @@ CONTAINS
!Allocate the storage for the DATA always read/write
ALLOCATE(d%el_s(0:lmax,ntype),d%ello_s(nlo,ntype),d%evac_s(2))
ALLOCATE(d%kvec_s(nmat,3),d%kveclo_s(nlotot))
d%kvec_s=0;d%kveclo_s=0
!Calculate the record length
INQUIRE(IOLENGTH=recl_eig) d%el_s,d%evac_s,d%ello_s,r3,r1,i1,i1,d%kvec_s,d%kveclo_s
d%recl_bas=recl_eig
......
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