Program ex1007
implicit none

integer,pointer::p(:)
integer,target::a(10)=(/10,24,33,42,54,8,90,3,4,23/)
interface
    function getmin(p)
    integer,pointer::p(:)
    integer,pointer::getmin
    end function
end interface

p=>a!(1:9:2)
write(*,*)getmin(p)

stop
end

function getmin(p)
    implicit none
    integer,pointer::p(:)
    integer,pointer::getmin
    integer i,s
    integer min

    s=size(p,1)
    min=2**30
    do i=1,s
        if(min>p(i))then
            min=p(i)
            getmin=>p(i)
        endif
    enddo
    return
end function