PROGRAM whatkinds

  IMPLICIT NONE
  INTEGER :: i, ik

!-- real kind precision only
  i = 1
  DO 
    ik = SELECTED_REAL_KIND(i)
    WRITE(*,*) "i =",i,"SELECTED_REAL_KIND(",i,") = ",ik
    IF (ik < 0) EXIT 
    i = i+1
  ENDDO
  WRITE(*,*) '=============================================='
  
!-- real kind, precision=6, variable range
!  i = 1
!  DO 
!    ik = SELECTED_REAL_KIND(6,i)
!    WRITE(*,*) "i =",i,"SELECTED_REAL_KIND(6,",i,") = ",ik
!    IF (ik < 0) EXIT 
!    i = i+1
!  ENDDO
!  WRITE(*,*) '=============================================='

!-- integer kinds
  i = 1
  do 
    ik = SELECTED_INT_KIND(i)
    WRITE(*,*) "i =",i,"SELECTED_INT_KIND(",i,") = ",ik
    IF (ik < 0) EXIT 
    i = i+1
  ENDDO

END PROGRAM whatkinds
