destroy_da_label Subroutine

public subroutine destroy_da_label(me)

destruction of a dynamic array

this subroutine takes care of a proper destruction of a dynamic array, it frees the allocated memory and resets the internal counts to 0.

Arguments

Type IntentOptional Attributes Name
type(dyn_labelarray_type), intent(inout) :: me

Called by

proc~~destroy_da_label~~CalledByGraph proc~destroy_da_label destroy_da_label interface~destroy~30 destroy interface~destroy~30->proc~destroy_da_label proc~sorttruncate_da_int sorttruncate_da_int proc~sorttruncate_da_int->interface~destroy~30 proc~sorttruncate_da_label sorttruncate_da_label proc~sorttruncate_da_label->interface~destroy~30 proc~sorttruncate_da_long sorttruncate_da_long proc~sorttruncate_da_long->interface~destroy~30 proc~sorttruncate_da_real sorttruncate_da_real proc~sorttruncate_da_real->interface~destroy~30 proc~tem_comm_createbuffer tem_comm_createBuffer proc~tem_comm_createbuffer->interface~destroy~30 proc~tem_comm_destroy tem_comm_destroy proc~tem_comm_destroy->interface~destroy~30 proc~tem_commbuf_int_gatherindexed tem_commbuf_int_gatherindexed proc~tem_commbuf_int_gatherindexed->interface~destroy~30 proc~tem_commbuf_long_gatherindexed tem_commbuf_long_gatherindexed proc~tem_commbuf_long_gatherindexed->interface~destroy~30 proc~tem_commbuf_real_gatherindexed tem_commbuf_real_gatherindexed proc~tem_commbuf_real_gatherindexed->interface~destroy~30 interface~sorttruncate~2 sorttruncate interface~sorttruncate~2->proc~sorttruncate_da_long interface~sorttruncate~3 sorttruncate interface~sorttruncate~3->proc~sorttruncate_da_int interface~sorttruncate~4 sorttruncate interface~sorttruncate~4->proc~sorttruncate_da_real interface~sorttruncate~5 sorttruncate interface~sorttruncate~5->proc~sorttruncate_da_label

Source Code

  subroutine destroy_da_label(me)
    type(dyn_labelarray_type), intent(inout) :: me !< dynamic array to init

    me%containersize = 0
    me%nvals         = 0

    if( allocated( me%val ) ) deallocate(me%val)
    if( allocated( me%sorted ) ) deallocate(me%sorted)
  end subroutine destroy_da_label