Added error trap to catch possible numerical problems in EXX.

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@9385 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
sbinnie 2012-08-28 11:02:34 +00:00
parent 8f1f5a3cdf
commit a9ee125f9e
1 changed files with 7 additions and 0 deletions

View File

@ -575,6 +575,13 @@ SUBROUTINE electrons()
!
dexx = fock1 - 0.5D0*( fock0 + fock2 )
!
! dexx is by definition positive definite. If it is less than
! 0 there is some numerical problem. One such cause could be
! that the exx divergence treatment has failed.
!
IF ( dexx < 0d0 ) CALL errore( 'electrons', 'dexx is negative! &
& Check that exxdiv_treatment is appropriate for the system.', 1 )
!
etot = etot - dexx
hwf_energy = hwf_energy - dexx
!