! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

  module A08M
    implicit none
    public :: Input, Temp_C, Output
  contains
    subroutine Input( F_Temp )
      real, intent(out) :: F_Temp
  ! start subroutine Input
      write (unit = *, fmt = *) " Please enter the Fahrenheit temperature. "
      read (unit = *, fmt = *) F_Temp
      return
    end subroutine Input
    function Temp_C( F_Temp ) result( Temp_C_R )
      real, intent(in) :: F_Temp
      real :: Temp_C_R
    real, parameter :: T_SCALE = 1.8, OFFSET = 32.0
  ! start function Output
      Temp_C_R = (F_Temp - OFFSET) / T_SCALE
      return
    end function Temp_C
    subroutine Output( F_Temp, Temp_C_R )
      real, intent(in) :: F_Temp, Temp_C_R
  ! start subroutine Output
      write (unit = *, fmt = *) F_Temp, " deg. F = ", Temp_C_R, " deg. C"
      return
    end subroutine Output
  end module A08M
