* F08PNF Example Program Text * Mark 21 Release. NAG Copyright 2004. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER NB, NMAX PARAMETER (NB=64,NMAX=10) INTEGER LDA, LDVS, LWORK PARAMETER (LDA=NMAX,LDVS=NMAX,LWORK=NMAX+NMAX*NB) * .. Local Scalars .. INTEGER I, IFAIL, INFO, J, LWKOPT, N, SDIM * .. Local Arrays .. COMPLEX *16 A(LDA,NMAX), VS(LDVS,NMAX), W(NMAX), WORK(LWORK) DOUBLE PRECISION RWORK(NMAX) LOGICAL DUMMY(1) CHARACTER CLABS(1), RLABS(1) * .. External Functions .. LOGICAL F08PNZ EXTERNAL F08PNZ * .. External Subroutines .. EXTERNAL X04DBF, ZGEES * .. Intrinsic Functions .. INTRINSIC INT * .. Executable Statements .. WRITE (NOUT,*) 'F08PNF Example Program Results' WRITE (NOUT,*) * Skip heading in data file READ (NIN,*) READ (NIN,*) N IF (N.LE.NMAX) THEN * * Read the matrix A from data file * READ (NIN,*) ((A(I,J),J=1,N),I=1,N) * * Find the Schur factorization * CALL ZGEES('Vectors (Schur)','No sort',F08PNZ,N,A,LDA,SDIM,W, + VS,LDVS,WORK,LWORK,RWORK,DUMMY,INFO) LWKOPT = INT(WORK(1)) * IF (INFO.GT.0) THEN WRITE (NOUT,99999) 'Failure in ZGEES. INFO =', INFO ELSE * * Print out factors of the Schur factorization * IFAIL = 0 CALL X04DBF('General',' ',N,N,A,LDA,'Bracketed','F7.3', + 'Schur matrix T','Integer',RLABS,'Integer', + CLABS,80,0,IFAIL) * WRITE (NOUT,*) CALL X04DBF('General',' ',N,N,VS,LDVS,'Bracketed','F7.4', + 'Matrix Z of Schur vectors','Integer',RLABS, + 'Integer',CLABS,80,0,IFAIL) END IF * * Print workspace information * IF (LWORK.LT.LWKOPT) THEN WRITE (NOUT,*) WRITE (NOUT,99998) 'Optimum workspace required = ', LWKOPT, + 'Workspace provided = ', LWORK END IF ELSE WRITE (NOUT,*) WRITE (NOUT,*) 'NMAX too small' END IF * 99999 FORMAT (1X,A,I4) 99998 FORMAT (1X,A,I5,/1X,A,I5) END