Skip to content

Commit

Permalink
Fix optional argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrack committed Aug 22, 2020
1 parent ea287d1 commit 03039a0
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/fm/cp_fm_diag.F
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ SUBROUTINE choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)

CHARACTER(LEN=*), PARAMETER :: routineN = 'choose_eigv_solver'

INTEGER :: nmo
INTEGER :: myinfo, nmo
#if defined(__CHECK_DIAG)
CHARACTER(LEN=5), DIMENSION(2), PARAMETER :: diag_driver = (/"SYEVD", &
"ELPA "/)
Expand All @@ -179,6 +179,9 @@ SUBROUTINE choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)
INTEGER, DIMENSION(9) :: desca
#endif
#endif

myinfo = 0

nmo = SIZE(eigenvalues, 1)

! Sample peak memory
Expand All @@ -188,7 +191,7 @@ SUBROUTINE choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)
CALL cp_fm_diag_elpa(matrix, eigenvectors, eigenvalues)
ELSE IF (diag_type == DIAG_TYPE_SCALAPACK) THEN
IF (PRESENT(info)) THEN
CALL cp_fm_syevd(matrix, eigenvectors, eigenvalues, info=info)
CALL cp_fm_syevd(matrix, eigenvectors, eigenvalues, info=myinfo)
ELSE
CALL cp_fm_syevd(matrix, eigenvectors, eigenvalues)
END IF
Expand Down Expand Up @@ -260,6 +263,8 @@ SUBROUTINE choose_eigv_solver(matrix, eigenvectors, eigenvalues, info)
#endif
#endif

IF (PRESENT(info)) info = myinfo

END SUBROUTINE choose_eigv_solver

! **************************************************************************************************
Expand Down Expand Up @@ -483,21 +488,20 @@ SUBROUTINE cp_fm_syevd_base(matrix, eigenvectors, eigenvalues, info)
END IF
END IF

IF (PRESENT(info)) info = myinfo

DEALLOCATE (work)
DEALLOCATE (iwork)
#else
MARK_USED(matrix)
MARK_USED(eigenvectors)
MARK_USED(eigenvalues)
info = -1
IF (matrix%matrix_struct%para_env%ionode) THEN
message = "ERROR in "//TRIM(routineN)// &
": Matrix diagonalization using PDSYEVD requested without ScaLAPACK support"
CPABORT(TRIM(message))
END IF
#endif

myinfo = -1
IF (PRESENT(info)) info = myinfo
message = "ERROR in "//TRIM(routineN)// &
": Matrix diagonalization using PDSYEVD requested without ScaLAPACK support"
CPABORT(TRIM(message))
#endif

CALL timestop(handle)

Expand Down

0 comments on commit 03039a0

Please sign in to comment.