C 
      Program Precision_Check

      implicit none

      integer, parameter :: i4 = SELECTED_INT_KIND(8)
      integer, parameter :: i8 = SELECTED_INT_KIND(13)
      integer, parameter :: r4 = SELECTED_REAL_KIND(6,30)
      integer, parameter :: c4 = SELECTED_REAL_KIND(6,30)
      integer, parameter :: r8 = SELECTED_REAL_KIND(12)
      integer, parameter :: r8b = SELECTED_REAL_KIND(13)
      integer, parameter :: c8 = SELECTED_REAL_KIND(12)


      integer     :: inative
      integer(i4) :: int4
      integer(i8) :: int8

      real        :: rnative
      real(r4)    :: realr4
      real(r8)    :: realr8
      real(r8b)   :: realr8b

      double precision :: dp

      write(*,'(''-------------------------------------------'')')
      write(*,*)'native integer'
      write(*,*)'DIGITS    = ',   digits(inative)
      write(*,*)'HUGE      = ',     huge(inative)
      write(*,*)'KIND      = ',     kind(inative)

      write(*,'(''-------------------------------------------'')')
      write(*,*)'i4 = SELECTED_INT_KIND(8) ',i4
      write(*,*)'DIGITS    = ',   digits(int4)
      write(*,*)'HUGE      = ',     huge(int4)
      write(*,*)'KIND      = ',     kind(int4)

      write(*,'(''-------------------------------------------'')')
      write(*,*)'i8 = SELECTED_INT_KIND(13) ',i8
      write(*,*)'DIGITS    = ',   digits(int8)
      write(*,*)'HUGE      = ',     huge(int8)
      write(*,*)'KIND      = ',     kind(int8)

      write(*,'(''-------------------------------------------'')')
      write(*,*)'native real'
      write(*,*)'DIGITS    = ',   digits(rnative)
      write(*,*)'EPSILON   = ',  epsilon(rnative)
      write(*,*)'HUGE      = ',     huge(rnative)
      write(*,*)'KIND      = ',     kind(rnative)
      write(*,*)'PRECISION = ',precision(rnative)

      write(*,'(''-------------------------------------------'')')
      write(*,*)'r4 = SELECTED_REAL_KIND(6,30) ',r4
      write(*,*)'DIGITS    = ',   digits(realr4)
      write(*,*)'EPSILON   = ',  epsilon(realr4)
      write(*,*)'HUGE      = ',     huge(realr4)
      write(*,*)'KIND      = ',     kind(realr4)
      write(*,*)'PRECISION = ',precision(realr4)

      write(*,'(''-------------------------------------------'')')
      write(*,*)'r8 = SELECTED_REAL_KIND(12) ',r8
      write(*,*)'DIGITS    = ',   digits(realr8)
      write(*,*)'EPSILON   = ',  epsilon(realr8)
      write(*,*)'HUGE      = ',     huge(realr8)
      write(*,*)'KIND      = ',     kind(realr8)
      write(*,*)'PRECISION = ',precision(realr8)

      write(*,'(''-------------------------------------------'')')
      write(*,*)'r8b = SELECTED_REAL_KIND(13) ',r8b
      write(*,*)'DIGITS    = ',   digits(realr8b)
      write(*,*)'EPSILON   = ',  epsilon(realr8b)
      write(*,*)'HUGE      = ',     huge(realr8b)
      write(*,*)'KIND      = ',     kind(realr8b)
      write(*,*)'PRECISION = ',precision(realr8b)

      write(*,'(''-------------------------------------------'')')
      write(*,*)'"double precision"'
      write(*,*)'DIGITS    = ',   digits(dp)
      write(*,*)'EPSILON   = ',  epsilon(dp)
      write(*,*)'HUGE      = ',     huge(dp)
      write(*,*)'KIND      = ',     kind(dp)
      write(*,*)'PRECISION = ',precision(dp)

      end program Precision_Check

