module sorter
implicit none 
contains


subroutine sort(value)
implicit none
integer,dimension(:),intent(inout) :: value
integer :: first,temp,number,index,i,j

number=size(value)

do i=1,number-1
first=value(i)
index=i
do j=i+1,number
if (value(j) < first) then
first = value(j)
index=j
end if
end do

if (index /= i) then
temp=value(i)
value(i)=value(index)
value(index)=temp
end if
end do

end subroutine sort
end module sorter
