    PROGRAM a00adfe

!      A00ADF Example Program Text

!      Mark 23 Release. NAG Copyright 2011.

!      .. 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
