append_ga_stringkeyvaluepair_vec Subroutine

private subroutine append_ga_stringkeyvaluepair_vec(me, val, length)

Arguments

Type IntentOptional AttributesName
type(grw_stringkeyvaluepairarray_type) :: me
type(tem_stringKeyValuePair_type), intent(in) :: val(:)
integer, intent(in), optional :: length

optional length to expand the array


Calls

proc~~append_ga_stringkeyvaluepair_vec~~CallsGraph proc~append_ga_stringkeyvaluepair_vec append_ga_stringkeyvaluepair_vec interface~expand~7 expand proc~append_ga_stringkeyvaluepair_vec->interface~expand~7 proc~expand_ga_stringkeyvaluepair expand_ga_stringkeyvaluepair interface~expand~7->proc~expand_ga_stringkeyvaluepair

Called by

proc~~append_ga_stringkeyvaluepair_vec~~CalledByGraph proc~append_ga_stringkeyvaluepair_vec append_ga_stringkeyvaluepair_vec interface~append~9 append interface~append~9->proc~append_ga_stringkeyvaluepair_vec proc~tem_variable_loadmapping_single tem_variable_loadMapping_single proc~tem_variable_loadmapping_single->interface~append~9 proc~tem_create_varmap tem_create_varMap proc~tem_create_varmap->interface~append~9 proc~append_possible_variable append_possible_variable proc~append_possible_variable->interface~append~9 proc~tem_load_bc_state tem_load_bc_state proc~tem_load_bc_state->interface~append~9 interface~tem_variable_loadmapping tem_variable_loadMapping proc~tem_load_bc_state->interface~tem_variable_loadmapping proc~hvs_output_init hvs_output_init proc~hvs_output_init->proc~tem_create_varmap proc~tem_opvar_reduction_transient_init tem_opVar_reduction_transient_init proc~tem_opvar_reduction_transient_init->proc~tem_create_varmap proc~tem_variable_loadmapping_vector tem_variable_loadMapping_vector proc~tem_variable_loadmapping_vector->proc~tem_variable_loadmapping_single proc~tem_init_tracker tem_init_tracker proc~tem_init_tracker->proc~tem_create_varmap proc~tem_init_tracker->proc~hvs_output_init interface~tem_variable_loadmapping->proc~tem_variable_loadmapping_single interface~tem_variable_loadmapping->proc~tem_variable_loadmapping_vector proc~tem_init_depend tem_init_depend proc~tem_init_depend->proc~tem_create_varmap interface~append~37 append interface~append~37->proc~append_possible_variable proc~tem_init_convergence tem_init_convergence proc~tem_init_convergence->proc~tem_create_varmap

Contents


Source Code

  subroutine append_ga_stringkeyvaluepair_vec(me, val, length)
    type(grw_stringkeyvaluepairarray_type) :: me !< array to append the value to
    type(tem_stringkeyvaluepair_type), intent(in) :: val(:) !< values to append
    !> optional length to expand the array
    integer, intent(in), optional :: length

    integer :: lb, ub, ii

    if (me%nvals == huge(me%nvals)) then
      write(*,*) "reached end of integer range for growing array!"
      write(*,*) "aborting!!"
      stop
    end if

    lb = me%nvals + 1
    ub = lb + size(val) - 1

    if (ub > me%containersize) then
      ! expand the array, if its boundary is reached
      call expand(me = me, pos = ub, length = length)
    end if

    me%nvals = max( ub, me%nvals )
    do ii = lb, ub
      me%val(ii) = val(1+ii-lb)
    end do

  end subroutine append_ga_stringkeyvaluepair_vec