| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(type_node), | intent(inout), | pointer | :: | cmp_tree | ||
| type(type_dictionary), | intent(inout) | :: | no_cmp | |||
| character(len=*), | intent(in) | :: | prefix | |||
| character(len=*), | intent(in) | :: | postfix |
recursive subroutine rename_components(cmp_tree,no_cmp,prefix,postfix) class(type_node), pointer, intent(inout) :: cmp_tree type(type_dictionary), intent(inout) :: no_cmp character(*), intent(in) :: prefix, postfix type(type_error),allocatable :: err type(type_key_value_pair), pointer :: pair type(type_list_item), pointer :: item character(:), allocatable :: prefix1, postfix1, type_name type(type_dictionary),pointer :: cmp integer :: ln select type(cmp_tree) class is(type_dictionary) pair => cmp_tree%first do while(associated(pair)) ln = len(pair%key) prefix1 = prefix postfix1 = postfix if (ln>2 .and. pair%key(1:1)=='_') then postfix1 = postfix//pair%key(2:ln) endif if (ln>2 .and. pair%key(ln:ln)=='_') then prefix1 = pair%key(1:ln-1)//prefix endif if(pair%key(1:1)/='.') then call rename_components(pair%value,no_cmp,prefix1,postfix1) endif pair=>pair%next enddo class is(type_list) item => cmp_tree%first do while(associated(item)) ! add elements to no_cmp an calculate size cmp => select_dict(item%node) type_name = cmp%get_string('type',error=err) call abort_if(err) ln = no_cmp%get_integer(type_name,-1,err) if(ln == -1) then call no_cmp%set_string(type_name,'0') endif ln = increment_int_dict(no_cmp,type_name) ! renaming main id an connection id call rename_id(cmp,prefix,postfix) item => item%next enddo end select end subroutine rename_components