!------------------------------------------------------------------------------
!
!  Program name:
!
!    machine_constants_real
!
!  Purpose:
!
!    This program uses numeric intrinsic functions to find some machine 
!    constants for real variables with different kind values on the system.
!
!------------------------------------------------------------------------------

PROGRAM machine_constants_real

  IMPLICIT NONE

  INTEGER, PARAMETER, DIMENSION(2) :: ikvl = (/ 1,2 /)          ! CRAY CS6400
  REAL (KIND = ikvl(1)) r1
  REAL (KIND = ikvl(2)) r2

  WRITE (*,*) &
    'Machine constants for real variables with different kind values'
  WRITE (*,*)
  WRITE (*,*) 'Default precision has kind value: ', KIND(1.0)

  WRITE (*,'(/''   ikv   Digits         Huge           Tiny      Range''/)')
  WRITE(*,'(I5,I7, 7X, E10.2, 6X, E10.2, I7)') ikvl(1), DIGITS(r1), HUGE(r1), &
    TINY(r1), RANGE(r1)
  WRITE(*,'(I5,I7, 7X, E10.2, 6X, E10.2, I7)') ikvl(2), DIGITS(r2), HUGE(r2), &
    TINY(r2), RANGE(r2)

END PROGRAM machine_constants_real
