*     S18GKF Example Program Text
*     Mark 21 Release. NAG Copyright 2004.
*     .. Parameters ..
      INTEGER          NIN, NOUT
      PARAMETER        (NIN=5,NOUT=6)
      INTEGER          NLMAX
      PARAMETER        (NLMAX=102)
      DOUBLE PRECISION ONE
      PARAMETER        (ONE=1.0D+0)
*     .. Local Scalars ..
      COMPLEX *16      Z
      DOUBLE PRECISION A, ALPHA
      INTEGER          I, IFAIL, NL
*     .. Local Arrays ..
      COMPLEX *16      B(NLMAX)
*     .. External Subroutines ..
      EXTERNAL         S18GKF
*     .. Intrinsic Functions ..
      INTRINSIC        ABS, DBLE, SIGN
*     .. Executable Statements ..
      WRITE (NOUT,*) 'S18GKF Example Program Results'
*     Skip heading in data file
      READ (NIN,*)
   20 READ (NIN,*,END=60) Z, A, NL
      IFAIL = 0
*
      CALL S18GKF(Z,A,NL,B,IFAIL)
*
      WRITE (NOUT,*)
      WRITE (NOUT,*) '      Z           A     NL    IFAIL'
      WRITE (NOUT,*)
      WRITE (NOUT,99999) Z, A, NL, IFAIL
      WRITE (NOUT,*)
      WRITE (NOUT,*) ' Requested values of J_alpha(Z)'
      WRITE (NOUT,*)
      ALPHA = A
      WRITE (NOUT,*) '     alpha              J_alpha(Z)'
      DO 40 I = 1, ABS(NL) + 1
         WRITE (NOUT,99998) ALPHA, B(I)
         ALPHA = ALPHA + SIGN(ONE,DBLE(NL))
   40 CONTINUE
      GO TO 20
   60 STOP
*
99999 FORMAT (1X,'( ',F4.1,', ',F4.1,' )',2X,F4.1,I6,I7)
99998 FORMAT (1X,1P,D12.4,3X,'(',D12.4,',',D12.4,' )')
      END
