Skip to content

Commit

Permalink
The diag routine is apparently called for 1x1 matrices.
Browse files Browse the repository at this point in the history
  • Loading branch information
hfp authored and alazzaro committed Jun 26, 2019
1 parent 92e01a7 commit 1db5302
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/common/mathlib.F
Original file line number Diff line number Diff line change
Expand Up @@ -1575,12 +1575,11 @@ SUBROUTINE diag(n, a, d, v)
t, tau, theta, tresh
REAL(KIND=dp), DIMENSION(n) :: b, z
a_max = ABS(a(n-1, n))
DO ip = 1, n-2
a_max = 0.0_dp
DO ip = 1, n-1
a_max = MAX(a_max, MAXVAL(ABS(a(ip, ip+1:n))))
b(ip) = a(ip, ip) ! get_diag(a)
END DO
b(n-1) = a(n-1, n-1)
b(n) = a(n, n)
CALL unit_matrix(v)
Expand Down Expand Up @@ -1628,8 +1627,8 @@ SUBROUTINE diag(n, a, d, v)
END DO
END DO
b = b+z
a_max = ABS(a(n-1, n))
DO ip = 1, n-2
a_max = 0.0_dp
DO ip = 1, n-1
a_max = MAX(a_max, MAXVAL(ABS(a(ip, ip+1:n))))
END DO
END DO
Expand Down

0 comments on commit 1db5302

Please sign in to comment.