diff --git a/src/bodirect.F90 b/src/bodirect.F90 index 950c959..3d72f47 100644 --- a/src/bodirect.F90 +++ b/src/bodirect.F90 @@ -40,6 +40,9 @@ SUBROUTINE BOEVECS REAL(LATTEPREC), PARAMETER :: MAXSHIFT = ONE REAL(LATTEPREC) :: EBAND, QMIXORIG REAL(LATTEPREC) :: S, OCCLOGOCC_ELECTRONS, OCCLOGOCC_HOLES +#ifdef PROGRESSON + LOGICAL :: PROGRESSERROR +#endif IF (EXISTERROR) RETURN @@ -66,7 +69,15 @@ SUBROUTINE BOEVECS #ifdef PROGRESSON - CALL PRG_GET_FLEVEL(EVALS,KBT,BNDFIL,BREAKTOL,CHEMPOT) + ! PROGRESSERROR is kind 4, but LATTE's EXISTERROR is kind 1 + ! so use temporary variable + PROGRESSERROR = EXISTERROR + CALL PRG_GET_FLEVEL(EVALS,KBT,BNDFIL,BREAKTOL,CHEMPOT,PROGRESSERROR) + EXISTERROR = PROGRESSERROR + IF (EXISTERROR) THEN + CALL ERRORS("bodirect","PROGRESS Fermi level bisection search (PRG_GET_FLEVEL) not converged") + RETURN + ENDIF #else