From 1ca415b6cf6718cc45e856ca38809cd011de3220 Mon Sep 17 00:00:00 2001 From: fedebenelli Date: Sat, 23 Mar 2024 19:34:58 -0300 Subject: [PATCH] using error stop that is standard Fortran --- src/properties/scalar_property.f90 | 2 +- test/test.f90 | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/properties/scalar_property.f90 b/src/properties/scalar_property.f90 index c811d40..14248ce 100644 --- a/src/properties/scalar_property.f90 +++ b/src/properties/scalar_property.f90 @@ -43,7 +43,7 @@ impure elemental subroutine scalar_from_json(self, name, json_str, path) if (json%failed()) then write(error_unit, *) "ERROR: Invalid .json file: ", json_str - call exit(1) + error stop 1 end if call json%get(self%name//".value(1)", self%value) diff --git a/test/test.f90 b/test/test.f90 index 966c4f9..08be7ae 100644 --- a/test/test.f90 +++ b/test/test.f90 @@ -49,7 +49,7 @@ subroutine test(value, calc_value, name) write (*, "(A)", advance="no") name if (abs((value - calc_value)/value) > tolerance) then print *, "Error!" - call exit(1) + error stop 1 else print *, "Ok!" end if @@ -65,8 +65,9 @@ subroutine test_failed_read exitstat=exitstat, & cmdstat=cmdstat, & cmdmsg=cmdmsg) - if (exitstat /= 1) call exit(1) + if (exitstat /= 1) error stop 1 else + print *, "Should fail:" sus = Substance("fai") end if end subroutine