This routine appends new space time function to linked list of tem_st_fun_linkedList
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_st_fun_linkedList_type), | intent(inout) | :: | me |
Linked list to append the spacetime function to. |
||
type(tem_spacetime_fun_type), | intent(in) | :: | st_fun |
Spacetime fun information to add to the list. |
||
type(tem_st_fun_listElem_type), | intent(out), | optional, | pointer | :: | new |
subroutine append_stFunSingle_ToLinkList(me, st_fun, new)
! -------------------------------------------------------------------- !
!> Linked list to append the spacetime function to.
type(tem_st_fun_linkedList_type), intent(inout) :: me
!> Spacetime fun information to add to the list.
type(tem_spacetime_fun_type), intent(in) :: st_fun
type(tem_st_fun_listElem_type), pointer, optional, intent(out) :: new
! -------------------------------------------------------------------- !
type(tem_st_fun_listElem_type), pointer :: current
type(tem_st_fun_listElem_type), pointer :: lnew
! -------------------------------------------------------------------- !
allocate(lnew)
lnew%nVals = 1
allocate(lnew%val(lnew%nVals))
lnew%val = st_fun
lnew%next => null()
! Look for the last element in linked list
if (associated(me%head)) then
current => me%head
do
if (.not. associated(current%next)) EXIT
current => current%next
end do
current%next => lnew
else
allocate(me%head)
me%head => lnew
end if
if (present(new)) new => lnew
end subroutine append_stFunSingle_ToLinkList