Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Futility
Futility
Commits
57a71ec0
Unverified
Commit
57a71ec0
authored
Apr 15, 2021
by
Graham, Aaron
Committed by
GitHub
Apr 15, 2021
Browse files
Add a DBC_FAIL_VERBOSE logical (#322)
* Add a DBC_FAIL_VERBOSE logical * Use DBC_FAIL_VERBOSE in a missed spot
parent
e87faac7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Futility_DBC.f90
View file @
57a71ec0
...
...
@@ -41,6 +41,7 @@ PRIVATE
! List of Public items
PUBLIC
::
DBC_FAIL
PUBLIC
::
DBC_STOP_ON_FAIL
PUBLIC
::
DBC_FAIL_VERBOSE
PUBLIC
::
DBC_COUNTER
! These variables are created to be used in unit testing DBC
...
...
@@ -49,6 +50,8 @@ PUBLIC :: DBC_COUNTER
! as soon as possible to ensure DBC is working properly where intended
! This logical should ONLY be changed in unit test code and NEVER in a routine.
LOGICAL
::
DBC_STOP_ON_FAIL
=
.TRUE.
!This controls if DBC backtraces are printed
LOGICAL
::
DBC_FAIL_VERBOSE
=
.TRUE.
!This integer counts the total number of DBC_FAIL statements called
INTEGER
::
DBC_COUNTER
=
0
!
...
...
@@ -91,13 +94,15 @@ SUBROUTINE DBC_FAIL(test_char,mod_name,line)
nproc
=
1
#endif
DBC_COUNTER
=
DBC_COUNTER
+1
WRITE
(
ERROR_UNIT
,
'(a,i5,a,i5,a,i5)'
)
"DBC Failure: "
//
test_char
//
" in "
//
&
mod_name
//
" on line"
,
line
,
": process"
,
rank
+1
,
" of"
,
nproc
IF
(
DBC_FAIL_VERBOSE
)
THEN
WRITE
(
ERROR_UNIT
,
'(a,i5,a,i5,a,i5)'
)
"DBC Failure: "
//
test_char
//
" in "
//
&
mod_name
//
" on line"
,
line
,
": process"
,
rank
+1
,
" of"
,
nproc
ENDIF
#ifdef __INTEL_COMPILER
IF
(
DBC_STOP_ON_FAIL
)
CALL
abort
#else
CALL
backtrace
()
IF
(
DBC_FAIL_VERBOSE
)
CALL
backtrace
()
IF
(
DBC_STOP_ON_FAIL
)
STOP
2
#endif
ENDSUBROUTINE
DBC_FAIL
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment