Shortrange matrixelement

Hi,
When calculating the shortrange electron-phonon matrix element, in the [b:1t1q2c8u]rotate_epmat.f90[/b:1t1q2c8u] in the subroutine [b:1t1q2c8u]rgd_blk_epw[/b:1t1q2c8u], the longrange part is first substracted from the total matrix element and if the[b:1t1q2c8u] shortrange tag is set to true[/b:1t1q2c8u], the magnitude of the longrange part is substracted once more.

epmat = epmat + facqzaquqbmat (where the signe is -1 i.e. longrange vertex is substracted)
&
if (shortrange) then
epmat = SQRT(epmat
conj(epmat) - epmatl*conj(epmatl))
end if

I donot understand why the longrange matrix element is substracted twice?
It will be really helpful, if someone can comment on this formulation.