tem_destroyIntList Subroutine

private pure subroutine tem_destroyIntList(ElemList)

Destroy complete list

Arguments

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

linked list of resulting elements building the neighbor


Called by

proc~~tem_destroyintlist~~CalledByGraph proc~tem_destroyintlist tem_destroyIntList interface~destroy~44 destroy interface~destroy~44->proc~tem_destroyintlist

Contents

Source Code


Source Code

  pure subroutine tem_destroyIntList(ElemList)
    ! ---------------------------------------------------------------------------
    !> linked list of resulting elements building the neighbor
    type(tem_intList),pointer, intent(inout) :: ElemList
    ! ---------------------------------------------------------------------------
    type(tem_intList),pointer :: firstPos   ! first entry in linked list
    type(tem_intList),pointer :: currPos    ! current position in linked list
    type(tem_intList),pointer :: lastPos    ! one before current position
    ! ---------------------------------------------------------------------------

    firstPos => ElemList
    currPos  => ElemList

    ! Iterate as long as there are entries
    do while(associated(currPos%next))
      lastPos => currPos
      currPos => currPos%next
      deallocate(lastPos)
    enddo

  end subroutine tem_destroyIntList