Commit a54225c7 authored by Samuel Poncé's avatar Samuel Poncé

Add initialization to zero of cfac, cfacq

This is important in the case of use_ws because not all elements are accessed
and can result in NaN if not initizalized.
parent 4309e07f
......@@ -624,6 +624,12 @@
ALLOCATE(irvec_r(3,nrr_k))
irvec_r = REAL(irvec_k,KIND=dp)
!
! Zeroing everything - initialization is important !
cfac(:,:,:) = czero
cfacq(:,:,:) = czero
rdotk(:) = zero
rdotk2(:) = zero
!
! ------------------------------------------------------
! Hamiltonian : Wannier -> Bloch (preliminary)
! ------------------------------------------------------
......
......@@ -32,7 +32,7 @@
USE mp_global, ONLY : npool, inter_pool_comm, world_comm, my_pool_id
USE mp_world, ONLY : mpime
USE mp, ONLY : mp_sum, mp_bcast
USE constants_epw, ONLY : twopi, ci, zero, eps6, ryd2ev
USE constants_epw, ONLY : twopi, ci, zero, eps6, ryd2ev, czero
USE epwcom, ONLY : nbndsub, fsthick, use_ws, mp_mesh_k, nkf1, nkf2, &
nkf3, iterative_bte, restart_freq, scissor
USE noncollin_module, ONLY : noncolin
......@@ -137,6 +137,8 @@
!selecq(:) = 0
rdotk(:) = 0
rdotk2(:) = 0
cfac(:,:,:) = czero
cfacq(:,:,:) = czero
!
IF (exst) THEN
IF (mpime == ionode_id) THEN
......
......@@ -526,9 +526,9 @@
!ndiff(1) = n1 - i1*nc1 + ( tau(1,na) + w_centers(1,iw2) + w_centers(1,iw) ) / 3.d0
!ndiff(2) = n2 - i2*nc2 + ( tau(2,na) + w_centers(2,iw2) + w_centers(2,iw) ) / 3.d0
!ndiff(3) = n3 - i3*nc3 + ( tau(3,na) + w_centers(3,iw2) + w_centers(3,iw) ) / 3.d0
ndiff(1) = n1 - i1*nc1 + tau(1,na) + ( w_centers(1,iw2) + w_centers(1,iw) ) / 2.d0
ndiff(2) = n2 - i2*nc2 + tau(2,na) + ( w_centers(2,iw2) + w_centers(2,iw) ) / 2.d0
ndiff(3) = n3 - i3*nc3 + tau(3,na) + ( w_centers(3,iw2) + w_centers(3,iw) ) / 2.d0
ndiff(1) = n1 - i1*nc1 + tau(1,na) - ( w_centers(1,iw2) + w_centers(1,iw) ) / 2.d0
ndiff(2) = n2 - i2*nc2 + tau(2,na) - ( w_centers(2,iw2) + w_centers(2,iw) ) / 2.d0
ndiff(3) = n3 - i3*nc3 + tau(3,na) - ( w_centers(3,iw2) + w_centers(3,iw) ) / 2.d0
DO ipol = 1, 3
DO jpol = 1, 3
dist(i) = dist(i) + dble(ndiff(ipol))*adot(ipol,jpol)*dble(ndiff(jpol))
......
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