Debug tracing module. More...
Data Types | |
| interface | datadump |
| interface | debug |
Functions/Subroutines | |
| integer function, public | sublevel () |
| subroutine, public | dbg_scratch (on) |
| subroutine, public | setdebug (debug) |
| subroutine, public | beginsub (name, fmt, i, r, d, l, n, c1, c2, c3, ca, version) |
| subroutine, public | endsub (name, fmt, i, r, d, l, n, c1, c2, c3, ca) |
| subroutine, public | dbgmessage (fmt, i, r, d, l, n, c1, c2, c3, ca) |
Variables | |
| integer, save, public | dbg = -1 |
Debug tracing module.
| subroutine, public dc_trace::beginsub | ( | character(*), intent(in) | name, |
| character(*), intent(in), optional | fmt, | ||
| integer, dimension(:), intent(in), optional | i, | ||
| real, dimension(:), intent(in), optional | r, | ||
| real(dp), dimension(:), intent(in), optional | d, | ||
| logical, dimension(:), intent(in), optional | l, | ||
| integer, dimension(:), intent(in), optional | n, | ||
| character(*), intent(in), optional | c1, | ||
| character(*), intent(in), optional | c2, | ||
| character(*), intent(in), optional | c3, | ||
| character(*), dimension(:), intent(in), optional | ca, | ||
| character(*), intent(in), optional | version | ||
| ) |
Output subprogram start message
Outputs the subprogram name given to name as follows:
# call name
By calling multiple times, messages are output showing the hierarchical structure (see dc_trace Overview). Make sure to call EndSub the same number of times as BeginSub.
Additional messages can be output by providing fmt and subsequent arguments:
# call name : fmt
See dc_string::CPrintf for format specification.
The version argument specifies the version number of the subprogram. The version string is displayed only on the first call of a subprogram.
| [in] | name | Subprogram name |
| [in] | fmt | Format string for additional message (optional) |
| [in] | i | Integer array for formatting |
| [in] | r | Real array for formatting |
| [in] | d | Double precision array for formatting |
| [in] | L | Logical array for formatting |
| [in] | n | Integer array for formatting |
| [in] | c1 | Character string 1 for formatting |
| [in] | c2 | Character string 2 for formatting |
| [in] | c3 | Character string 3 for formatting |
| [in] | ca | Character array for formatting |
| [in] | version | Version number of the subprogram (optional) |
Definition at line 474 of file dc_trace.f90.
References dbg, dc_types::dp, and dc_types::string.
| subroutine, public dc_trace::dbg_scratch | ( | logical, intent(in) | on | ) |
Erase debug messages
Operation has not been confirmed. Please use with caution.
By giving .true. to the logical variable on, subsequent debug messages can be erased.
By giving .false. to the logical variable on, messages since the previous Dbg_Scratch call will be output as debug messages again, and subsequent debug messages will also be output.
| [in] | on | If .true., erase subsequent debug messages. If .false., output erased messages and resume normal output. |
Definition at line 237 of file dc_trace.f90.
References dbg.
| subroutine, public dc_trace::dbgmessage | ( | character(*), intent(in) | fmt, |
| integer, dimension(:), intent(in), optional | i, | ||
| real, dimension(:), intent(in), optional | r, | ||
| real(dp), dimension(:), intent(in), optional | d, | ||
| logical, dimension(:), intent(in), optional | l, | ||
| integer, dimension(:), intent(in), optional | n, | ||
| character(*), intent(in), optional | c1, | ||
| character(*), intent(in), optional | c2, | ||
| character(*), intent(in), optional | c3, | ||
| character(*), dimension(:), intent(in), optional | ca | ||
| ) |
Output debug message
Outputs debug messages according to the format string fmt. See dc_string::CPrintf for format specification.
See dc_trace Example for usage examples.
level.| [in] | fmt | Format string |
| [in] | i | Integer array for formatting |
| [in] | r | Real array for formatting |
| [in] | d | Double precision array for formatting |
| [in] | L | Logical array for formatting |
| [in] | n | Integer array for formatting |
| [in] | c1 | Character string 1 for formatting |
| [in] | c2 | Character string 2 for formatting |
| [in] | c3 | Character string 3 for formatting |
| [in] | ca | Character array for formatting |
Definition at line 679 of file dc_trace.f90.
References dbg, dc_types::dp, and dc_types::string.
| subroutine, public dc_trace::endsub | ( | character(*), intent(in) | name, |
| character(*), intent(in), optional | fmt, | ||
| integer, dimension(:), intent(in), optional | i, | ||
| real, dimension(:), intent(in), optional | r, | ||
| real(dp), dimension(:), intent(in), optional | d, | ||
| logical, dimension(:), intent(in), optional | l, | ||
| integer, dimension(:), intent(in), optional | n, | ||
| character(*), intent(in), optional | c1, | ||
| character(*), intent(in), optional | c2, | ||
| character(*), intent(in), optional | c3, | ||
| character(*), dimension(:), intent(in), optional | ca | ||
| ) |
Output subprogram end message
Outputs the subprogram name given to name as follows:
# end name
This corresponds one-to-one with BeginSub, so give the same name as the corresponding BeginSub argument.
Additional messages can be output by providing fmt and subsequent arguments:
# end name fmt
See dc_string::CPrintf for format specification.
| [in] | name | Subprogram name |
| [in] | fmt | Format string for additional message (optional) |
| [in] | i | Integer array for formatting |
| [in] | r | Real array for formatting |
| [in] | d | Double precision array for formatting |
| [in] | L | Logical array for formatting |
| [in] | n | Integer array for formatting |
| [in] | c1 | Character string 1 for formatting |
| [in] | c2 | Character string 2 for formatting |
| [in] | c3 | Character string 3 for formatting |
| [in] | ca | Character array for formatting |
Definition at line 598 of file dc_trace.f90.
References dbg, and dc_types::dp.
| subroutine, public dc_trace::setdebug | ( | integer, intent(in), optional | debug | ) |
Turn debug mode on/off
Call this subroutine when you want to output debug messages.
If the integer variable debug is given, debug messages from subsequent subroutines will be output to that unit number. If debug is not given, debug messages will be output to unit number 0 (standard error output). If output to unit number 0 fails, debug messages will be output to unit number 6 (standard output) instead.
If a negative integer is given to debug, debug mode is disabled and no debug messages will be output.
When SetDebug is called, the following message is displayed:
#SetDebug: dbg = debug
| [in] | debug | Unit number for debug message output (optional). If not given, standard error output is used. If negative, debug mode is disabled. |
Definition at line 339 of file dc_trace.f90.
References dbg, dc_types::stderr, and dc_types::stdout.
| integer function, public dc_trace::sublevel |
Return the hierarchical level of subprograms
Returns the hierarchical level of subprograms. The default level is 0. The level increases by 1 with BeginSub and decreases by 1 with EndSub.
Definition at line 202 of file dc_trace.f90.
| integer, save, public dc_trace::dbg = -1 |
Definition at line 160 of file dc_trace.f90.