destroy_da_int Subroutine

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

Called by

proc~~destroy_da_int~~CalledByGraph proc~destroy_da_int destroy_da_int interface~destroy~7 destroy interface~destroy~7->proc~destroy_da_int

Contents

Source Code


Source Code

  subroutine destroy_da_int(me)
    type(dyn_intarray_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_int