! 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 C16M
    implicit none
    public :: Accounting
  contains
    subroutine Accounting( Temperature )
      real, intent(in) :: Temperature
      real, parameter :: BOUNDARY = 68.0
      integer, save :: High_Count = 0, Low_Count = 0
  ! start subroutine Accounting
      if (Temperature >= BOUNDARY) then
        High_Count = High_Count + 1
      else
        Low_Count = Low_Count + 1
      end if
      write (unit = *, fmt = *) High_Count, " hot days, and ", Low_Count, &
        " cold days so far this month."
      return
    end subroutine Accounting
  end module C16M
