append_ga_dynlong_vec Subroutine

public subroutine append_ga_dynlong_vec(me, val, length)

Arguments

Type IntentOptional Attributes Name
type(grw_dynlongarray_type) :: me
type(dyn_longarray_type), intent(in) :: val(:)
integer, intent(in), optional :: length

optional length to expand the array


Calls

proc~~append_ga_dynlong_vec~~CallsGraph proc~append_ga_dynlong_vec append_ga_dynlong_vec interface~expand~2 expand proc~append_ga_dynlong_vec->interface~expand~2 proc~expand_ga_dynlong expand_ga_dynlong interface~expand~2->proc~expand_ga_dynlong

Called by

proc~~append_ga_dynlong_vec~~CalledByGraph proc~append_ga_dynlong_vec append_ga_dynlong_vec interface~append~2 append interface~append~2->proc~append_ga_dynlong_vec proc~single_process_element single_process_element proc~single_process_element->interface~append~2 proc~identify_local_element identify_local_element proc~single_process_element->proc~identify_local_element proc~request_remotehalos request_remoteHalos proc~request_remotehalos->interface~append~2 proc~create_allparentneighbors create_allParentNeighbors proc~request_remotehalos->proc~create_allparentneighbors proc~identify_halo identify_halo proc~request_remotehalos->proc~identify_halo proc~identify_stencilneigh identify_stencilNeigh proc~request_remotehalos->proc~identify_stencilneigh proc~tem_find_bcs_fromfiner tem_find_BCs_fromFiner proc~tem_find_bcs_fromfiner->interface~append~2 proc~add_ghostfromfiner add_ghostFromFiner proc~add_ghostfromfiner->interface~append~2 proc~add_ghostfromfiner->proc~tem_find_bcs_fromfiner proc~add_ghostfromfiner->proc~add_ghostfromfiner proc~tem_init_elemlevels tem_init_elemLevels proc~tem_init_elemlevels->interface~append~2 proc~appendghostdependency appendGhostDependency proc~appendghostdependency->interface~append~2 proc~append_element append_element proc~append_element->interface~append~2 proc~add_all_virtual_children add_all_virtual_children proc~add_all_virtual_children->interface~append~2 proc~add_all_virtual_children->proc~add_all_virtual_children proc~tem_adapt_dump_newmesh tem_adapt_dump_newMesh proc~tem_adapt_dump_newmesh->interface~append~2 proc~identify_local_element->interface~append~2 proc~identify_local_element->proc~add_ghostfromfiner proc~identify_local_element->proc~add_all_virtual_children proc~create_allparentneighbors->interface~append~2 proc~identify_elements identify_elements proc~create_allparentneighbors->proc~identify_elements proc~create_allparentneighbors->proc~identify_stencilneigh proc~identify_elements->interface~append~2 proc~identify_elements->proc~single_process_element proc~identify_elements->proc~create_allparentneighbors proc~identify_elements->proc~identify_elements proc~identify_elements->proc~identify_stencilneigh proc~tem_halo_append tem_halo_append proc~tem_halo_append->interface~append~2 proc~redefine_halos redefine_halos proc~redefine_halos->interface~append~2 proc~tem_stencil_communicate tem_stencil_communicate proc~redefine_halos->proc~tem_stencil_communicate proc~tem_stencil_communicate->interface~append~2 proc~depsource_append depSource_append proc~depsource_append->interface~append~2 proc~communicate_elements communicate_elements proc~communicate_elements->proc~request_remotehalos proc~communicate_elements->proc~redefine_halos proc~identify_lists identify_lists proc~communicate_elements->proc~identify_lists proc~identify_halo->proc~identify_local_element proc~tem_create_leveldesc tem_create_levelDesc proc~tem_create_leveldesc->proc~tem_init_elemlevels proc~tem_build_verticaldependencies tem_build_verticalDependencies proc~tem_create_leveldesc->proc~tem_build_verticaldependencies proc~build_levelelements build_levelElements proc~build_levelelements->proc~identify_elements proc~identify_additionalneigh identify_additionalNeigh proc~build_levelelements->proc~identify_additionalneigh interface~append~45 append interface~append~45->proc~append_element proc~tem_build_verticaldependencies->proc~appendghostdependency proc~identify_stencilneigh->proc~identify_elements proc~identify_additionalneigh->proc~identify_elements proc~identify_lists->proc~tem_halo_append proc~tem_find_allelements tem_find_allElements proc~tem_find_allelements->proc~communicate_elements proc~tem_find_allelements->proc~build_levelelements proc~tem_find_allelements->proc~identify_additionalneigh proc~tem_find_allelements->proc~identify_lists proc~tem_dimbydim_construction tem_dimByDim_construction proc~tem_dimbydim_construction->proc~tem_create_leveldesc

Contents

Source Code


Source Code

  subroutine append_ga_dynlong_vec(me, val, length)
    type(grw_dynlongarray_type) :: me !< array to append the value to
    type(dyn_longarray_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_dynlong_vec