*     S21CBF Example Program Text
*     Mark 20 Release. NAG Copyright 2001.
*     .. Parameters ..
      INTEGER          NIN, NOUT
      PARAMETER        (NIN=5,NOUT=6)
*     .. Local Scalars ..
      COMPLEX *16      CN, DN, SN, Z
      DOUBLE PRECISION AK2
      INTEGER          IFAIL
*     .. External Subroutines ..
      EXTERNAL         S21CBF
*     .. Executable Statements ..
      WRITE (NOUT,*) 'S21CBF Example Program Results'
*     Skip heading in data file
      READ (NIN,*)
   20 WRITE (NOUT,*)
      READ (NIN,*,END=40) Z, AK2
      IFAIL = 0
*
      CALL S21CBF(Z,AK2,SN,CN,DN,IFAIL)
*
      WRITE (NOUT,*) '          Z                    AK2',
     +  '                  IFAIL'
      WRITE (NOUT,99999) Z, AK2, IFAIL
      WRITE (NOUT,*)
      WRITE (NOUT,*) '         SN                     CN',
     +  '                     DN'
      WRITE (NOUT,99998) SN, CN, DN
      GO TO 20
   40 STOP
*
99999 FORMAT (1X,'(',F8.4,',',F8.4,')',5X,F10.2,7X,I16)
99998 FORMAT (3(' (',F8.4,',',F8.4,')',3X))
      END
