Program m01cafe
! M01CAF Example Program Text
! Mark 30.2 Release. NAG Copyright 2024.
! .. Use Statements ..
Use nag_library, Only: m01caf, nag_wp
! .. Implicit None Statement ..
Implicit None
! .. Parameters ..
Integer, Parameter :: nin = 5, nout = 6
! .. Local Scalars ..
Integer :: i, ifail, m1, m2
! .. Local Arrays ..
Real (Kind=nag_wp), Allocatable :: rv(:)
! .. Executable Statements ..
Write (nout,*) 'M01CAF Example Program Results'
! Skip heading in data file
Read (nin,*)
Read (nin,*) m2
Allocate (rv(m2))
m1 = 1
Read (nin,*)(rv(i),i=m1,m2)
ifail = 0
Call m01caf(rv,m1,m2,'Ascending',ifail)
Write (nout,*)
Write (nout,*) 'Sorted numbers'
Write (nout,*)
Write (nout,99999)(rv(i),i=m1,m2)
99999 Format (1X,10F7.1)
End Program m01cafe