PROGRAM f08qffe ! F08QFF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : dtrexc, nag_wp, x04caf ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. INTEGER :: i, ifail, ifst, ilst, info, ldq, & ldt, n ! .. Local Arrays .. REAL (KIND=nag_wp), ALLOCATABLE :: q(:,:), t(:,:), work(:) ! .. Executable Statements .. WRITE (nout,*) 'F08QFF Example Program Results' WRITE (nout,*) FLUSH (nout) ! Skip heading in data file READ (nin,*) READ (nin,*) n ldq = 1 ldt = n ALLOCATE (q(ldq,1),t(ldt,n),work(n)) ! Read T from data file READ (nin,*) (t(i,1:n),i=1,n) ! Read the row indices READ (nin,*) ifst, ilst ! Reorder the Schur factor T ! The NAG name equivalent of dtrexc is f08qff CALL dtrexc('No update',n,t,ldt,q,ldq,ifst,ilst,work,info) IF (info>0) THEN WRITE (nout,99999) info, ilst WRITE (nout,*) FLUSH (nout) END IF ! Print reordered Schur factor ! ifail: behaviour on error exit ! =0 for hard exit, =1 for quiet-soft, =-1 for noisy-soft ifail = 0 CALL x04caf('General',' ',n,n,t,ldt,'Reordered Schur form',ifail) 99999 FORMAT (' Reordering could not be completed. INFO = ',I3,' ILST = ',I5) END PROGRAM f08qffe