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

NAG FL Interface Introduction
Example description
    Program s15drfe

!     S15DRF Example Program Text

!     Mark 30.0 Release. NAG Copyright 2024.

!     .. Use Statements ..
      Use nag_library, Only: nag_wp, s15drf
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nin = 5, nout = 6
!     .. Local Scalars ..
      Integer                          :: i, ifail, n
!     .. Local Arrays ..
      Complex (Kind=nag_wp), Allocatable :: f(:), z(:)
      Integer, Allocatable             :: ivalid(:)
!     .. Executable Statements ..
      Write (nout,*) 'S15DRF Example Program Results'

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

      Write (nout,*)
      Write (nout,*) '         Z                       F            IVALID'

      Read (nin,*) n

      Allocate (z(n),f(n),ivalid(n))

      Read (nin,*) z(1:n)

      ifail = 1
      Call s15drf(n,z,f,ivalid,ifail)

      Do i = 1, n
        Write (nout,99999) z(i), f(i), ivalid(i)
      End Do

99999 Format (1X,'(',F8.4,',',F8.4,')',4X,'(',F8.4,',',F8.4,')',6X,I0)
    End Program s15drfe