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.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dyn_intarray_type), | intent(inout) | :: | me |
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