Skip to content

Commit 5ebe42b

Browse files
committed
Fixed bug in mpas_stream_list_insert.
1 parent b1aa179 commit 5ebe42b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/framework/mpas_stream_list.F

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,15 @@ subroutine MPAS_stream_list_insert(list, stream, ierr) !{{{
118118
list % head => stream
119119
else
120120
node => list % head
121-
do while (associated(node % next))
121+
do while (associated(node))
122122
if (node % name == stream % name) then
123123
if (present(ierr)) ierr = MPAS_STREAM_LIST_DUPLICATE
124-
LIST_ERROR_WRITE('Found duplicate item '//trim(stream % name)//' in list.')
125124
return
126125
end if
126+
if (.not. associated(node % next)) then
127+
node % next => stream
128+
exit
129+
end if
127130
node => node % next
128131
end do
129132
node % next => stream

0 commit comments

Comments
 (0)