!   X04AAF Example Program Text
!   Mark 23 Release. NAG Copyright 2011.

    MODULE x04aafe_mod

!      X04AAF Example Program Module:
!             Parameters and User-defined Routines

!      .. Implicit None Statement ..
       IMPLICIT NONE
!      .. Parameters ..
       INTEGER, PARAMETER              :: nout = 6
    CONTAINS
!dec$ attributes offload : mic :: dummy
       SUBROUTINE dummy

!         .. Use Statements ..
          USE nag_library, ONLY : x04aaf
!         .. Implicit None Statement ..
          IMPLICIT NONE
!         .. Local Scalars ..
          INTEGER                         :: nerr
!         .. Executable Statements ..
          CALL x04aaf(0,nerr)

          WRITE (nerr,*)
          WRITE (nerr,*) 'This is a dummy error message'

          RETURN

!dec$ attributes offload : mic :: dummy
       END SUBROUTINE dummy
    END MODULE x04aafe_mod
    PROGRAM x04aafe

!      X04AAF Example Main Program

!      .. Use Statements ..
       USE nag_library, ONLY : x04aaf
       USE x04aafe_mod, ONLY : dummy, nout
!      .. Implicit None Statement ..
       IMPLICIT NONE
!      .. Local Scalars ..
       INTEGER                         :: outchn
!      .. Executable Statements ..
       WRITE (nout,*) 'X04AAF Example Program Results'

       outchn = nout

       CALL x04aaf(1,outchn)

       CALL dummy

    END PROGRAM x04aafe
