bugfix: invlaid memory access in dm_update

This commit is contained in:
Nils Wittemeier 2024-02-09 14:05:18 +01:00
parent 4543c2acc9
commit 3c228dcc30
1 changed files with 4 additions and 2 deletions

View File

@ -510,11 +510,13 @@ contains
dE => val(spEDM)
! the actual size of the shift
jo = nnzs(spDM)
jo = nnzs(spDM)
! As we have shifted the fermi-level up to 0, we need to shift the
! energy-density matrix back
call daxpy(jo,Ef,dD(1,1),1,dE(1,1),1)
if (jo > 0) then
call daxpy(jo,Ef,dD(1,1),1,dE(1,1),1)
end if
end if