Fully initialise the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index | ||
logical, | intent(in), | optional | :: | skip_smart_defaults | ||
logical, | intent(in), | optional | :: | skip_read | ||
logical, | intent(in), | optional | :: | skip_broadcast |
subroutine init_generic(self, name, requires_index, index, skip_smart_defaults, &
skip_read, skip_broadcast)
use optionals, only: get_option_with_default
implicit none
class(abstract_config_type), intent(inout) :: self
character(len = *), intent(in), optional :: name
logical, intent(in), optional :: requires_index
integer, intent(in), optional :: index
logical, intent(in), optional :: skip_smart_defaults, skip_read, skip_broadcast
if (self%is_initialised()) return
if (.not. get_option_with_default(skip_smart_defaults, self%skip_smart_defaults)) &
call self%set_smart_defaults
call self%setup(name, requires_index, index)
if (.not. get_option_with_default(skip_read, self%skip_read)) call self%read()
if (.not. get_option_with_default(skip_broadcast, self%skip_broadcast)) call self%broadcast()
self%initialised = .true.
end subroutine init_generic