1 subroutine zfft2i ( l, m, wsave, lensav, ier )
3 !*****************************************************************************80
5 !! ZFFT2I: initialization for ZFFT2B and ZFFT2F.
9 ! ZFFT2I initializes real array WSAVE for use in its companion
10 ! routines ZFFT2F and ZFFT2B for computing two-dimensional fast
11 ! Fourier transforms of complex data. Prime factorizations of L and M,
12 ! together with tabulations of the trigonometric functions, are
13 ! computed and stored in array WSAVE.
15 ! On 10 May 2010, this code was modified by changing the value
16 ! of an index into the WSAVE array.
26 ! Original complex single precision by Paul Swarztrauber, Richard Valent.
27 ! Complex double precision version by John Burkardt.
32 ! Vectorizing the Fast Fourier Transforms,
33 ! in Parallel Computations,
34 ! edited by G. Rodrigue,
35 ! Academic Press, 1982.
38 ! Fast Fourier Transform Algorithms for Vector Computers,
39 ! Parallel Computing, pages 45-63, 1984.
43 ! Input, integer ( kind = 4 ) L, the number of elements to be transformed
44 ! in the first dimension. The transform is most efficient when L is a
45 ! product of small primes.
47 ! Input, integer ( kind = 4 ) M, the number of elements to be transformed
48 ! in the second dimension. The transform is most efficient when M is a
49 ! product of small primes.
51 ! Input, integer ( kind = 4 ) LENSAV, the dimension of the WSAVE array.
52 ! LENSAV must be at least 2*(L+M) + INT(LOG(REAL(L)))
53 ! + INT(LOG(REAL(M))) + 8.
55 ! Output, real ( kind = 8 ) WSAVE(LENSAV), contains the prime factors of L
56 ! and M, and also certain trigonometric values which will be used in
57 ! routines ZFFT2B or ZFFT2F.
59 ! Output, integer ( kind = 4 ) IER, error flag.
61 ! 2, input parameter LENSAV not big enough;
62 ! 20, input error returned by lower level routine.
66 integer ( kind = 4 ) lensav
68 integer ( kind = 4 ) ier
69 integer ( kind = 4 ) ier1
70 integer ( kind = 4 ) iw
71 integer ( kind = 4 ) l
72 integer ( kind = 4 ) m
73 real ( kind = 8 ) wsave(lensav)
77 if ( lensav < 2 * l + int ( log ( real ( l, kind = 8 ) ) ) + &
78 2 * m + int ( log ( real ( m, kind = 8 ) ) ) + 8 ) then
80 call xerfft ( 'ZFFT2I', 4 )
84 call zfftmi ( l, wsave(1), 2*l + int(log(real ( l, kind = 8 ))) + 4, ier1 )
88 call xerfft ( 'ZFFT2I', -5 )
92 ! On 10 May 2010, the value of IW was modified.
94 iw = 2 * l + int ( log ( real ( l, kind = 8 ) ) ) + 5
96 call zfftmi ( m, wsave(iw), 2*m + int(log(real ( m, kind = 8 ))) + 4, ier1 )
100 call xerfft ( 'ZFFT2I', -5 )