Define an type to represent an initialisation level. This uses a hack to approximate type extension without the boiler plate of extending an abstract type. Specifically, we offer a type bound change_level procedure which just calls a procedure pointer to implement the actual work to change the level, specific to each instance.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=40), | public | :: | name | = | 'init level name not set' | ||
integer, | public | :: | level | = | -1 | ||
integer, | public | :: | debug_message_level | = | 1 |
Used to set the verbosity level at which this level reports debug messages. |
|
procedure(change_level_specific_interface), | private, | pointer, nopass | :: | change_level_specific | => | null() | |
real, | public, | dimension(2) | :: | time_init | = | 0. |
Produce the debug message associated with this level
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(init_level_type), | intent(in) | :: | self | |||
logical, | intent(in) | :: | going_up |
Report the time spent in init for this level
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(init_level_type), | intent(in) | :: | self | |||
integer, | intent(in), | optional | :: | unit |
General wrapper to the init_level instance's specific change level method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(init_level_type), | intent(inout) | :: | self | |||
type(init_type), | intent(in) | :: | current | |||
logical, | intent(in) | :: | going_up |
type :: init_level_type
character(len=40) :: name = 'init level name not set'
integer :: level = -1
!> Used to set the verbosity level at which this
!> level reports debug messages.
integer :: debug_message_level = 1
procedure(change_level_specific_interface), pointer, nopass, private :: change_level_specific => null()
real, dimension(2) :: time_init = 0.
contains
procedure :: generate_debug_message => init_level_generate_debug_message
procedure :: report_time => init_level_report_time
procedure :: change_level => init_level_change_level
end type init_level_type