%N whenile %F $MIR/src/subs/math.for
%D Return locations less than or equal to the integer target.
%P pjt
%: scilib
%B
        subroutine whenile(n,array,inc,target,index,nval)

        implicit none
        integer n,inc,nval
        integer index(*)
        integer array(*),target

  Whenile returns the all the locations in an integer array less than or
  equal to the integer target.

  Inputs:
    n          Number of elements to be searched.
    array      The integer array to be searched.
    inc        Skip distance between elements of the searched array.
    target     Integer value to be searched for in the array.

  Output:
    index      The integer array containing the index of locations
               less than or equal to the target.
    nval       Number of values put in the index array.

  Reference:
  See page 4-65 to 4-71 of the Cray "Library Reference Manual".
