@brief Defines a type for managing errors and warnings.
Gets the subroutine to call when an error has been logged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
||
| procedure(error_callback), | intent(out), | pointer | :: | ptr |
A pointer to the error_callback routine. |
Gets the name of the routine that initiated the error.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
The subroutine or function name.
Gets the current error flag.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
The current error flag.
Gets the current error message.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
The error message.
Gets a logical value determining if the application should be terminated when an error is encountered.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
Returns true if the application should be terminated; else, false.
Gets the name of the error log file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
The filename.
Gets a logical value determining if printing of error and warning messages should be suppressed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
True if message printing should be suppressed; else, false to allow printing.
Gets the name of the routine that initiated the warning.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
The subroutine or function name.
Gets the current warning flag.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
The current warning flag.
Gets the current warning message.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
The warning message.
Tests to see if an error has been encountered.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
Returns true if an error has been encountered; else, false.
Tests to see if a warning has been encountered.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
Returns true if a warning has been encountered; else, false.
Writes an error log file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(in) | :: | this |
The errors object. |
||
| character(len=*), | intent(in) | :: | fcn |
The name of the function or subroutine in which the error was encountered. |
||
| character(len=*), | intent(in) | :: | msg |
The error message. |
||
| integer(kind=int32), | intent(in) | :: | flag |
The error flag. |
Reports an error condition to the user. The default behavior prints an error message, appends the supplied information to a log file, and terminates the program.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(inout) | :: | this |
The errors object. |
||
| character(len=*), | intent(in) | :: | fcn |
The name of the function or subroutine in which the error was encountered. |
||
| character(len=*), | intent(in) | :: | msg |
The error message. |
||
| integer(kind=int32), | intent(in) | :: | flag |
The error flag. |
||
| class(*), | intent(inout), | optional | :: | obj |
An optional unlimited polymorphic object that can be passed to provide information to the clean-up routine. |
Reports a warning message to the user. The default behavior prints the warning message, and returns control back to the calling code.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(inout) | :: | this |
The errors object. |
||
| character(len=*), | intent(in) | :: | fcn |
The name of the function or subroutine from which the warning was issued. |
||
| character(len=*), | intent(in) | :: | msg |
The warning message. |
||
| integer(kind=int32), | intent(in) | :: | flag |
The warning flag. |
Resets the error status flag to false, and the current error flag to zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(inout) | :: | this |
The errors object. |
Resets the warning status flag to false, and the current warning flag to zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(inout) | :: | this |
The errors object. |
Sets the subroutine to call when an error has been logged.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(inout) | :: | this |
The errors object. |
||
| procedure(error_callback), | intent(in), | pointer | :: | ptr |
A pointer to the error_callback routine. |
Sets a logical value determining if the application should be terminated when an error is encountered.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(inout) | :: | this |
The errors object. |
||
| logical, | intent(in) | :: | x |
Set to true if the application should be terminated when an error is reported; else, false. |
Sets the name of the error log file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(inout) | :: | this |
The errors object. |
||
| character(len=*), | intent(in) | :: | str |
The filename. |
Sets a logical value determining if printing of error and warning messages should be suppressed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(errors), | intent(inout) | :: | this |
The errors object. |
||
| logical, | intent(in) | :: | x |
Set to true if message printing should be suppressed; else, false to allow printing. |