*     S14AGF Example Program Text
*     Mark 21 Release. NAG Copyright 2004.
*     .. Parameters ..
      INTEGER          NIN, NOUT
      PARAMETER        (NIN=5,NOUT=6)
*     .. Local Scalars ..
      COMPLEX *16      Y, Z
      INTEGER          IFAIL
*     .. External Functions ..
      COMPLEX *16      S14AGF
      EXTERNAL         S14AGF
*     .. Executable Statements ..
      WRITE (NOUT,*) 'S14AGF Example Program Results'
*     Skip heading in data file
      READ (NIN,*)
      WRITE (NOUT,*)
      WRITE (NOUT,*) '       Z                 ln(Gamma(Z))',
     +  '            IFAIL'
      WRITE (NOUT,*)
   20 READ (NIN,*,END=40) Z
      IFAIL = 0
*
      Y = S14AGF(Z,IFAIL)
*
      WRITE (NOUT,99999) Z, Y, IFAIL
      GO TO 20
   40 STOP
*
99999 FORMAT (1X,'(',F5.1,',',F5.1,' )   (',1P,D12.4,',',D12.4,' )',I7)
      END
