append_ga_varop_vec Subroutine

public subroutine append_ga_varop_vec(me, val, length)

Arguments

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

optional length to expand the array


Calls

proc~~append_ga_varop_vec~2~~CallsGraph proc~append_ga_varop_vec~2 append_ga_varop_vec interface~expand~33 expand proc~append_ga_varop_vec~2->interface~expand~33 proc~expand_ga_varop~2 expand_ga_varop interface~expand~33->proc~expand_ga_varop~2

Called by

proc~~append_ga_varop_vec~2~~CalledByGraph proc~append_ga_varop_vec~2 append_ga_varop_vec interface~append~34 append interface~append~34->proc~append_ga_varop_vec~2

Contents

Source Code


Source Code

  subroutine append_ga_varop_vec(me, val, length)
    type(grw_varoparray_type) :: me !< array to append the value to
    type(tem_varsys_op_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_varop_vec