append_ga_dynlong_vec Subroutine

public subroutine append_ga_dynlong_vec(me, val, length)


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

optional length to expand the array


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

Called by

proc~~append_ga_dynlong_vec~~CalledByGraph proc~append_ga_dynlong_vec append_ga_dynlong_vec interface~append~5 append interface~append~5->proc~append_ga_dynlong_vec proc~append_element append_element proc~append_element->interface~append~5 proc~tem_halo_append tem_halo_append proc~tem_halo_append->interface~append~5 program~derivedtype_memalloc derivedType_memAlloc program~derivedtype_memalloc->interface~append~5 interface~append~39 append interface~append~39->proc~append_element proc~identify_lists identify_lists proc~identify_lists->proc~tem_halo_append proc~communicate_elements communicate_elements proc~communicate_elements->proc~identify_lists proc~tem_find_allelements tem_find_allElements proc~tem_find_allelements->proc~identify_lists


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!!"
    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