Destroy complete list
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_longList), | intent(inout), | pointer | :: | ElemList |
linked list of resulting elements building the neighbor |
pure subroutine tem_destroyLongList(ElemList) ! --------------------------------------------------------------------------- !> linked list of resulting elements building the neighbor type(tem_longList),pointer,intent(inout) :: ElemList ! --------------------------------------------------------------------------- type(tem_longList),pointer :: currPos ! current position in linked list type(tem_longList),pointer :: lastPos ! one before current position ! --------------------------------------------------------------------------- currPos => ElemList ! Iterate as long as there are entries do while(associated(currPos%next)) lastPos => currPos currPos => currPos%next deallocate(lastPos) enddo deallocate(currPos) end subroutine tem_destroyLongList