C Input routines with error checking

      SUBROUTINE GETINT (I)
      INTEGER I
   10 READ (UNIT=*, FMT=*, IOSTAT=NERR) I
      IF (NERR .GT. 0) THEN
         PRINT *, 'Invalid input'
         GO TO 10
      ELSE IF (NERR .LT. 0) THEN
         PRINT *, 'EOF'
         STOP
      END IF
      END

      SUBROUTINE GETFLT (F)
      DOUBLE PRECISION F
   10 READ (UNIT=*, FMT=*, IOSTAT=NERR) F
      IF (NERR .GT. 0) THEN
         PRINT *, 'Invalid input'
         GO TO 10
      ELSE IF (NERR .LT. 0) THEN
         PRINT *, 'EOF'
         STOP
      END IF
      END

      SUBROUTINE GETSTR (S)
      CHARACTER S*(*)
   10 READ (UNIT=*, FMT=*, IOSTAT=NERR) S
      IF (NERR .GT. 0) THEN
         PRINT *, 'Invalid input'
         GO TO 10
      ELSE IF (NERR .LT. 0) THEN
         PRINT *, 'EOF'
         STOP
      END IF
      END
.
