Skip to content

Commit

Permalink
Bugfix: NaN in the wfc_centers and spreads when compiling with gfortr…
Browse files Browse the repository at this point in the history
…an 2017 (#182)

* Bugfix: the reference point for the calculation of the orbitals centers was not defined
Compilation with gfortran 2017 lead to NaN
Fixed setting the reference point to 0.0. Might be improved

* Use the center of mass of the system as a reference to compute the dipoles

* Remove unused variable

* Incremented version number

Co-authored-by: Edward Linscott <[email protected]>
  • Loading branch information
nscolonna and elinscott authored Sep 15, 2022
1 parent 6f175a0 commit 32ee49e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion koopmans/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'Python module for running KI and KIPZ calculations with Quantum Espresso'
from pathlib import Path

__version__ = '1.0.0-beta.1'
__version__ = '1.0.0-beta.2'
base_directory = Path(__path__[0]).parent
5 changes: 2 additions & 3 deletions quantum_espresso/kcp/CPV/nksiclib.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7487,7 +7487,7 @@ SUBROUTINE compute_nksic_centers(nnrx, nx, nudx, nbsp, nspin, iupdwn, &
!INTERNAL VARIABLES
!
INTEGER :: myspin1, myspin2, mybnd1, mybnd2
REAL(DP):: r0(3), rs(3)
REAL(DP):: r0(3)
REAL(DP), external :: ddot

!
Expand All @@ -7497,9 +7497,8 @@ SUBROUTINE compute_nksic_centers(nnrx, nx, nudx, nbsp, nspin, iupdwn, &
!
! compute ionic center of mass
!
CALL ions_cofmass(taus, pmass, na, nsp, rs)
CALL ions_cofmass(taus, pmass, na, nsp, r0)
! and use it as reference position
!r0=0.d0
!
call compute_dipole( nnrx, 1, orb_rhor(1,1), r0, wfc_centers(1:4, mybnd1, myspin1), &
wfc_spreads(mybnd1, myspin1, 1))
Expand Down

0 comments on commit 32ee49e

Please sign in to comment.