destroy_da_real Subroutine

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

Called by

proc~~destroy_da_real~~CalledByGraph proc~destroy_da_real destroy_da_real interface~destroy~8 destroy interface~destroy~8->proc~destroy_da_real

Contents

Source Code


Source Code

  subroutine destroy_da_real(me)
    type(dyn_realarray_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_real