NTPoly
Data Types | Functions/Subroutines
errormodule Module Reference

A (under development) module to do handle error passing. More...

Data Types

interface  error_t
 A type that can be passed around to accumulate errors. More...
 

Functions/Subroutines

subroutine, public setgenericerror (this, error_description, immediate_cleanup_in)
 Routine to call if a generic error has occurred. More...
 
logical function, public checkmpierror (this, error_description, mpi_error, immediate_cleanup_in)
 Routine to call to check if an MPI error has occurred. More...
 
logical function, public checkallocerror (this, error_description, alloc_error, immediate_cleanup_in)
 Routine to call if an alloc error has occurred. More...
 
logical function, public erroroccurred (this)
 Check if an error has occurred or not. More...
 
recursive subroutine, public printerror (this)
 Print out that an error has occurred. More...
 
subroutine, public cleanup (this)
 As a last case resort, this will print an error message and quit. More...
 

Detailed Description

A (under development) module to do handle error passing.

Function/Subroutine Documentation

◆ checkallocerror()

logical function, public errormodule::checkallocerror ( type(error_t), intent(inout)  this,
character(len=*), intent(in)  error_description,
integer, intent(in)  alloc_error,
logical, intent(in), optional  immediate_cleanup_in 
)

Routine to call if an alloc error has occurred.

Parameters
[in,out]thisthe error variable to be set.
[in]error_descriptionsome string describing the details of the error.
[in]alloc_errorthe error variable produced by alloc.
[in]immediate_cleanup_inif true, the cleanup error handler is called.
Returns
true if an error has occurred, false otherwise.

◆ checkmpierror()

logical function, public errormodule::checkmpierror ( type(error_t), intent(inout)  this,
character(len=*), intent(in)  error_description,
integer, intent(in)  mpi_error,
logical, intent(in), optional  immediate_cleanup_in 
)

Routine to call to check if an MPI error has occurred.

Parameters
[in,out]thisthe error variable to be set.
[in]error_descriptionsome string describing the details of the error.
[in]mpi_errorthe error variable produced by mpi.
[in]immediate_cleanup_inif true, the cleanup error handler is called.
Returns
true if an error has occurred, false otherwise.

◆ cleanup()

subroutine, public errormodule::cleanup ( type(error_t), intent(in)  this)

As a last case resort, this will print an error message and quit.

Parameters
[in]thisthe error which has caused the need to cleanup the program.

◆ erroroccurred()

logical function, public errormodule::erroroccurred ( type(error_t), intent(in)  this)

Check if an error has occurred or not.

Parameters
[in]thisthe error variable to check.
Returns
true if an error has occurred, false otherwise.

◆ printerror()

recursive subroutine, public errormodule::printerror ( type(error_t), intent(in)  this)

Print out that an error has occurred.

Parameters
[in]thisthe error to print out.

◆ setgenericerror()

subroutine, public errormodule::setgenericerror ( type(error_t), intent(inout)  this,
character(len=*), intent(in)  error_description,
logical, intent(in), optional  immediate_cleanup_in 
)

Routine to call if a generic error has occurred.

Parameters
[in,out]thisthe error variable to be set.
[in]error_descriptionsome string describing the details of the error.
[in]immediate_cleanup_inif true, the cleanup error handler is called.