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

NAG FL Interface Introduction
Example description
    Program s15ddfe

!     S15DDF Example Program Text

!     Mark 30.0 Release. NAG Copyright 2024.

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

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

      Write (nout,*)
      Write (nout,*) '              Z                                W'

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

        If (ioerr<0) Then
          Exit data
        End If

        ifail = -1
        w = s15ddf(z,ifail)

        If (ifail<0) Then
          Exit data
        End If

        Write (nout,99999) z, w
      End Do data

99999 Format (1X,'(',F12.4,',',F12.4,')      (',F12.4,',',F12.4,')')
    End Program s15ddfe