1 Subroutine FFT661 & ! in
14 ! MULTIPLE FAST SINE TRANSFORM
15 ! (Originally called FFT661, then Var_SinTrans)
16 ! author: clive temperton, may 1988
17 ! (slightly modified for all-fortran version)
19 ! Sine transform of length n is converted to
20 ! Real periodic transform of length n by pre- and post-
21 ! processing. Real periodic transform is performed by
22 ! pruning redundant operations from complex transform.
24 ! see for example paul swarztrauber, "symmetric fft's",
25 ! math. comp. 47 (1986), 323-346.
29 ! ordering of coefficients: z(0) , z(1) , z(2) , ... , z(n)
30 ! ordering of data: x(0) , x(1) , x(2) , ... , x(n)
32 ! vectorization is achieved on cray by doing the transforms
35 ! N must be composed of factors 2,3 & 5 and must be even
37 ! definition of transforms:
38 ! -------------------------
40 ! isign=+1: x(i)=sum(j=1,...,n-1)(z(j)*sin(i*j*pi/n))
42 ! isign=-1: z(j)=(2/n)*sum(i=1,...,n-1)(x(i)*sin(i*j*pi/n))
44 ! Current Code Owner: Andrew Lorenc
47 ! Version Date Comment
48 ! ------- ---- -------
49 ! 0.1 14/12/93 Original code. Phil Andrews
50 ! 0.2 16/09/94 Small Modifications for the
51 ! incorporation in the VAR project. HB
52 ! 1.1 21/04/95 placed under control. JB
53 ! 1.2 01/06/95 Tracing added. JB
56 ! NB BECAUSE OF THE TRICKY NESTED LOOPS
57 ! ORIGINAL CODE F77 IS HARDLY TOUCHED !!!
61 ! Subroutine arguments
62 Integer , intent (in) :: ISIGN ! Switch forward (-1) or inverse (+1)
63 Integer , intent (in) :: INC ! increment within each data
64 ! vector (e.g. INC=1 for
65 ! consecutively stored data)
66 Integer , intent (in) :: Jump ! increment between start of
68 Integer , intent (in) :: LOT ! Number of data vectors
69 Integer , intent (in) :: N ! N+1 is the length of the data
70 ! vectors (which include zeros
72 Integer , intent (in) :: DIM ! dimension workspace
73 Integer , intent (in) :: IFAX(10) ! previously prepared list of
76 Real , intent (in) :: TRIGS(3*N) ! previously prepared list of
77 ! trigonometric function values
78 Real , intent (inout) :: A( INC*(N+1) + JUMP*(LOT-1) ) ! data array
80 ! No descriptions given
82 Integer :: NBLOX,NVEX,NB
83 Integer :: K,JA,JB,IA,IB,IGO,LA,J
84 Integer :: IFAC,IERR,ISTART
86 Real :: SI,T1,T2,SCALE, vectorlength
87 Real :: WORK(DIM) ! size (n+1)*min(lot,VectorLength)
93 NBLOX=1+(LOT-1)/VectorLength
94 NVEX=LOT-(NBLOX-1)*VectorLength
107 IF (MOD(NFAX,2).EQ.0) THEN
110 WORK(JA) = SI*(A(IA)+A(IB)) + 0.5*(A(IA)-A(IB))
111 WORK(JB) = SI*(A(IA)+A(IB)) - 0.5*(A(IA)-A(IB))
120 T1 = SI*(A(IA)+A(IB)) + 0.5*(A(IA)-A(IB))
121 T2 = SI*(A(IA)+A(IB)) - 0.5*(A(IA)-A(IB))
134 IF (MOD(NFAX,2).EQ.0) THEN
155 ! PERIODIC FOURIER ANALYSIS
156 ! -------------------------
165 CALL qpassm(WORK,WORK(IFAC*LA+1),A(IA),A(LA*INC+IA), &
166 TRIGS,1,INC,NX,JUMP,NVEX,N,IFAC,LA,IERR)
167 ELSE IF (IGO.EQ.-1) THEN
168 CALL qpassm(A(IA),A(IFAC*LA*INC+IA),WORK,WORK(LA+1), &
169 TRIGS,INC,1,JUMP,NX,NVEX,N,IFAC,LA,IERR)
171 IF (IERR.NE.0) GO TO 500
178 IF (ISIGN.EQ.+1) SCALE = FLOAT(N)
185 A(JA+INC)=0.5*SCALE*WORK(IA)
197 A(JA)=-SCALE*WORK(IA+1)
198 A(JA+INC)=SCALE*WORK(IA)+A(JA-INC)
204 ISTART=ISTART+NVEX*JUMP
213 GO TO (510,530,550) IERR
215 WRITE(UNIT=0,FMT='(A,I5,A)') 'NVEX=', NVEX ,' GREATER THAN VectorLength'
218 WRITE(UNIT=0,FMT='(A,I5,A)') 'IFAC=', IFAC, 'NOT CATERED FOR'
221 WRITE(UNIT=0,FMT='(A,I5,A)') 'IFAC=', IFAC, ' ONLY CATERED FOR IF LA*IFAC=N'
228 End subroutine FFT661