%N grctoi %F $MIR/src/grctoi.f
%D Convert character string to integer
%B
      INTEGER FUNCTION GRCTOI (S, I)
      CHARACTER*(*) S
      INTEGER I

 GRCTOI: attempt to read an integer from a character string, and return
 the result. No attempt is made to avoid integer overflow. A valid 
 integer is any sequence of decimal digits.

 Returns:
  GRCTOI           : the value of the integer; if the first character
                    read is not a decimal digit, the value returned
                    is zero.
 Arguments:
  S      (input)  : character string to be parsed.
  I      (in/out) : on input, I is the index of the first character
                    in S to be examined; on output, either it points
                    to the next character after a valid integer, or
                    it is equal to LEN(S)+1.
