module bianchi_error_mod ! Uses use s2_types_mod, only: S2_STRING_LEN ! Variables integer, private, parameter :: BIANCHI_ERROR_NUM = 12 integer, public, parameter :: BIANCHI_ERROR_NONE = 0 integer, public, parameter :: BIANCHI_ERROR_INIT = 1 integer, public, parameter :: BIANCHI_ERROR_NOT_INIT = 2 integer, public, parameter :: BIANCHI_ERROR_INIT_FAIL = 3 integer, public, parameter :: BIANCHI_ERROR_MEM_ALLOC_FAIL = 4 integer, public, parameter :: BIANCHI_ERROR_SKY_QUAD_INVALID = 5 integer, public, parameter :: BIANCHI_ERROR_SKY_QUAD_STEP_EXCEED = 6 integer, public, parameter :: BIANCHI_ERROR_SKY_N_MISSING = 7 integer, public, parameter :: BIANCHI_ERROR_SIM_PARAM_INVALID = 8 integer, public, parameter :: BIANCHI_ERROR_SIM_NARG = 9 integer, public, parameter :: BIANCHI_ERROR_PLM1TABLE_THETA_INVALID = 10 integer, public, parameter :: BIANCHI_ERROR_PLM1TABLE_L_INVALID = 11 character (len=S2_STRING_LEN), private, parameter, dimension (BIANCHI_ERROR_NUM) :: error_comment = (/ 'No error ', 'Attempt to initialise object that has already been initialised ', 'Object not initialised ', 'Object initialisation failed ', 'Memory allocation failed ', 'Quadrature type invalid ', 'Exceeded number of steps limit whem computing quadrature ', 'Must specify N if using direct quadrature ', 'Invalid simulation parameter ', 'Invalid number of command line parameters ', 'Invalid theta for Plm1 lookup table (not on regular grid) ', 'Invalid l for Plm1 lookup table (out of range) ' /) logical, private, parameter, dimension (BIANCHI_ERROR_NUM) :: halt_default = (/ .false., .true., .true., .true., .true., .true., .true., .true., .true., .true., .true., .true. /) ! Subroutines and functions public subroutine bianchi_error (error_code, procedure, comment_add, comment_out, halt_in) end module bianchi_error_modFunctionality to handle errors that may occur in the bianchi library. Public bianchi error codes are defined, with corresponding private error comments and default halt execution status.
Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)
Version: 0.1 June 2005
integer, private, parameter :: BIANCHI_ERROR_NUM = 12
integer, public, parameter :: BIANCHI_ERROR_NONE = 0
integer, public, parameter :: BIANCHI_ERROR_INIT = 1
integer, public, parameter :: BIANCHI_ERROR_NOT_INIT = 2
integer, public, parameter :: BIANCHI_ERROR_INIT_FAIL = 3
integer, public, parameter :: BIANCHI_ERROR_MEM_ALLOC_FAIL = 4
integer, public, parameter :: BIANCHI_ERROR_SKY_QUAD_INVALID = 5
integer, public, parameter :: BIANCHI_ERROR_SKY_QUAD_STEP_EXCEED = 6
integer, public, parameter :: BIANCHI_ERROR_SKY_N_MISSING = 7
integer, public, parameter :: BIANCHI_ERROR_SIM_PARAM_INVALID = 8
integer, public, parameter :: BIANCHI_ERROR_SIM_NARG = 9
integer, public, parameter :: BIANCHI_ERROR_PLM1TABLE_THETA_INVALID = 10
integer, public, parameter :: BIANCHI_ERROR_PLM1TABLE_L_INVALID = 11
character (len=S2_STRING_LEN), private, parameter, dimension (BIANCHI_ERROR_NUM) :: error_comment = (/ 'No error ', 'Attempt to initialise object that has already been initialised ', 'Object not initialised ', 'Object initialisation failed ', 'Memory allocation failed ', 'Quadrature type invalid ', 'Exceeded number of steps limit whem computing quadrature ', 'Must specify N if using direct quadrature ', 'Invalid simulation parameter ', 'Invalid number of command line parameters ', 'Invalid theta for Plm1 lookup table (not on regular grid) ', 'Invalid l for Plm1 lookup table (out of range) ' /)Comment associated with each error type.
logical, private, parameter, dimension (BIANCHI_ERROR_NUM) :: halt_default = (/ .false., .true., .true., .true., .true., .true., .true., .true., .true., .true., .true., .true. /)Default program halt status of each error type.
public subroutine bianchi_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 bianchi_errorDisplay error message corresponding to error_code and halt program execution if required.
Variables:
Author: J. D. McEwen
Version: 0.1 August 2004