Example description
    Program x05aafe

!     X05AAF Example Program Text

!     Mark 26.2 Release. NAG Copyright 2017.

!     .. Use Statements ..
      Use nag_library, Only: x04acf, x04adf, x04baf, x05aaf
!     .. Implicit None Statement ..
      Implicit None
!     .. Parameters ..
      Integer, Parameter               :: iounit = 53, nout = 6
      Character (*), Parameter         :: fname = 'x05aafe_output.txt'
!     .. Local Scalars ..
      Integer                          :: ifail
      Character (80)                   :: rec
!     .. Local Arrays ..
      Integer                          :: itime(7)
!     .. Executable Statements ..
      Write (nout,*) 'X05AAF Example Program Results'

!     Associate fname with iounit and open the unit for writing:
      ifail = 0
      Call x04acf(iounit,fname,1,ifail)

!     Get the time array:
      Call x05aaf(itime)

!     Stamp the output file:
      Call x04baf(iounit,                                                      &
        'File created by NAG x05aaf example program, time stamp:')
      Write (rec,99999) itime
      Call x04baf(iounit,rec)

!     Close the output file:
      ifail = 0
      Call x04adf(iounit,ifail)

      Write (nout,*) 'File created and stamped successfully.'

99999 Format (I4.4,2I2.2,'-',3(I2.2,':'),I3.3)
    End Program x05aafe