Contains functionality for error handling
| enumerator | :: | ERRORS_RETURN | = | 0 | |
| enumerator | :: | ERRORS_ARE_FATAL | = | 1 |
Enumerator defining the error mode
Specifies additional user defined output for an error message that contains more than a simple message. May have a descriptive string and one dimensional integer and real arrays to print out variables.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | c_info |
Additional user defined string message |
||
| integer, | public, | dimension(:), allocatable | :: | i_info |
Additional user defined integer variables |
||
| real(kind=FP), | public, | dimension(:), allocatable | :: | r_info |
Additional user defined real variables |
| procedure, public :: print => print_error_info |
Type that can be used to handle errors for multiple code instances at once. Each calling code may create a singleton instance of this type. There is no initialize routine, the instance should be initialized via the constructor.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=32), | public | :: | handler_name |
Name of the error handler instance |
|||
| integer, | public | :: | error_mode |
Error mode chosen, can be either ERRORS_RETURN or ERRORS_ARE_FATAL |
|||
| integer, | public | :: | netcdf_error_code |
Error code that is associated with NetCDF errors. Used when handling NetCDF errors. |
|||
| logical, | public | :: | first_time_warning | = | .true. |
Indicates that a warning has already been printed before or not |
| procedure, public :: set_error_mode => error_handler_set_error_mode | |
| procedure, public :: handle_error => error_handler_handle_error | |
| procedure, public :: handle_error_netcdf => error_handler_handle_error_netcdf |
Sets the way PARALLAX responds to internal errors. When set to errors return, the error is logged into stderr without program termination, expecting that the error will be handled by the calling routine. When set to errors are fatal, the code will be terminated with error stop.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | err_mode |
Error mode: Use ERRORS_RETURN or ERRORS_ARE_FATAL. Other values are ignored and ERRORS_ARE_FATAL is used. |
Logs an error to stderr and stops the program. If status_code is PARALLAX_SUCCESS, this subroutine will do nothing.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | message |
Error or warning message |
||
| integer, | intent(in) | :: | status_code |
Error or warning code |
||
| integer, | intent(in) | :: | line_number |
Line number where error or warning occured, i.e. LINE |
||
| character(len=*), | intent(in) | :: | file_name |
File name where error or warning occured, i.e. FILE |
||
| type(error_info_t), | intent(in), | optional | :: | additional_info |
Additional information |
Wrapper of handle error for calls of NetCDF functions. Checks for NetCDF errors and prints a standardized error message.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | istatus |
Status integer returned by the NetCDF function |
||
| integer, | intent(in) | :: | line_number |
Line number where error or warning occured, i.e. LINE |
||
| character(len=*), | intent(in) | :: | file_name |
File name where error or warning occured, i.e. FILE |