! 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.

! Example 8.9. Optional arguments and the intrinsic function Present.
  program I09
    use I09M
    implicit none
! start program I09
  ! All of the following function references are equivalent.
    write (unit = *, fmt = *) Series_Sum (700, 100.0, 0)  ! D assumes default value.
    write (unit = *, fmt = *) Series_Sum (700, S = 100.0, M = 0)  ! D assumes default value.
    write (unit = *, fmt = *) Series_Sum (N = 700, S = 100.0)  ! M and D assume default values.
    write (unit = *, fmt = *) Series_Sum (D = 0.1, S = 100.0, N = 700)  ! M assumes default value.
    stop
  end program I09
