Dear Mehmet:
I think that something wrong happens in your case.
We need to get more information and we need the following modifications in the SUBROUTINE write_ephmat in io_eliashberg.f90.
(There might be some typos below.)
(before)
IF (ixkf(lower_bnd + ik - 1) > 0) THEN
IF (ixkqf(ixkf(lower_bnd + ik - 1), iq) > 0) THEN
DO imode = 1, nmodes ! phonon modes
wq = wf(imode, iq)
inv_wq = 1.0 / (two * wq)
!
DO ibnd = 1, nbndfst
IF (ABS(ekfs(ibnd, ixkf(lower_bnd + ik - 1)) - ef0) < fsthick) THEN
DO jbnd = 1, nbndfst
IF (ABS(ekfs(jbnd, ixkqf(ixkf(lower_bnd + ik - 1), iq)) - ef0) < fsthick) THEN
!
! here we take into account the zero-point DSQRT(hbar/2M\omega)
! with hbar = 1 and M already contained in the eigenmodes
! g2 is Ry^2, wkf must already account for the spin factor
!
IF (shortrange .AND. (ABS(xqf(1, iq)) > eps8 .OR. ABS(xqf(2, iq)) > eps8 &
.OR. ABS(xqf(3, iq)) > eps8 )) THEN
! SP: The abs has to be removed. Indeed the epf17 can be a pure imaginary
! number, in which case its square will be a negative number.
g2 = REAL((epf17(jbnd, ibnd, imode, ik)**two) * inv_wq)
ELSE
g2 = ABS(epf17(jbnd, ibnd, imode, ik))**two * inv_wq
ENDIF
ind(my_pool_id + 1) = ind(my_pool_id + 1) + 1
tmp_g2(ind(my_pool_id + 1)) = g2
ENDIF
ENDDO ! jbnd
ENDIF
ENDDO ! ibnd
ENDDO ! imode
ENDIF ! ixkqf
ENDIF ! ixkf
(after)
IF (ixkf(lower_bnd + ik - 1) > 0) THEN
IF (ixkqf(ixkf(lower_bnd + ik - 1), iq) > 0) THEN
DO imode = 1, nmodes ! phonon modes
wq = wf(imode, iq)
inv_wq = 1.0 / (two * wq)
!
DO ibnd = 1, nbndfst
IF (ABS(ekfs(ibnd, ixkf(lower_bnd + ik - 1)) - ef0) < fsthick) THEN
DO jbnd = 1, nbndfst
IF (ABS(ekfs(jbnd, ixkqf(ixkf(lower_bnd + ik - 1), iq)) - ef0) < fsthick) THEN
!
! here we take into account the zero-point DSQRT(hbar/2M\omega)
! with hbar = 1 and M already contained in the eigenmodes
! g2 is Ry^2, wkf must already account for the spin factor
!
IF (shortrange .AND. (ABS(xqf(1, iq)) > eps8 .OR. ABS(xqf(2, iq)) > eps8 &
.OR. ABS(xqf(3, iq)) > eps8 )) THEN
! SP: The abs has to be removed. Indeed the epf17 can be a pure imaginary
! number, in which case its square will be a negative number.
g2 = REAL((epf17(jbnd, ibnd, imode, ik)**two) * inv_wq)
ELSE
g2 = ABS(epf17(jbnd, ibnd, imode, ik))**two * inv_wq
ENDIF
!!!
IF (g2 < 0.d0) THEN
WRITE(stdout, *) ‘warning: g2 is negative. g2=’, g2
WRITE(stdout, *) ‘inv_wq=’, inv_wq
WRITE(stdout, *) ‘iq=’, iq
WRITE(stdout, *) ‘ik=’, ik
WRITE(stdout, *) ‘imode=’, imode
WRITE(stdout, *) ‘ibnd=’, ibnd
WRITE(stdout, *) ‘jbnd=’, jbnd
IF (shortrange) WRITE(stdout, *) ‘shortrange is .true.’
ENDIF
!!!
ind(my_pool_id + 1) = ind(my_pool_id + 1) + 1
tmp_g2(ind(my_pool_id + 1)) = g2
ENDIF
ENDDO ! jbnd
ENDIF
ENDDO ! ibnd
ENDDO ! imode
ENDIF ! ixkqf
ENDIF ! ixkf
You just need to focus on the region sandwiched by “!!!” and you need to rerun the evaluation of e-ph vertex on fine grids.
Sincerely,
H. Lee