@@ -266,19 +266,23 @@ contains
266266 integer :: p(6), num_present, m, n, k
267267 integer, allocatable :: s(:,:)
268268
269+ type(linalg_state_type) :: err0
270+ 269271 p(1) = size(m1, 1)
270272 p(2) = size(m2, 1)
271273 p(3) = size(m2, 2)
272274
273275 if (size(m1, 2) /= p(2)) then
274- error stop 'matrices m1, m2 not of compatible sizes'
276+ err0 = linalg_state_type(this, LINALG_VALUE_ERROR, 'matrices m1, m2 not of compatible sizes')
277+ call linalg_error_handling(err0)
275278 end if
276279
277280 num_present = 2
278281 if (present(m3)) then
279282
280283 if (size(m3, 1) /= p(3)) then
281- error stop 'matrices m2, m3 not of compatible sizes'
284+ err0 = linalg_state_type(this, LINALG_VALUE_ERROR, 'matrices m2, m3 not of compatible sizes')
285+ call linalg_error_handling(err0)
282286 end if
283287
284288 p(3) = size(m3, 1)
@@ -288,7 +292,8 @@ contains
288292 if (present(m4)) then
289293
290294 if (size(m4, 1) /= p(4)) then
291- error stop 'matrices m3, m4 not of compatible sizes'
295+ err0 = linalg_state_type(this, LINALG_VALUE_ERROR, 'matrices m3, m4 not of compatible sizes')
296+ call linalg_error_handling(err0)
292297 end if
293298
294299 p(4) = size(m4, 1)
@@ -298,7 +303,8 @@ contains
298303 if (present(m5)) then
299304
300305 if (size(m5, 1) /= p(5)) then
301- error stop 'matrices m4, m5 not of compatible sizes'
306+ err0 = linalg_state_type(this, LINALG_VALUE_ERROR, 'matrices m4, m5 not of compatible sizes')
307+ call linalg_error_handling(err0)
302308 end if
303309
304310 p(5) = size(m5, 1)
0 commit comments