append_ga_grw_stencilelement Subroutine

private subroutine append_ga_grw_stencilelement(me, val, length)

Arguments

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

optional length to expand the array


Calls

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

Called by

proc~~append_ga_grw_stencilelement~~CalledByGraph proc~append_ga_grw_stencilelement append_ga_grw_stencilelement interface~append~24 append interface~append~24->proc~append_ga_grw_stencilelement

Contents


Source Code

  subroutine append_ga_grw_stencilelement(me, val, length)
    type(grw_grw_stencilelementarray_type) :: me !< array to append the value to
    type(grw_stencilelementarray_type), intent(in) :: val !< value to append
    !> optional length to expand the array
    integer, intent(in), optional :: length

    ! value to append is larger than all existing ones,
    ! just put it to the end of the list, this captures
    ! also the case of empty lists.
    ! in this case foundpos = me%nvals + 1 holds.
    if (me%nvals+1 > me%containersize) then
      ! expand the array, if its boundary is reached
      call expand(me = me, length = length)
    end if

    me%nvals = me%nvals+1
    me%val(me%nvals) = val

  end subroutine append_ga_grw_stencilelement