ismax.f90 Source File


Contents

Source Code


Source Code

!
! $Header$
!
function ismax(n,sx,incx)
  !
  IMPLICIT NONE
  !
  INTEGER :: n,i,incx,ismax,ix
  real :: sx((n-1)*incx+1),sxmax
  !
  ix=1
  ismax=1
  sxmax=sx(1)
  do i=1,n-1
   ix=ix+incx
   if(sx(ix).gt.sxmax) then
     sxmax=sx(ix)
     ismax=i+1
   endif
  end do
  !
  return
end function ismax