module comb_error_mod ! Uses use s2_types_mod, only: S2_STRING_LEN ! Variables integer, private, parameter :: COMB_ERROR_NUM = 9 integer, public, parameter :: COMB_ERROR_NONE = 0 integer, public, parameter :: COMB_ERROR_INIT = 1 integer, public, parameter :: COMB_ERROR_NOT_INIT = 2 integer, public, parameter :: COMB_ERROR_INIT_FAIL = 3 integer, public, parameter :: COMB_ERROR_OBJ_MOTHER_INVALID = 4 integer, public, parameter :: COMB_ERROR_CSKY_LMAX_NOT_DEF = 5 integer, public, parameter :: COMB_ERROR_CSIM_NARG = 6 integer, public, parameter :: COMB_ERROR_CSIM_PARAM_INVALID = 7 integer, public, parameter :: COMB_ERROR_TMPL_PARAM_INVALID = 8 character (len=S2_STRING_LEN), private, parameter, dimension (COMB_ERROR_NUM) :: error_comment = (/ 'No error ', 'Attempt to initialise object that has already been initialised ', 'Object not initialised ', 'Object initialisation failed ', 'Invalid comb mother obj to generate new obj from ', 'Lmax not defined when required ', 'Invalid number of input parameters ', 'Invalid input parameter ', 'Invalid number of input parameters in template function ' /) logical, private, parameter, dimension (COMB_ERROR_NUM) :: halt_default = (/ .false., .true., .true., .true., .true., .true., .true., .true., .true. /) ! Subroutines and functions public subroutine comb_error (error_code, procedure, comment_add, comment_out, halt_in) end module comb_error_modFunctionality to handle errors that may occur in the comb library. Public comb error codes are defined, with corresponding private error comments and default halt execution status.
Author: J. D. McEwen (mcewen[AT]mrao.cam.ac.uk)
Version: 0.1 August 2004
integer, private, parameter :: COMB_ERROR_NUM = 9
integer, public, parameter :: COMB_ERROR_NONE = 0
integer, public, parameter :: COMB_ERROR_INIT = 1
integer, public, parameter :: COMB_ERROR_NOT_INIT = 2
integer, public, parameter :: COMB_ERROR_INIT_FAIL = 3
integer, public, parameter :: COMB_ERROR_OBJ_MOTHER_INVALID = 4
integer, public, parameter :: COMB_ERROR_CSKY_LMAX_NOT_DEF = 5
integer, public, parameter :: COMB_ERROR_CSIM_NARG = 6
integer, public, parameter :: COMB_ERROR_CSIM_PARAM_INVALID = 7
integer, public, parameter :: COMB_ERROR_TMPL_PARAM_INVALID = 8
character (len=S2_STRING_LEN), private, parameter, dimension (COMB_ERROR_NUM) :: error_comment = (/ 'No error ', 'Attempt to initialise object that has already been initialised ', 'Object not initialised ', 'Object initialisation failed ', 'Invalid comb mother obj to generate new obj from ', 'Lmax not defined when required ', 'Invalid number of input parameters ', 'Invalid input parameter ', 'Invalid number of input parameters in template function ' /)Comment associated with each error type.
logical, private, parameter, dimension (COMB_ERROR_NUM) :: halt_default = (/ .false., .true., .true., .true., .true., .true., .true., .true., .true. /)Default program halt status of each error type.
public subroutine comb_error (error_code, procedure, comment_add, comment_out, halt_in) integer, intent(in) :: error_code character (len=*), optional, intent(in) :: procedure character (len=*), optional, intent(in) :: comment_add character (len=*), optional, intent(inout) :: comment_out logical, optional, intent(in) :: halt_in end subroutine comb_errorDisplay error message corresponding to error_code and halt program execution if required.
Variables:
Author: J. D. McEwen
Version: 0.1 August 2004