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

NAG FL Interface Introduction
Example description
    Program s21bffe

!     S21BFF Example Program Text

!     Mark 29.3 Release. NAG Copyright 2023.

!     .. Use Statements ..
      Use nag_library, Only: nag_wp, s21bff, x01aaf
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: nout = 6
!     .. Local Scalars ..
      Real (Kind=nag_wp)               :: dm, f, phi, pi
      Integer                          :: ifail, ix
!     .. Intrinsic Procedures ..
      Intrinsic                        :: real
!     .. Executable Statements ..
      Write (nout,*) 'S21BFF Example Program Results'

      Write (nout,*)
      Write (nout,*) '    PHI    DM      S21BFF'
      Write (nout,*)

      pi = x01aaf(pi)

data: Do ix = 1, 3
        phi = real(ix,kind=nag_wp)*pi/6.0E0_nag_wp
        dm = real(ix,kind=nag_wp)*0.25E0_nag_wp

        ifail = -1
        f = s21bff(phi,dm,ifail)

        If (ifail<0) Then
          Exit data
        End If

        Write (nout,99999) phi, dm, f
      End Do data

99999 Format (1X,2F7.2,F12.4)
    End Program s21bffe