returns sub-dictionary by traversing from top level dictionary using key separation sign: '/'
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(type_dictionary), | intent(inout), | pointer | :: | dict | ||
| character(len=*), | intent(inout) | :: | key |
recursive subroutine dictionary_traverse(dict,key) !! returns sub-dictionary by traversing from top level dictionary using key !! separation sign: '/' type(type_dictionary), pointer, intent(inout) :: dict character(*), intent(inout) :: key integer :: key_len type(type_error), allocatable :: err key_len = index(key,'/') if (key_len /= 0) then dict => dict%get_dictionary(key(:key_len-1),.true.,err) call abort_if(err,' Key: '//key) key = key(key_len+1:) call dictionary_traverse(dict,key) endif end subroutine dictionary_traverse