Error handling module for PROCESS author: P J Knight, CCFE, Culham Science Centre N/A This module provides a centralised method for dealing with errors generated by PROCESS.
All possible informational/error messages are initialised
via a call to
initialise_error_list
. Thereafter, any routine
that needs to flag a message should call
report_error
with the relevant error identifier as
the argument. Up to eight integer and eight floating-point diagnostic
values may be saved by the user in arrays idiags
and
fdiags
, respectively, for debugging purposes.
The list of messages reported during the course of a run
may be displayed by calling routine
show_errors
.
The error_status
variable returns the highest severity
level that has been encountered; if a severe error is flagged
(level 3) the program is terminated immediately.
None
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | public | :: | errors_on | ||||
integer, | private, | parameter | :: | ERROR_OKAY | = | 0 | |
integer, | private, | parameter | :: | ERROR_INFO | = | 1 | |
integer, | private, | parameter | :: | ERROR_WARN | = | 2 | |
integer, | private, | parameter | :: | ERROR_SEVERE | = | 3 | |
integer, | private | :: | error_id | error_id : identifier for final message encountered |
|||
integer, | public | :: | error_status | error_status : overall status flag for a run; on exit:
|
|||
integer, | private, | parameter | :: | INT_DEFAULT | = | -999999 | |
real(kind=dp), | private, | parameter | :: | FLT_DEFAULT | = | real(INT_DEFAULT, kind(1.0D0)) | |
integer, | public, | dimension(8) | :: | idiags | |||
real(kind=dp), | public, | dimension(8) | :: | fdiags | |||
type(error_list_item), | private, | pointer | :: | error_head | |||
type(error_list_item), | private, | pointer | :: | error_tail | |||
type(error), | private, | allocatable, dimension(:) | :: | error_type |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | level | ||||
character(len=200), | public | :: | message | ||||
integer, | public, | dimension(8) | :: | idiags | = | INT_DEFAULT | |
real(kind=dp), | public, | dimension(8) | :: | fdiags | = | FLT_DEFAULT |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | id | ||||
type(error), | public | :: | data | ||||
type(error_list_item), | public, | pointer | :: | ptr |
Initialise the error_handling module variables
Initialises the informational/error message list author: P J Knight, CCFE, Culham Science Centre None This routine sets all the possible informational/error messages that may be used during the course of a run. Thus, it needs to be called during the initialisation phase.
The error messages are read in from a JSON-format file. None
Adds the latest error message to the list already specified author: P J Knight, CCFE, Culham Science Centre error_id : input integer : identifier (error_type element number) for the relevant error This routine should be called if a informational, warning or error message needs to be flagged. It uses a linked list (see references) to provide an audit trail for any such messages during the program execution.
Up to eight integer and eight floating-point diagnostic
values may be saved by the user in arrays idiags
and
fdiags
, respectively, for debugging; these arrays must
be assigned with up to eight values each prior to calling this routine.
The error_status
variable returns the highest severity
level that has been encountered; if a severe error is flagged
(level 3) the program is terminated immediately.
Introduction to Fortran 90/95, Stephen J, Chapman, pp.467-472,
McGraw-Hill, ISBN 0-07-115896-0
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | error_id |
Reports all informational/error messages encountered author: P J Knight, CCFE, Culham Science Centre None This routine provides a summary audit trail of all the errors encountered during the program's execution. Introduction to Fortran 90/95, Stephen J, Chapman, pp.467-472, McGraw-Hill, ISBN 0-07-115896-0