module constants integer, parameter :: i4b = selected_int_kind(9) integer, parameter :: ndp = kind(1.0d0) real(ndp), parameter :: zero = 0.0d0 real(ndp), parameter :: one = 1.0d0 end module constants module common use constants implicit real(ndp) (a-h,o-z) implicit integer(i4b) (i-n) end module common program main use constants use common use procedures implicit real(ndp) (a-h,o-z) implicit integer(i4b) (i-n) x = 2.0d0 call callf(f,x,y) write(6,"(2f10.6)") x,y end program main module procedures use constants implicit real(ndp) (a-h,o-z) implicit integer(i4b) (i-n) contains subroutine callf(fct,x,y) y = fct(x) return end subroutine callf double precision function f(x) f = x*x return end function f subroutine wait write(6,"(' Waiting...')") read * return end subroutine wait end module procedures