* C06PQF Example Program Text * Mark 19 Release. NAG Copyright 1999. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER MMAX, NMAX PARAMETER (MMAX=5,NMAX=20) * .. Local Scalars .. INTEGER I, IFAIL, J, M, N * .. Local Arrays .. DOUBLE PRECISION WORK((MMAX+2)*NMAX+15), X((NMAX+2)*MMAX) * .. External Subroutines .. EXTERNAL C06PQF * .. Executable Statements .. WRITE (NOUT,*) 'C06PQF Example Program Results' * Skip heading in data file READ (NIN,*) 20 CONTINUE READ (NIN,*,END=140) M, N IF (M.LE.MMAX .AND. N.LE.NMAX) THEN DO 40 J = 1, M*(N+2), N + 2 READ (NIN,*) (X(J+I),I=0,N-1) 40 CONTINUE WRITE (NOUT,*) WRITE (NOUT,*) 'Original data values' WRITE (NOUT,*) DO 60 J = 1, M*(N+2), N + 2 WRITE (NOUT,99999) ' ', (X(J+I),I=0,N-1) 60 CONTINUE IFAIL = 1 * CALL C06PQF('F',N,M,X,WORK,IFAIL) * IF (IFAIL.EQ.0) THEN WRITE (NOUT,*) WRITE (NOUT,*) + 'Discrete Fourier transforms in complex Hermitian format' DO 80 J = 1, M*(N+2), N + 2 WRITE (NOUT,*) WRITE (NOUT,99999) 'Real ', (X(J+2*I),I=0,N/2) WRITE (NOUT,99999) 'Imag ', (X(J+2*I+1),I=0,N/2) 80 CONTINUE WRITE (NOUT,*) WRITE (NOUT,*) 'Fourier transforms in full complex form' * DO 100 J = 1, M*(N+2), N + 2 WRITE (NOUT,*) WRITE (NOUT,99999) 'Real ', (X(J+2*I),I=0,N/2), + (X(J+2*(N-I)),I=N/2+1,N-1) WRITE (NOUT,99999) 'Imag ', (X(J+2*I+1),I=0,N/2), + (-X(J+2*(N-I)+1),I=N/2+1,N-1) 100 CONTINUE * CALL C06PQF('B',N,M,X,WORK,IFAIL) * WRITE (NOUT,*) WRITE (NOUT,*) + 'Original data as restored by inverse transform' WRITE (NOUT,*) DO 120 J = 1, M*(N+2), N + 2 WRITE (NOUT,99999) ' ', (X(J+I),I=0,N-1) 120 CONTINUE GO TO 20 ELSE WRITE (NOUT,*) WRITE (NOUT,99998) ' ** C06PQF returned with IFAIL = ', + IFAIL END IF ELSE WRITE (NOUT,*) 'Invalid value of M or N' END IF 140 CONTINUE * 99999 FORMAT (1X,A,9(:1X,F10.4)) 99998 FORMAT (1X,A,I5) END