Skip to content

fixed a bug for array out-of-bounds in EPW/ZG calculation

Hua Xie requested to merge xh1205/q-e:develop into develop

In q-e/EPW/ZG/src/ZG.f90 line 3364, the index of q(i,ii) is wrong, will cause the array to go out of bounds.

      DO j = 1, NINT(nq_tot / 2.0d0)
        DO p = 1, combs_all ! for ever \k,\a,\k',\a'
          DO i = 1, ctrAB ! over qpoints
            dotp = 0.0d0
            DO ii = 1, 3
              !dotp = dotp + q(i, ii) * Rlist(j, ii)!
              ! q(3, nq)
              dotp = dotp + q(ii, i) * Rlist(j, ii)
            ENDDO ! ii
            sum_er_B2(ctr2) = sum_er_B2(ctr2) + cos(tpi * dotp) * F_vect(p, i)
            !
          ENDDO ! i
          ctr2 = ctr2 + 1
        ENDDO ! p     
      ENDDO ! j
Edited by Hua Xie

Merge request reports