tem_destroyLongList Subroutine

private pure subroutine tem_destroyLongList(ElemList)

Destroy complete list

Arguments

Type IntentOptional Attributes Name
type(tem_longList), intent(inout), pointer :: ElemList

linked list of resulting elements building the neighbor


Called by

proc~~tem_destroylonglist~~CalledByGraph proc~tem_destroylonglist tem_destroyLongList interface~destroy~2 destroy interface~destroy~2->proc~tem_destroylonglist

Source Code

  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