truncate_ga_char Subroutine

public subroutine truncate_ga_char(me)

Arguments

Type IntentOptional Attributes Name
type(grw_chararray_type) :: me

Called by

proc~~truncate_ga_char~~CalledByGraph proc~truncate_ga_char truncate_ga_char interface~truncate~17 truncate interface~truncate~17->proc~truncate_ga_char proc~tem_opvar_fill_inputindex tem_opVar_fill_inputIndex proc~tem_opvar_fill_inputindex->interface~truncate~17 proc~tem_opvar_setupindices tem_opVar_setupIndices proc~tem_opvar_setupindices->interface~truncate~17 proc~tem_opvar_setupindices->proc~tem_opvar_fill_inputindex proc~tem_spatial_scalar_storeval tem_spatial_scalar_storeVal proc~tem_spatial_scalar_storeval->interface~truncate~17 proc~setup_indices_spacetime setup_indices_spacetime proc~setup_indices_spacetime->interface~truncate~17 interface~tem_spatial_storeval tem_spatial_storeVal proc~setup_indices_spacetime->interface~tem_spatial_storeval proc~truncate_intpmatrixlsf truncate_intpMatrixLSF proc~truncate_intpmatrixlsf->interface~truncate~17 proc~destroy_intpmatrixlsf destroy_intpMatrixLSF proc~destroy_intpmatrixlsf->interface~truncate~17 proc~tem_spatial_vector_storeval tem_spatial_vector_storeVal proc~tem_spatial_vector_storeval->interface~truncate~17 proc~truncate_grwpoints truncate_grwPoints proc~truncate_grwpoints->interface~truncate~17 interface~tem_spatial_storeval->proc~tem_spatial_scalar_storeval interface~tem_spatial_storeval->proc~tem_spatial_vector_storeval interface~truncate~37 truncate interface~truncate~37->proc~truncate_intpmatrixlsf interface~destroy~43 destroy interface~destroy~43->proc~destroy_intpmatrixlsf interface~truncate~36 truncate interface~truncate~36->proc~truncate_grwpoints

Contents

Source Code


Source Code

  subroutine truncate_ga_char(me)
    !------------------------------------------------------------------------
    type(grw_chararray_type) :: me !< array to truncate
    !------------------------------------------------------------------------
    character, 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_char