From fb336d5b8db25fcb62b3a79895343e440053f7d7 Mon Sep 17 00:00:00 2001 From: Nikhar Abbas Date: Wed, 25 Sep 2019 14:08:59 -0600 Subject: [PATCH] Algorithm update --- Source/Functions.f90 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Functions.f90 b/Source/Functions.f90 index ca2b4b3f..62f0dd2d 100644 --- a/Source/Functions.f90 +++ b/Source/Functions.f90 @@ -142,11 +142,18 @@ FUNCTION identity(n) RESULT(A) INTEGER, INTENT(IN) :: n REAL(4), DIMENSION(n, n) :: A INTEGER :: i + INTEGER :: j ! Build identity matrix - FORALL (i=1:n) - A(i, i) = 1.0 - END FORALL + DO i=1,n + DO j = 1,n + IF (i == j) THEN + A(i,j) = 1.0 + ELSE + A(i,j) = 0.0 + ENDIF + ENDDO + ENDDO END FUNCTION identity !-------------------------------------------------------------------------------------------------------------------------------