NAG Library Manual, Mark 27.2
Interfaces:  FL   CL   CPP   AD 

NAG FL Interface Introduction
Example description
    Program s14affe

!     S14AFF Example Program Text

!     Mark 27.2 Release. NAG Copyright 2021.

!     .. Use Statements ..
      Use nag_library, Only: nag_wp, s14aff
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Complex (Kind=nag_wp)            :: y, z
      Integer                          :: ifail, ioerr, k
!     .. Executable Statements ..
      Write (nout,*) 'S14AFF Example Program Results'

!     Skip heading in data file
      Read (nin,*)

      Write (nout,*)
      Write (nout,*) '       Z           K         (d^K/dz^K)psi(Z)'
      Write (nout,*)

data: Do
        Read (nin,*,Iostat=ioerr) z, k

        If (ioerr<0) Then
          Exit data
        End If

        ifail = -1
        y = s14aff(z,k,ifail)

        If (ifail<0) Then
          Exit data
        End If

        Write (nout,99999) z, k, y
      End Do data

99999 Format (1X,'(',F5.1,',',F5.1,' )',I6,'   (',1P,E12.4,',',E12.4,' )')
    End Program s14affe