Skip to content

Commit be3b52f

Browse files
committed
Replace WAXPY and WSCAL in routines WGEFA and WGESL
util/blas.f90 - Replaced WAXPY and WSCAL with explicit loops (generated by AI) in the WGEFA and WGESL routines. These are needed for some integrators. Signed-off-by: Bob Yantosca <[email protected]>
1 parent a98245f commit be3b52f

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

util/blas.f90

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,19 @@ SUBROUTINE WGEFA(N,A,Ipvt,info)
124124
t = A(l,k); A(l,k) = A(k,k); A(k,k) = t
125125
END IF
126126
t = -ONE/A(k,k)
127-
CALL WSCAL(n-k,t,A(k+1,k),1)
127+
! CALL WSCAL(n-k,t,A(k+1,k),1)
128+
DO i = k+1, n
129+
A(i,k) = t * A(i,k)
130+
END DO
128131
DO j = k+1, n
129132
t = A(l,j)
130133
IF (l /= k) THEN
131134
A(l,j) = A(k,j); A(k,j) = t
132135
END IF
133-
CALL WAXPY(n-k,t,A(k+1,k),1,A(k+1,j),1)
136+
!CALL WAXPY(n-k,t,A(k+1,k),1,A(k+1,j),1)
137+
DO i = k+1, n
138+
A(i,j) = A(i,j) + t * A(i,k)
139+
END DO
134140
END DO
135141
END IF
136142

@@ -176,15 +182,21 @@ SUBROUTINE WGESL(Trans,N,A,Ipvt,b)
176182
b(l) = b(k)
177183
b(k) = t
178184
END IF
179-
CALL WAXPY(n-k,t,a(k+1,k),1,b(k+1),1)
185+
!CALL WAXPY(n-k,t,a(k+1,k),1,b(k+1),1)
186+
DO i = k+1, n
187+
b(i) = b(i) + t * a(i,k)
188+
END DO
180189
END DO
181190
END IF
182191
! now solve U*x = y
183192
DO kb = 1, n
184193
k = n + 1 - kb
185194
b(k) = b(k)/a(k,k)
186195
t = -b(k)
187-
CALL WAXPY(k-1,t,a(1,k),1,b(1),1)
196+
!CALL WAXPY(k-1,t,a(1,k),1,b(1),1)
197+
DO i = 1, k-1
198+
b(i) = b(i) + t * a(i,k)
199+
END DO
188200
END DO
189201

190202
CASE ('t','T') ! Solve transpose(A) * x = b

0 commit comments

Comments
 (0)