Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | ERROR_FILE | = | "('MiMiC_error-',i0,'.err')" | Format for the error file name |
integer, | public, | parameter | :: | SEVERITY_WARN | = | 1 | Severity level of the error Warning is a recoverable condition with a fallback available |
integer, | public, | parameter | :: | SEVERITY_FATAL | = | 2 | Severity for unrecoverable condition in which, no fallback can be found |
integer, | public, | parameter | :: | TYPE_MEM | = | 1 | Error type associated with the memory allocation |
integer, | public, | parameter | :: | TYPE_INCORRECT_ARG | = | 2 | Error type associated with the incorrect argument passed |
integer, | public, | parameter | :: | TYPE_NONE | = | -1 | Generic error type |
integer, | private, | save | :: | process_id | = | -1 | |
procedure(handle), | private, | pointer, save | :: | custom_handler | => | NULL() |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | err_type | Type of the error |
||
character(len=*), | intent(in) | :: | message | Optional message |
||
character(len=*), | intent(in) | :: | source_file | Source file where the problem occurred |
||
integer, | intent(in) | :: | line_num | Source line at which the error occurred |
initialiaze error handler
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | pid | process ID (preferrably MPI rank) |
||
procedure(handle), | optional | pointer | :: | error_handler | optional external error handler |
Subroutine to print warning header
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iounit | I/O unit to write warning to |
||
character(len=*), | intent(in) | :: | source_file | Source file where the warning was issued |
||
integer, | intent(in) | :: | line_num | Line number at which the warning was issued |
Subroutine to print error header
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iounit | I/O unit to write error to |
||
character(len=*), | intent(in) | :: | source_file | Source file where the error was issued |
||
integer, | intent(in) | :: | line_num | Line number at which the error was issued |
Handler to treat memory allocation issues
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iounit | I/O unit to write error to |
||
character(len=*), | intent(in) | :: | message | Error message |
Handler to treat incorrect argument errors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iounit | I/O unit to write error to |
||
character(len=*), | intent(in) | :: | message | Error message |
Handler to treat any other kind of errors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iounit | I/O unit to write error to |
||
character(len=*), | intent(in) | :: | message | Error message |
Subroutine to handle errors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | severity | Severity level of the error |
||
integer, | intent(in) | :: | err_type | Type of the error |
||
character(len=*), | intent(in) | :: | message | Optional message |
||
character(len=*), | intent(in) | :: | source_file | Source file where the problem occurred |
||
integer, | intent(in) | :: | line_num | Source line at which the error occurred |