Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | list(:) | |||
integer, | intent(in) | :: | val |
function stupid_search(list, val) result(pos)
integer, intent(in) :: list(:), val
integer :: pos
integer :: i
pos = 0
do i = lbound(list, 1), ubound(list, 1)
if (val == list(i)) then
pos = i
return
end if
end do
end function stupid_search