truncate_da_label Subroutine

public subroutine truncate_da_label(me)

truncate the array after the last valid entry and hence cut off the empty trailing empty entries

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type) :: me

Called by

proc~~truncate_da_label~~CalledByGraph proc~truncate_da_label truncate_da_label interface~truncate~23 truncate interface~truncate~23->proc~truncate_da_label proc~tem_create_varmap tem_create_varMap proc~tem_create_varmap->interface~truncate~23 proc~truncate_possible_variable truncate_possible_variable proc~truncate_possible_variable->interface~truncate~23 interface~truncate~28 truncate interface~truncate~28->proc~truncate_possible_variable proc~hvs_output_init hvs_output_init proc~hvs_output_init->proc~tem_create_varmap proc~tem_init_convergence tem_init_convergence proc~tem_init_convergence->proc~tem_create_varmap proc~tem_init_depend tem_init_depend proc~tem_init_depend->proc~tem_create_varmap proc~tem_init_tracker tem_init_tracker proc~tem_init_tracker->proc~tem_create_varmap proc~tem_init_tracker->proc~hvs_output_init proc~tem_opvar_reduction_transient_init tem_opVar_reduction_transient_init proc~tem_opvar_reduction_transient_init->proc~tem_create_varmap

Source Code

  subroutine truncate_da_label(me)
    !------------------------------------------------------------------------
    type(dyn_labelarray_type) :: me !< array to sorttruncate
    !------------------------------------------------------------------------
    character(len=labellen), allocatable :: swpval(:)
    integer, allocatable :: swpsort(:)
    !------------------------------------------------------------------------

    if (me%nvals < me%containersize) then
      allocate(swpval(me%nvals))
      allocate(swpsort(me%nvals))

      swpval = me%val(:me%nvals)
      swpsort = me%sorted(:me%nvals)

      call move_alloc(swpval, me%val)
      call move_alloc(swpsort, me%sorted)

      me%containersize = me%nvals
    end if

  end subroutine truncate_da_label