Skip to content

Commit 5508588

Browse files
committed
template
1 parent 9f49409 commit 5508588

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

assert_legacy.f90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ elemental logical function isclose(actual, desired, rtol, atol, equal_nan)
4343
!print*,r,a,n,actual,desired
4444

4545
!--- sanity check
46-
if ((r < 0._wp).or.(a < 0._wp)) stop 'tolerances must be non-negative'
46+
if ((r < 0._wp).or.(a < 0._wp)) call err('tolerances must be non-negative')
4747
!--- simplest case
4848
isclose = (actual == desired)
4949
if (isclose) return
@@ -77,15 +77,16 @@ impure elemental subroutine assert_isclose(actual, desired, rtol, atol, equal_na
7777

7878
if (.not.isclose(actual,desired,rtol,atol,equal_nan)) then
7979
write(stderr,*) merge(err_msg,'',present(err_msg)),': actual',actual,'desired',desired
80-
stop
80+
stop -1
8181
endif
8282

8383
end subroutine assert_isclose
8484

8585

8686
pure subroutine err(msg)
8787
character, intent(in) :: msg
88-
stop msg
88+
write(stderr,*) msg
89+
stop -1
8990
end subroutine err
9091

9192
end module assert

0 commit comments

Comments
 (0)