! This file: http://ftp.aset.psu.edu/pub/ger/fortran/hdk/KindExample.f90 ! ! Illustrates how to program a Real Kind option. ! ! Authors: "Michael Metcalf" ! in answer to question posed by: ! "Stig Kildegård Andersen" ! ! Date: 11 December 2001. ! module kind_module implicit none integer, parameter :: rk = kind(1.d0) contains function func(x) result(y) implicit none real(rk), intent(in) :: x real(rk) :: y y = x end function end module program test use kind_module implicit none real(rk) :: x x = 5.0_rk write (*,*) x x= 2.0_rk*func(x) write (*,*) x write (*,*) 'Press Enter to end this example.' read(*, "()") end program test