!------------------------------------------------------------------------------
!
!  Program name:
!
!    kind_real
!
!  Purpose:
!
!    This program uses SELECTED_REAL_KIND to find the kind values for
!    real variables on the system.
!
!------------------------------------------------------------------------------

PROGRAM kind_real

  IMPLICIT NONE
  INTEGER :: i

! SELECTED_INT_KIND(R)    returns kind value for integer in range
!                         -10**R < integer < 10**R
!
! SELECTED_REAL_KIND(P,R) returns kind value for real with P decimal
!                         places of precision and exponent range R.

  WRITE(*,*)
  WRITE(*,*) '     I      Kind Value      Kind Value' 
  WRITE(*,*) '            for real        for real  '
  WRITE(*,*) '              with            with    '
  WRITE(*,*) '             Prec > I       Exp > 10*I'
  WRITE(*,*)

  DO i = 1, 35
    WRITE(*, '(I6, 2(I12,4X))') i, &
             SELECTED_REAL_KIND(i,1), &
             SELECTED_REAL_KIND(1,10*i)
  END DO

END PROGRAM kind_real
