destroy_da_path Subroutine

public subroutine destroy_da_path(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_patharray_type), intent(inout) :: me

Called by

proc~~destroy_da_path~~CalledByGraph proc~destroy_da_path destroy_da_path interface~destroy~4 destroy interface~destroy~4->proc~destroy_da_path proc~sorttruncate_da_path sorttruncate_da_path proc~sorttruncate_da_path->interface~destroy~4 interface~sorttruncate sorttruncate interface~sorttruncate->proc~sorttruncate_da_path

Source Code

  subroutine destroy_da_path(me)
    type(dyn_patharray_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_path