CP2K 2.4 (Revision 12889)
Classes | Namespaces | Functions | Variables

cp_error_handling.f90 File Reference

Go to the source code of this file.

Classes

struct  cp_error_handling::cp_error_type
 this type represent a structure that can be passed to the functions to change their error behaviour. It should always be initialized with cp_error_init before use More...

Namespaces

namespace  cp_error_handling
 

Module that contains the routines for error handling The idea is that in general routines have an optional parameter that can be used to change the error behaviour.


Functions

subroutine, public cp_error_handling::cp_error_init (error, stop_level, print_level, logger, template_error, error_nr, level)
 Initializes the error structure error. The optional arguments initialize the values in the structure. Default values: stop_level=2, logger=null (i.e. default logger)
subroutine, public cp_error_handling::cp_error_reset (error)
 if the optional parameter error is present resets its level and error_nr to 0 (is tipically called when you want to discard the previous errors stored in error, i.e. not often)
subroutine, public cp_error_handling::cp_error_set (error, level, error_nr, stop_level, print_level, logger, template_error, info)
 routine to set the various components of the error structure
subroutine, public cp_error_handling::cp_error_dealloc_ref (err_to_free, error)
 Deallocates the memory allocated by the error.
subroutine, public cp_error_handling::cp_error_get (error, level, error_nr, stop_level, print_level, logger, info)
 returns the various attributes of the given error
INTEGER, public cp_error_handling::cp_error_get_level (error)
 gets the error level from the given error
INTEGER, public cp_error_handling::cp_error_get_print_level (error)
 gets the print level (starting with which errorlevel something gets printed) from the given error if the error is not present returns cp_note_level
INTEGER, public cp_error_handling::cp_error_get_nr (error)
 gets the error number from the given error
TYPE(cp_logger_type), pointer,
public 
cp_error_handling::cp_error_get_logger (error)
 gets the logger of the given error. The error argument is optional, so you can get the logger of an optional dummy argument. If the error is not present or its logger is not associated returns the default logger.
INTEGER, public cp_error_handling::cp_error_get_stop_level (error)
 gets the error level at which the error will stop the programm If the error is not present returns cp_failure_level
subroutine cp_error_handling::cp_error_common_stop (fromWhere, message)
 a subroutine that call just stop, useful because all the failures fails calling this routine: the right point to set a breakpoint
subroutine, public cp_error_handling::cp_error_handle_error (error, fromWhere, message, ionode)
 all the error situations at the end should call this routine
subroutine, public cp_error_handling::cp_error_message (level, fromWhere, message, error)
 writes an error message of level level, subject to control of error (i.e. if errorprintlevel is >= level)
subroutine, public cp_error_handling::cp_assert (condition, level, error_nr, fromWhere, message, error, failure, info, only_ionode)
 routine that checks an assertion, if it fails set the optional argument failure is given sets it to true. This can be used to do many assertion one fater the other and check at the end if one failed.
subroutine, public cp_error_handling::cp_error_propagate_error (iError, fromWhere, message, error, failure, failure_level)
 if the internal error iError of a subroutine has an error levele that is at least failure_level(i.e. if there was a serious error in the subroutine) propagates the error to the actual error (i.e. sets error to the same error than iError) and sets failure to true if a failure more severe than warning happened
subroutine, public cp_error_handling::cp_unimplemented_error (fromWhere, message, error, error_level)
 comodity call to signat that something is not implemented
subroutine, public cp_error_handling::cp_error_synchronize_error (error, para_env)
 synchronizes the error values between different processors (propagating an eventual failure to each processor)
subroutine, public cp_error_handling::cp_a_l (condition, level, fromWhere, lineNr, error, failure)
 assert with linenumber (to be used with the assertion macros to keep the line short)
subroutine, public cp_error_handling::cp_error_check (error, failure)
 if error is present sets failure to true if an error did happen
subroutine, public cp_error_handling::cp_simple_assert (condition, routineP, line)
 simple assert

Variables

LOGICAL, parameter, private cp_error_handling::debug_this_module = .FALSE.
CHARACTER(len=*), parameter,
private 
cp_error_handling::moduleN = 'cp_error_handling'
LOGICAL, parameter, public cp_error_handling::cp_debug = .FALSE.
INTEGER, parameter, public cp_error_handling::cp_no_error = 0
INTEGER, parameter, public cp_error_handling::cp_caller_error = 1
INTEGER, parameter, public cp_error_handling::cp_wrong_args_error = 100
INTEGER, parameter, public cp_error_handling::cp_precondition_failed = 200
INTEGER, parameter, public cp_error_handling::cp_internal_error = -1
INTEGER, parameter, public cp_error_handling::cp_postcondition_failed = -200
INTEGER, parameter, public cp_error_handling::cp_invariant_failed = -100
INTEGER, parameter, public cp_error_handling::cp_assertion_failed = -300
INTEGER, parameter, public cp_error_handling::cp_unimplemented_error_nr = -1000