      program ssaqtest
      implicit none
      real f, ssaq
      external f, ssaq
      real pi, epsilon
      parameter(pi=3.1415926535d0, epsilon=1.0d-6)
      
      write(*,'(a f11.6)') 'Before call, e is ', epsilon
      write(*,'(a f11.6)') 'Integral is       ',
     &  ssaq(f, 0d0, pi/2, epsilon)
      write(*,'(a f11.6)') 'After  call, e is ', epsilon

      end ! program ssaqtest

      real function f(x)
      real x

      f=cos(x)
c     write (*, '(a f11.6 f11.6)') 'x, exp(x): ', x, f
      end ! real function f
