fill_components Subroutine

private recursive subroutine fill_components(me, tree, no_cmp)

Arguments

Type IntentOptional Attributes Name
type(input_t), intent(inout) :: me
class(type_node), intent(in), pointer :: tree
type(type_dictionary), intent(inout) :: no_cmp

Calls

proc~~fill_components~~CallsGraph proc~fill_components fill_components proc~fill_components->proc~fill_components cmp_arr cmp_arr proc~fill_components->cmp_arr get get proc~fill_components->get get_string get_string proc~fill_components->get_string key key proc~fill_components->key proc~abort_if abort_if proc~fill_components->proc~abort_if proc~increment_int_dict increment_int_dict proc~fill_components->proc~increment_int_dict proc~select_dict select_dict proc~fill_components->proc~select_dict set_path set_path proc~fill_components->set_path proc~increment_int_dict->proc~abort_if get_integer get_integer proc~increment_int_dict->get_integer interface~to_str to_str proc~increment_int_dict->interface~to_str set_string set_string proc~increment_int_dict->set_string proc~str_from_int str_from_int interface~to_str->proc~str_from_int proc~str_from_real str_from_real interface~to_str->proc~str_from_real

Called by

proc~~fill_components~~CalledByGraph proc~fill_components fill_components proc~fill_components->proc~fill_components proc~input_open_yaml input_t%input_open_yaml proc~input_open_yaml->proc~fill_components

Source Code

recursive subroutine fill_components(me,tree,no_cmp)
    type(input_t),            intent(inout) :: me
    class(type_node), pointer, intent(in)    :: tree
    type(type_dictionary),     intent(inout) :: no_cmp

    type(input_t),pointer :: new_dict
    class(type_node),pointer     :: tmp
    type(type_error),allocatable :: err
    type(type_key_value_pair), pointer :: pair
    type(type_list_item), pointer :: item
    character(:), allocatable :: type
    type(type_dictionary),pointer :: cmp
    integer :: nb

    select type(tree)
    class is(type_dictionary)
        pair => tree%first
        do while(associated(pair))
            if(pair%key(1:1)/='!') then
                call fill_components(me,pair%value,no_cmp)
            endif
            pair=>pair%next
        enddo
    class is(type_list)
        item => tree%first
        do while(associated(item))
            ! Adding elements to array in dictionary and increase size
            cmp => select_dict(item%node)
            type = cmp%get_string('type',error=err)
            call abort_if(err)
            allocate(new_dict)
            new_dict%root => cmp
            tmp => me%cmp_by_type%get(type)
            nb = increment_int_dict(no_cmp,type)
            select type(tmp); class is(input_t)
                call new_dict%root%set_path(type)
                tmp%cmp_arr(nb) = new_dict
            end select
            item => item%next
            nullify(new_dict)
        enddo
    end select
end subroutine fill_components