    Program a00adfe

!     A00ADF Example Program Text

!     Mark 24 Release. NAG Copyright 2012.

!     .. Use Statements ..
      Use nag_library, Only: a00adf, x05aaf
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: msglen = 14, nout = 6
!     .. Local Scalars ..
      Integer                          :: i, mkmaj, mkmin
      Logical                          :: licval
      Character (64)                   :: fcomp, hdware, opsys, vend
      Character (57)                   :: impl, prec
      Character (20)                   :: pcode
!     .. Local Arrays ..
      Integer                          :: itime(7)
      Character (80)                   :: msg(msglen)
!     .. Executable Statements ..
      Write (nout,*) 'A00ADF Example Program Results'

      Call a00adf(impl,prec,pcode,mkmaj,mkmin,hdware,opsys,fcomp,vend,licval)

!     Print implementation details.

      Write (nout,*)

      msg(1) = '*** Start of NAG Library implementation details ***'
      msg(2) = ''
      msg(3) = 'Implementation title: ' // impl
      msg(4) = '           Precision: ' // prec
      msg(5) = '        Product Code: ' // pcode

      If (mkmin<10) Then
        Write (msg(6),99999) mkmaj, mkmin
      Else
        Write (msg(6),99998) mkmaj, mkmin
      End If

      If (vend=='(self-contained)') Then
        msg(7) = '      Vendor Library: None'
      Else
        msg(7) = '      Vendor Library: ' // vend(1:57)
      End If

      msg(8) = 'Applicable to:'
      msg(9) = '    hardware - ' // hdware
      msg(10) = '    op. sys. - ' // opsys
      msg(11) = '    compiler - ' // fcomp
      msg(12) = 'and compatible systems.'
      msg(13) = ''
      msg(14) = '*** End of NAG Library implementation details ***'

      Do i = 1, msglen
        Write (nout,'(A)') msg(i)
      End Do

!     Print whether valid licence was found for this product.

      Write (nout,*)

      If (licval) Then
        Write (nout,*) 'A valid licence was found for ' // pcode
      Else
        Write (nout,*) '** A valid licence was not found for ' // pcode
      End If

!     Print the date.

      Write (nout,*)
      Write (nout,*) 'This program was run on the following date:'

      Call x05aaf(itime)

      Write (nout,99997) '       Year : ', itime(1)
      Write (nout,99997) '      Month : ', itime(2)
      Write (nout,99997) '        Day : ', itime(3)

      Write (nout,*) '*** ----------------------------------------- ***'

99999 Format ('                Mark: ',I2,'.',I1,1X,A)
99998 Format ('                Mark: ',I2,'.',I2,1X,A)
99997 Format (1X,A,I4)
    End Program a00adfe
