truncate_ga_stencilelement Subroutine

private subroutine truncate_ga_stencilelement(me)

Arguments

Type IntentOptional Attributes Name
type(grw_stencilelementarray_type) :: me

Called by

proc~~truncate_ga_stencilelement~~CalledByGraph proc~truncate_ga_stencilelement truncate_ga_stencilelement interface~truncate~4 truncate interface~truncate~4->proc~truncate_ga_stencilelement

Source Code

  subroutine truncate_ga_stencilelement(me)
    !------------------------------------------------------------------------
    type(grw_stencilelementarray_type) :: me !< array to truncate
    !------------------------------------------------------------------------
    type(tem_stencilelement_type), allocatable :: tarray(:)
    !------------------------------------------------------------------------
    integer :: ii
    !------------------------------------------------------------------------

    ! nothing to do if container size is not larger than the number of values
    ! in the array.
    if (me%containersize > me%nvals) then
      allocate(tarray(me%nvals))
      do ii = 1, me%nvals
        tarray(ii) = me%val(ii)
      end do
      call move_alloc(tarray, me%val)
      me%containersize = me%nvals
    end if

  end subroutine truncate_ga_stencilelement