tem_appendIntList Subroutine

private subroutine tem_appendIntList(firstEntry, entryPos)

append an entry at the end of the integer list If the first entry is zero, write into that one

Arguments

Type IntentOptional Attributes Name
type(tem_intList), pointer :: firstEntry

linked list of resulting elements building the neighbor

integer(kind=int_k), intent(in) :: entryPos

Add that element


Called by

proc~~tem_appendintlist~~CalledByGraph proc~tem_appendintlist tem_appendIntList interface~append~2 append interface~append~2->proc~tem_appendintlist proc~tem_calc_vrtx_coord tem_calc_vrtx_coord proc~tem_calc_vrtx_coord->interface~append~2 proc~tem_unify_vrtx tem_unify_vrtx proc~tem_calc_vrtx_coord->proc~tem_unify_vrtx proc~tem_findelement tem_findElement proc~tem_findelement->interface~append~2 proc~tem_findelement->proc~tem_findelement proc~tem_findpath tem_findPath proc~tem_findpath->interface~append~2 proc~tem_findpath->proc~tem_findpath proc~tem_unify_vrtx->interface~append~2 proc~hvs_output_init hvs_output_init proc~hvs_output_init->proc~tem_calc_vrtx_coord proc~tem_init_tracker tem_init_tracker proc~tem_init_tracker->proc~hvs_output_init

Source Code

  subroutine tem_appendIntList(firstEntry, entryPos)
    ! ---------------------------------------------------------------------------
    !> linked list of resulting elements building the neighbor
    type(tem_intList),pointer :: firstEntry
    !> Add that element
    integer(kind=int_k),intent(in) :: entryPos
    ! ---------------------------------------------------------------------------
    type(tem_intList),pointer :: currPos    ! current position in linked list
    ! ---------------------------------------------------------------------------

    currPos => firstEntry

    if(currPos%elem .le. 0) then
       ! If the element entry of the current entry is zero
       ! write into that position
       currPos%elem = entryPos
    else
      ! If element entry /= 0 then find the end of the list
      do while(associated(currPos%next))
        currPos => currPos%next
      enddo
      ! at the end of the list, append new list item
      allocate(currPos%next)
      currPos => currPos%next
      ! And write to the item
      currPos%elem = entryPos
    endif

  end subroutine tem_appendIntList