Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 : ! !
5 : ! SPDX-License-Identifier: GPL-2.0-or-later !
6 : !--------------------------------------------------------------------------------------------------!
7 :
8 : ! **************************************************************************************************
9 : MODULE ps_wavelet_fft3d
10 :
11 : USE kinds, ONLY: dp
12 : #include "../base/base_uses.f90"
13 :
14 : IMPLICIT NONE
15 : PRIVATE
16 :
17 : CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ps_wavelet_fft3d'
18 :
19 : ! longest fft supported, must be equal to the length of the ctrig array
20 : INTEGER, PARAMETER :: ctrig_length = 8192
21 :
22 : PUBLIC :: fourier_dim, &
23 : ctrig, &
24 : fftstp, ctrig_length
25 :
26 : CONTAINS
27 :
28 : ! **************************************************************************************************
29 : !> \brief Give a number n_next > n compatible for the FFT
30 : !> \param n ...
31 : !> \param n_next ...
32 : ! **************************************************************************************************
33 107417 : SUBROUTINE fourier_dim(n, n_next)
34 : INTEGER, INTENT(in) :: n
35 : INTEGER, INTENT(out) :: n_next
36 :
37 : INTEGER, PARAMETER :: ndata = 149, ndata1024 = 149
38 : INTEGER, DIMENSION(ndata), PARAMETER :: idata = (/3, 4, 5, 6, 8, 9, 12, 15, 16, 18, 20, 24, &
39 : 25, 27, 30, 32, 36, 40, 45, 48, 54, 60, 64, 72, 75, 80, 81, 90, 96, 100, 108, 120, 125, &
40 : 128, 135, 144, 150, 160, 162, 180, 192, 200, 216, 225, 240, 243, 256, 270, 288, 300, 320, &
41 : 324, 360, 375, 384, 400, 405, 432, 450, 480, 486, 500, 512, 540, 576, 600, 625, 640, 648, &
42 : 675, 720, 729, 750, 768, 800, 810, 864, 900, 960, 972, 1000, 1024, 1080, 1125, 1152, 1200,&
43 : 1215, 1280, 1296, 1350, 1440, 1458, 1500, 1536, 1600, 1620, 1728, 1800, 1875, 1920, 1944, &
44 : 2000, 2025, 2048, 2160, 2250, 2304, 2400, 2430, 2500, 2560, 2592, 2700, 2880, 3000, 3072, &
45 : 3125, 3200, 3240, 3375, 3456, 3600, 3750, 3840, 3888, 4000, 4050, 4096, 4320, 4500, 4608, &
46 : 4800, 5000, 5120, 5184, 5400, 5625, 5760, 6000, 6144, 6400, 6480, 6750, 6912, 7200, 7500, &
47 : 7680, 8000, ctrig_length/)
48 :
49 : INTEGER :: i
50 :
51 : !Multiple of 2,3,5
52 :
53 1716256 : loop_data: DO i = 1, ndata1024
54 1716256 : IF (n <= idata(i)) THEN
55 107417 : n_next = idata(i)
56 107417 : RETURN
57 : END IF
58 : END DO loop_data
59 0 : WRITE (unit=*, fmt=*) "fourier_dim: ", n, " is bigger than ", idata(ndata1024)
60 0 : CPABORT("")
61 : END SUBROUTINE fourier_dim
62 :
63 : ! Copyright (C) Stefan Goedecker, CEA Grenoble, 2002
64 : ! This file is distributed under the terms of the
65 : ! GNU General Public License, see http://www.gnu.org/copyleft/gpl.txt .
66 :
67 : ! --------------------------------------------------------------
68 : ! 3-dimensional complex-complex FFT routine:
69 : ! When compared to the best vendor implementations on RISC architectures
70 : ! it gives close to optimal performance (perhaps losing 20 percent in speed)
71 : ! and it is significantly faster than many not so good vendor implementations
72 : ! as well as other portable FFT's.
73 : ! On all vector machines tested so far (Cray, NEC, Fujitsu) is
74 : ! was significantly faster than the vendor routines
75 : ! The theoretical background is described in :
76 : ! 1) S. Goedecker: Rotating a three-dimensional array in optimal
77 : ! positions for vector processing: Case study for a three-dimensional Fast
78 : ! Fourier Transform, Comp. Phys. Commun. \underline{76}, 294 (1993)
79 : ! Citing of this reference is greatly appreciated if the routines are used
80 : ! for scientific work.
81 :
82 : ! Presumably good compiler flags:
83 : ! IBM, serial power 2: xlf -qarch=pwr2 -O2 -qmaxmem=-1
84 : ! with OpenMP: IBM: xlf_r -qfree -O4 -qarch=pwr3 -qtune=pwr3 -qsmp=omp -qmaxmem=-1 ;
85 : ! a.out
86 : ! DEC: f90 -O3 -arch ev67 -pipeline
87 : ! with OpenMP: DEC: f90 -O3 -arch ev67 -pipeline -omp -lelan ;
88 : ! prun -N1 -c4 a.out
89 :
90 : !-----------------------------------------------------------
91 :
92 : ! FFT PART -----------------------------------------------------------------
93 :
94 : ! **************************************************************************************************
95 : !> \brief ...
96 : !> \param n ...
97 : !> \param trig ...
98 : !> \param after ...
99 : !> \param before ...
100 : !> \param now ...
101 : !> \param isign ...
102 : !> \param ic ...
103 : ! **************************************************************************************************
104 94427 : SUBROUTINE ctrig(n, trig, after, before, now, isign, ic)
105 : ! Copyright (C) Stefan Goedecker, Lausanne, Switzerland, August 1, 1991
106 : ! Copyright (C) Stefan Goedecker, Cornell University, Ithaca, USA, 1994
107 : ! Copyright (C) Stefan Goedecker, MPI Stuttgart, Germany, 1999
108 : ! This file is distributed under the terms of the
109 : ! GNU General Public License, see http://www.gnu.org/copyleft/gpl.txt .
110 :
111 : ! Different factorizations affect the performance
112 : ! Factoring 64 as 4*4*4 might for example be faster on some machines than 8*8.
113 : INTEGER :: n
114 : REAL(KIND=dp) :: trig
115 : INTEGER :: after, before, now, isign, ic
116 :
117 : INTEGER :: i, itt, j, nh
118 : REAL(KIND=dp) :: angle, trigc, trigs, twopi
119 :
120 : DIMENSION now(7), after(7), before(7), trig(2, ctrig_length)
121 : INTEGER, DIMENSION(7, 149) :: idata
122 : ! The factor 6 is only allowed in the first place!
123 : DATA((idata(i, j), i=1, 7), j=1, 76)/ &
124 : 3, 3, 1, 1, 1, 1, 1, 4, 4, 1, 1, 1, 1, 1, &
125 : 5, 5, 1, 1, 1, 1, 1, 6, 6, 1, 1, 1, 1, 1, &
126 : 8, 8, 1, 1, 1, 1, 1, 9, 3, 3, 1, 1, 1, 1, &
127 : 12, 4, 3, 1, 1, 1, 1, 15, 5, 3, 1, 1, 1, 1, &
128 : 16, 4, 4, 1, 1, 1, 1, 18, 6, 3, 1, 1, 1, 1, &
129 : 20, 5, 4, 1, 1, 1, 1, 24, 8, 3, 1, 1, 1, 1, &
130 : 25, 5, 5, 1, 1, 1, 1, 27, 3, 3, 3, 1, 1, 1, &
131 : 30, 6, 5, 1, 1, 1, 1, 32, 8, 4, 1, 1, 1, 1, &
132 : 36, 4, 3, 3, 1, 1, 1, 40, 8, 5, 1, 1, 1, 1, &
133 : 45, 5, 3, 3, 1, 1, 1, 48, 4, 4, 3, 1, 1, 1, &
134 : 54, 6, 3, 3, 1, 1, 1, 60, 5, 4, 3, 1, 1, 1, &
135 : 64, 8, 8, 1, 1, 1, 1, 72, 8, 3, 3, 1, 1, 1, &
136 : 75, 5, 5, 3, 1, 1, 1, 80, 5, 4, 4, 1, 1, 1, &
137 : 81, 3, 3, 3, 3, 1, 1, 90, 6, 5, 3, 1, 1, 1, &
138 : 96, 8, 4, 3, 1, 1, 1, 100, 5, 5, 4, 1, 1, 1, &
139 : 108, 4, 3, 3, 3, 1, 1, 120, 8, 5, 3, 1, 1, 1, &
140 : 125, 5, 5, 5, 1, 1, 1, 128, 8, 4, 4, 1, 1, 1, &
141 : 135, 5, 3, 3, 3, 1, 1, 144, 6, 8, 3, 1, 1, 1, &
142 : 150, 6, 5, 5, 1, 1, 1, 160, 8, 5, 4, 1, 1, 1, &
143 : 162, 6, 3, 3, 3, 1, 1, 180, 5, 4, 3, 3, 1, 1, &
144 : 192, 6, 8, 4, 1, 1, 1, 200, 8, 5, 5, 1, 1, 1, &
145 : 216, 8, 3, 3, 3, 1, 1, 225, 5, 5, 3, 3, 1, 1, &
146 : 240, 6, 8, 5, 1, 1, 1, 243, 3, 3, 3, 3, 3, 1, &
147 : 256, 8, 8, 4, 1, 1, 1, 270, 6, 5, 3, 3, 1, 1, &
148 : 288, 8, 4, 3, 3, 1, 1, 300, 5, 5, 4, 3, 1, 1, &
149 : 320, 5, 4, 4, 4, 1, 1, 324, 4, 3, 3, 3, 3, 1, &
150 : 360, 8, 5, 3, 3, 1, 1, 375, 5, 5, 5, 3, 1, 1, &
151 : 384, 8, 4, 4, 3, 1, 1, 400, 5, 5, 4, 4, 1, 1, &
152 : 405, 5, 3, 3, 3, 3, 1, 432, 4, 4, 3, 3, 3, 1, &
153 : 450, 6, 5, 5, 3, 1, 1, 480, 8, 5, 4, 3, 1, 1, &
154 : 486, 6, 3, 3, 3, 3, 1, 500, 5, 5, 5, 4, 1, 1, &
155 : 512, 8, 8, 8, 1, 1, 1, 540, 5, 4, 3, 3, 3, 1, &
156 : 576, 4, 4, 4, 3, 3, 1, 600, 8, 5, 5, 3, 1, 1, &
157 : 625, 5, 5, 5, 5, 1, 1, 640, 8, 5, 4, 4, 1, 1, &
158 : 648, 8, 3, 3, 3, 3, 1, 675, 5, 5, 3, 3, 3, 1, &
159 : 720, 5, 4, 4, 3, 3, 1, 729, 3, 3, 3, 3, 3, 3, &
160 : 750, 6, 5, 5, 5, 1, 1, 768, 4, 4, 4, 4, 3, 1, &
161 : 800, 8, 5, 5, 4, 1, 1, 810, 6, 5, 3, 3, 3, 1/
162 : DATA((idata(i, j), i=1, 7), j=77, 149)/ &
163 : 864, 8, 4, 3, 3, 3, 1, 900, 5, 5, 4, 3, 3, 1, &
164 : 960, 5, 4, 4, 4, 3, 1, 972, 4, 3, 3, 3, 3, 3, &
165 : 1000, 8, 5, 5, 5, 1, 1, 1024, 4, 4, 4, 4, 4, 1, &
166 : 1080, 6, 5, 4, 3, 3, 1, 1125, 5, 5, 5, 3, 3, 1, &
167 : 1152, 6, 4, 4, 4, 3, 1, 1200, 6, 8, 5, 5, 1, 1, &
168 : 1215, 5, 3, 3, 3, 3, 3, 1280, 8, 8, 5, 4, 1, 1, &
169 : 1296, 6, 8, 3, 3, 3, 1, 1350, 6, 5, 5, 3, 3, 1, &
170 : 1440, 6, 5, 4, 4, 3, 1, 1458, 6, 3, 3, 3, 3, 3, &
171 : 1500, 5, 5, 5, 4, 3, 1, 1536, 6, 8, 8, 4, 1, 1, &
172 : 1600, 8, 8, 5, 5, 1, 1, 1620, 5, 4, 3, 3, 3, 3, &
173 : 1728, 6, 8, 4, 3, 3, 1, 1800, 6, 5, 5, 4, 3, 1, &
174 : 1875, 5, 5, 5, 5, 3, 1, 1920, 6, 5, 4, 4, 4, 1, &
175 : 1944, 6, 4, 3, 3, 3, 3, 2000, 5, 5, 5, 4, 4, 1, &
176 : 2025, 5, 5, 3, 3, 3, 3, 2048, 8, 4, 4, 4, 4, 1, &
177 : 2160, 6, 8, 5, 3, 3, 1, 2250, 6, 5, 5, 5, 3, 1, &
178 : 2304, 6, 8, 4, 4, 3, 1, 2400, 6, 5, 5, 4, 4, 1, &
179 : 2430, 6, 5, 3, 3, 3, 3, 2500, 5, 5, 5, 5, 4, 1, &
180 : 2560, 8, 5, 4, 4, 4, 1, 2592, 6, 4, 4, 3, 3, 3, &
181 : 2700, 5, 5, 4, 3, 3, 3, 2880, 6, 8, 5, 4, 3, 1, &
182 : 3000, 6, 5, 5, 5, 4, 1, 3072, 6, 8, 4, 4, 4, 1, &
183 : 3125, 5, 5, 5, 5, 5, 1, 3200, 8, 5, 5, 4, 4, 1, &
184 : 3240, 6, 5, 4, 3, 3, 3, 3375, 5, 5, 5, 3, 3, 3, &
185 : 3456, 6, 4, 4, 4, 3, 3, 3600, 6, 8, 5, 5, 3, 1, &
186 : 3750, 6, 5, 5, 5, 5, 1, 3840, 6, 8, 5, 4, 4, 1, &
187 : 3888, 6, 8, 3, 3, 3, 3, 4000, 8, 5, 5, 5, 4, 1, &
188 : 4050, 6, 5, 5, 3, 3, 3, 4096, 8, 8, 4, 4, 4, 1, &
189 : 4320, 6, 5, 4, 4, 3, 3, 4500, 5, 5, 5, 4, 3, 3, &
190 : 4608, 6, 8, 8, 4, 3, 1, 4800, 6, 8, 5, 5, 4, 1, &
191 : 5000, 8, 5, 5, 5, 5, 1, 5120, 8, 8, 5, 4, 4, 1, &
192 : 5184, 6, 8, 4, 3, 3, 3, 5400, 6, 5, 5, 4, 3, 3, &
193 : 5625, 5, 5, 5, 5, 3, 3, 5760, 6, 8, 8, 5, 3, 1, &
194 : 6000, 6, 8, 5, 5, 5, 1, 6144, 6, 8, 8, 4, 4, 1, &
195 : 6400, 8, 8, 5, 5, 4, 1, 6480, 6, 8, 5, 3, 3, 3, &
196 : 6750, 6, 5, 5, 5, 3, 3, 6912, 6, 8, 4, 4, 3, 3, &
197 : 7200, 6, 5, 5, 4, 4, 3, 7500, 5, 5, 5, 5, 4, 3, &
198 : 7680, 6, 8, 8, 5, 4, 1, 8000, 8, 8, 5, 5, 5, 1, &
199 : 8192, 8, 8, 8, 4, 4, 1/
200 :
201 1520350 : DO i = 1, 150
202 1520350 : IF (i == 150) THEN
203 0 : PRINT *, 'VALUE OF', n, 'NOT ALLOWED FOR FFT, ALLOWED VALUES ARE:'
204 : 37 FORMAT(15(i5))
205 0 : WRITE (*, 37) (idata(1, j), j=1, 149)
206 0 : CPABORT("")
207 : END IF
208 1520350 : IF (n .EQ. idata(1, i)) THEN
209 94427 : ic = 0
210 322247 : DO j = 1, 6
211 322247 : itt = idata(1 + j, i)
212 322247 : IF (itt .GT. 1) THEN
213 227820 : ic = ic + 1
214 227820 : now(j) = idata(1 + j, i)
215 : ELSE
216 : EXIT
217 : END IF
218 : END DO
219 : EXIT
220 : END IF
221 : END DO
222 :
223 94427 : after(1) = 1
224 94427 : before(ic) = 1
225 227820 : DO i = 2, ic
226 133393 : after(i) = after(i - 1)*now(i - 1)
227 227820 : before(ic - i + 1) = before(ic - i + 2)*now(ic - i + 2)
228 : END DO
229 :
230 94427 : twopi = 6.283185307179586_dp
231 94427 : angle = isign*twopi/n
232 94427 : IF (MOD(n, 2) .EQ. 0) THEN
233 83012 : nh = n/2
234 83012 : trig(1, 1) = 1._dp
235 83012 : trig(2, 1) = 0._dp
236 83012 : trig(1, nh + 1) = -1._dp
237 83012 : trig(2, nh + 1) = 0._dp
238 1789238 : DO 40, i = 1, nh - 1
239 1706226 : trigc = COS(i*angle)
240 1706226 : trigs = SIN(i*angle)
241 1706226 : trig(1, i + 1) = trigc
242 1706226 : trig(2, i + 1) = trigs
243 1706226 : trig(1, n - i + 1) = trigc
244 1706226 : trig(2, n - i + 1) = -trigs
245 83012 : 40 CONTINUE
246 : ELSE
247 11415 : nh = (n - 1)/2
248 11415 : trig(1, 1) = 1._dp
249 11415 : trig(2, 1) = 0._dp
250 113268 : DO 20, i = 1, nh
251 101853 : trigc = COS(i*angle)
252 101853 : trigs = SIN(i*angle)
253 101853 : trig(1, i + 1) = trigc
254 101853 : trig(2, i + 1) = trigs
255 101853 : trig(1, n - i + 1) = trigc
256 101853 : trig(2, n - i + 1) = -trigs
257 11415 : 20 CONTINUE
258 : END IF
259 :
260 94427 : END SUBROUTINE ctrig
261 :
262 : !ccccccccccccccccccccccccccccccccccccccccccccccc
263 :
264 : ! **************************************************************************************************
265 : !> \brief ...
266 : !> \param mm ...
267 : !> \param nfft ...
268 : !> \param m ...
269 : !> \param nn ...
270 : !> \param n ...
271 : !> \param zin ...
272 : !> \param zout ...
273 : !> \param trig ...
274 : !> \param after ...
275 : !> \param now ...
276 : !> \param before ...
277 : !> \param isign ...
278 : ! **************************************************************************************************
279 21309483 : SUBROUTINE fftstp(mm, nfft, m, nn, n, zin, zout, trig, after, now, before, isign)
280 : ! Copyright (C) Stefan Goedecker, Cornell University, Ithaca, USA, 1994
281 : ! Copyright (C) Stefan Goedecker, MPI Stuttgart, Germany, 1995, 1999
282 : ! This file is distributed under the terms of the
283 : ! GNU General Public License, see http://www.gnu.org/copyleft/gpl.txt .
284 :
285 : INTEGER :: mm, nfft, m, nn, n
286 : REAL(KIND=dp) :: zin, zout, trig
287 : INTEGER :: after, now, before, isign
288 :
289 : INTEGER :: atb, atn, ia, ias, ib, itrig, itt, j, &
290 : nin1, nin2, nin3, nin4, nin5, nin6, &
291 : nin7, nin8, nout1, nout2, nout3, &
292 : nout4, nout5, nout6, nout7, nout8
293 : REAL(KIND=dp) :: am, ap, bb, bm, bp, ci2, ci3, ci4, ci5, ci6, ci7, ci8, cm, cos2, cos4, cp, &
294 : cr2, cr3, cr4, cr5, cr6, cr7, cr8, dm, dpp, r, r1, r2, r25, r3, r34, r4, r5, r6, r7, r8, &
295 : rt2i, s, s1, s2, s25, s3, s34, s4, s5, s6, s7, s8, sin2, sin4, ui1, ui2, ui3, ur1, ur2, &
296 : ur3, vi1, vi2, vi3, vr1, vr2, vr3
297 :
298 : DIMENSION trig(2, ctrig_length), zin(2, mm, m), zout(2, nn, n)
299 21309483 : atn = after*now
300 21309483 : atb = after*before
301 :
302 : ! sqrt(.5_dp)
303 21309483 : rt2i = 0.7071067811865475_dp
304 : IF (now .EQ. 2) THEN
305 0 : ia = 1
306 0 : nin1 = ia - after
307 0 : nout1 = ia - atn
308 0 : DO ib = 1, before
309 0 : nin1 = nin1 + after
310 0 : nin2 = nin1 + atb
311 0 : nout1 = nout1 + atn
312 0 : nout2 = nout1 + after
313 0 : DO j = 1, nfft
314 0 : r1 = zin(1, j, nin1)
315 0 : s1 = zin(2, j, nin1)
316 0 : r2 = zin(1, j, nin2)
317 0 : s2 = zin(2, j, nin2)
318 0 : zout(1, j, nout1) = r2 + r1
319 0 : zout(2, j, nout1) = s2 + s1
320 0 : zout(1, j, nout2) = r1 - r2
321 0 : zout(2, j, nout2) = s1 - s2
322 : END DO; END DO
323 0 : DO 2000, ia = 2, after
324 0 : ias = ia - 1
325 0 : IF (2*ias .EQ. after) THEN
326 0 : IF (isign .EQ. 1) THEN
327 0 : nin1 = ia - after
328 0 : nout1 = ia - atn
329 0 : DO ib = 1, before
330 0 : nin1 = nin1 + after
331 0 : nin2 = nin1 + atb
332 0 : nout1 = nout1 + atn
333 0 : nout2 = nout1 + after
334 0 : DO j = 1, nfft
335 0 : r1 = zin(1, j, nin1)
336 0 : s1 = zin(2, j, nin1)
337 0 : r2 = zin(2, j, nin2)
338 0 : s2 = zin(1, j, nin2)
339 0 : zout(1, j, nout1) = r1 - r2
340 0 : zout(2, j, nout1) = s2 + s1
341 0 : zout(1, j, nout2) = r2 + r1
342 0 : zout(2, j, nout2) = s1 - s2
343 : END DO; END DO
344 : ELSE
345 0 : nin1 = ia - after
346 0 : nout1 = ia - atn
347 0 : DO ib = 1, before
348 0 : nin1 = nin1 + after
349 0 : nin2 = nin1 + atb
350 0 : nout1 = nout1 + atn
351 0 : nout2 = nout1 + after
352 0 : DO j = 1, nfft
353 0 : r1 = zin(1, j, nin1)
354 0 : s1 = zin(2, j, nin1)
355 0 : r2 = zin(2, j, nin2)
356 0 : s2 = zin(1, j, nin2)
357 0 : zout(1, j, nout1) = r2 + r1
358 0 : zout(2, j, nout1) = s1 - s2
359 0 : zout(1, j, nout2) = r1 - r2
360 0 : zout(2, j, nout2) = s2 + s1
361 : END DO; END DO
362 : END IF
363 0 : ELSE IF (4*ias .EQ. after) THEN
364 0 : IF (isign .EQ. 1) THEN
365 0 : nin1 = ia - after
366 0 : nout1 = ia - atn
367 0 : DO ib = 1, before
368 0 : nin1 = nin1 + after
369 0 : nin2 = nin1 + atb
370 0 : nout1 = nout1 + atn
371 0 : nout2 = nout1 + after
372 0 : DO j = 1, nfft
373 0 : r1 = zin(1, j, nin1)
374 0 : s1 = zin(2, j, nin1)
375 0 : r = zin(1, j, nin2)
376 0 : s = zin(2, j, nin2)
377 0 : r2 = (r - s)*rt2i
378 0 : s2 = (r + s)*rt2i
379 0 : zout(1, j, nout1) = r2 + r1
380 0 : zout(2, j, nout1) = s2 + s1
381 0 : zout(1, j, nout2) = r1 - r2
382 0 : zout(2, j, nout2) = s1 - s2
383 : END DO; END DO
384 : ELSE
385 0 : nin1 = ia - after
386 0 : nout1 = ia - atn
387 0 : DO ib = 1, before
388 0 : nin1 = nin1 + after
389 0 : nin2 = nin1 + atb
390 0 : nout1 = nout1 + atn
391 0 : nout2 = nout1 + after
392 0 : DO j = 1, nfft
393 0 : r1 = zin(1, j, nin1)
394 0 : s1 = zin(2, j, nin1)
395 0 : r = zin(1, j, nin2)
396 0 : s = zin(2, j, nin2)
397 0 : r2 = (r + s)*rt2i
398 0 : s2 = (s - r)*rt2i
399 0 : zout(1, j, nout1) = r2 + r1
400 0 : zout(2, j, nout1) = s2 + s1
401 0 : zout(1, j, nout2) = r1 - r2
402 0 : zout(2, j, nout2) = s1 - s2
403 : END DO; END DO
404 : END IF
405 0 : ELSE IF (4*ias .EQ. 3*after) THEN
406 0 : IF (isign .EQ. 1) THEN
407 0 : nin1 = ia - after
408 0 : nout1 = ia - atn
409 0 : DO ib = 1, before
410 0 : nin1 = nin1 + after
411 0 : nin2 = nin1 + atb
412 0 : nout1 = nout1 + atn
413 0 : nout2 = nout1 + after
414 0 : DO j = 1, nfft
415 0 : r1 = zin(1, j, nin1)
416 0 : s1 = zin(2, j, nin1)
417 0 : r = zin(1, j, nin2)
418 0 : s = zin(2, j, nin2)
419 0 : r2 = (r + s)*rt2i
420 0 : s2 = (r - s)*rt2i
421 0 : zout(1, j, nout1) = r1 - r2
422 0 : zout(2, j, nout1) = s2 + s1
423 0 : zout(1, j, nout2) = r2 + r1
424 0 : zout(2, j, nout2) = s1 - s2
425 : END DO; END DO
426 : ELSE
427 0 : nin1 = ia - after
428 0 : nout1 = ia - atn
429 0 : DO ib = 1, before
430 0 : nin1 = nin1 + after
431 0 : nin2 = nin1 + atb
432 0 : nout1 = nout1 + atn
433 0 : nout2 = nout1 + after
434 0 : DO j = 1, nfft
435 0 : r1 = zin(1, j, nin1)
436 0 : s1 = zin(2, j, nin1)
437 0 : r = zin(1, j, nin2)
438 0 : s = zin(2, j, nin2)
439 0 : r2 = (s - r)*rt2i
440 0 : s2 = (r + s)*rt2i
441 0 : zout(1, j, nout1) = r2 + r1
442 0 : zout(2, j, nout1) = s1 - s2
443 0 : zout(1, j, nout2) = r1 - r2
444 0 : zout(2, j, nout2) = s2 + s1
445 : END DO; END DO
446 : END IF
447 : ELSE
448 0 : itrig = ias*before + 1
449 0 : cr2 = trig(1, itrig)
450 0 : ci2 = trig(2, itrig)
451 0 : nin1 = ia - after
452 0 : nout1 = ia - atn
453 0 : DO ib = 1, before
454 0 : nin1 = nin1 + after
455 0 : nin2 = nin1 + atb
456 0 : nout1 = nout1 + atn
457 0 : nout2 = nout1 + after
458 0 : DO j = 1, nfft
459 0 : r1 = zin(1, j, nin1)
460 0 : s1 = zin(2, j, nin1)
461 0 : r = zin(1, j, nin2)
462 0 : s = zin(2, j, nin2)
463 0 : r2 = r*cr2 - s*ci2
464 0 : s2 = r*ci2 + s*cr2
465 0 : zout(1, j, nout1) = r2 + r1
466 0 : zout(2, j, nout1) = s2 + s1
467 0 : zout(1, j, nout2) = r1 - r2
468 0 : zout(2, j, nout2) = s1 - s2
469 : END DO; END DO
470 : END IF
471 0 : 2000 CONTINUE
472 : ELSE IF (now .EQ. 4) THEN
473 4646065 : IF (isign .EQ. 1) THEN
474 2381323 : ia = 1
475 2381323 : nin1 = ia - after
476 2381323 : nout1 = ia - atn
477 23246305 : DO ib = 1, before
478 20864982 : nin1 = nin1 + after
479 20864982 : nin2 = nin1 + atb
480 20864982 : nin3 = nin2 + atb
481 20864982 : nin4 = nin3 + atb
482 20864982 : nout1 = nout1 + atn
483 20864982 : nout2 = nout1 + after
484 20864982 : nout3 = nout2 + after
485 20864982 : nout4 = nout3 + after
486 428162584 : DO j = 1, nfft
487 404916279 : r1 = zin(1, j, nin1)
488 404916279 : s1 = zin(2, j, nin1)
489 404916279 : r2 = zin(1, j, nin2)
490 404916279 : s2 = zin(2, j, nin2)
491 404916279 : r3 = zin(1, j, nin3)
492 404916279 : s3 = zin(2, j, nin3)
493 404916279 : r4 = zin(1, j, nin4)
494 404916279 : s4 = zin(2, j, nin4)
495 404916279 : r = r1 + r3
496 404916279 : s = r2 + r4
497 404916279 : zout(1, j, nout1) = r + s
498 404916279 : zout(1, j, nout3) = r - s
499 404916279 : r = r1 - r3
500 404916279 : s = s2 - s4
501 404916279 : zout(1, j, nout2) = r - s
502 404916279 : zout(1, j, nout4) = r + s
503 404916279 : r = s1 + s3
504 404916279 : s = s2 + s4
505 404916279 : zout(2, j, nout1) = r + s
506 404916279 : zout(2, j, nout3) = r - s
507 404916279 : r = s1 - s3
508 404916279 : s = r2 - r4
509 404916279 : zout(2, j, nout2) = r + s
510 425781261 : zout(2, j, nout4) = r - s
511 : END DO; END DO
512 22276030 : DO 4000, ia = 2, after
513 19894707 : ias = ia - 1
514 19894707 : IF (2*ias .EQ. after) THEN
515 900621 : nin1 = ia - after
516 900621 : nout1 = ia - atn
517 2047185 : DO ib = 1, before
518 1146564 : nin1 = nin1 + after
519 1146564 : nin2 = nin1 + atb
520 1146564 : nin3 = nin2 + atb
521 1146564 : nin4 = nin3 + atb
522 1146564 : nout1 = nout1 + atn
523 1146564 : nout2 = nout1 + after
524 1146564 : nout3 = nout2 + after
525 1146564 : nout4 = nout3 + after
526 24863090 : DO j = 1, nfft
527 22815905 : r1 = zin(1, j, nin1)
528 22815905 : s1 = zin(2, j, nin1)
529 22815905 : r = zin(1, j, nin2)
530 22815905 : s = zin(2, j, nin2)
531 22815905 : r2 = (r - s)*rt2i
532 22815905 : s2 = (r + s)*rt2i
533 22815905 : r3 = zin(2, j, nin3)
534 22815905 : s3 = zin(1, j, nin3)
535 22815905 : r = zin(1, j, nin4)
536 22815905 : s = zin(2, j, nin4)
537 22815905 : r4 = (r + s)*rt2i
538 22815905 : s4 = (r - s)*rt2i
539 22815905 : r = r1 - r3
540 22815905 : s = r2 - r4
541 22815905 : zout(1, j, nout1) = r + s
542 22815905 : zout(1, j, nout3) = r - s
543 22815905 : r = r1 + r3
544 22815905 : s = s2 - s4
545 22815905 : zout(1, j, nout2) = r - s
546 22815905 : zout(1, j, nout4) = r + s
547 22815905 : r = s1 + s3
548 22815905 : s = s2 + s4
549 22815905 : zout(2, j, nout1) = r + s
550 22815905 : zout(2, j, nout3) = r - s
551 22815905 : r = s1 - s3
552 22815905 : s = r2 + r4
553 22815905 : zout(2, j, nout2) = r + s
554 23962469 : zout(2, j, nout4) = r - s
555 : END DO; END DO
556 : ELSE
557 18994086 : itt = ias*before
558 18994086 : itrig = itt + 1
559 18994086 : cr2 = trig(1, itrig)
560 18994086 : ci2 = trig(2, itrig)
561 18994086 : itrig = itrig + itt
562 18994086 : cr3 = trig(1, itrig)
563 18994086 : ci3 = trig(2, itrig)
564 18994086 : itrig = itrig + itt
565 18994086 : cr4 = trig(1, itrig)
566 18994086 : ci4 = trig(2, itrig)
567 18994086 : nin1 = ia - after
568 18994086 : nout1 = ia - atn
569 47265150 : DO ib = 1, before
570 28271064 : nin1 = nin1 + after
571 28271064 : nin2 = nin1 + atb
572 28271064 : nin3 = nin2 + atb
573 28271064 : nin4 = nin3 + atb
574 28271064 : nout1 = nout1 + atn
575 28271064 : nout2 = nout1 + after
576 28271064 : nout3 = nout2 + after
577 28271064 : nout4 = nout3 + after
578 584507176 : DO j = 1, nfft
579 537242026 : r1 = zin(1, j, nin1)
580 537242026 : s1 = zin(2, j, nin1)
581 537242026 : r = zin(1, j, nin2)
582 537242026 : s = zin(2, j, nin2)
583 537242026 : r2 = r*cr2 - s*ci2
584 537242026 : s2 = r*ci2 + s*cr2
585 537242026 : r = zin(1, j, nin3)
586 537242026 : s = zin(2, j, nin3)
587 537242026 : r3 = r*cr3 - s*ci3
588 537242026 : s3 = r*ci3 + s*cr3
589 537242026 : r = zin(1, j, nin4)
590 537242026 : s = zin(2, j, nin4)
591 537242026 : r4 = r*cr4 - s*ci4
592 537242026 : s4 = r*ci4 + s*cr4
593 537242026 : r = r1 + r3
594 537242026 : s = r2 + r4
595 537242026 : zout(1, j, nout1) = r + s
596 537242026 : zout(1, j, nout3) = r - s
597 537242026 : r = r1 - r3
598 537242026 : s = s2 - s4
599 537242026 : zout(1, j, nout2) = r - s
600 537242026 : zout(1, j, nout4) = r + s
601 537242026 : r = s1 + s3
602 537242026 : s = s2 + s4
603 537242026 : zout(2, j, nout1) = r + s
604 537242026 : zout(2, j, nout3) = r - s
605 537242026 : r = s1 - s3
606 537242026 : s = r2 - r4
607 537242026 : zout(2, j, nout2) = r + s
608 565513090 : zout(2, j, nout4) = r - s
609 : END DO; END DO
610 : END IF
611 2381323 : 4000 CONTINUE
612 : ELSE
613 2264742 : ia = 1
614 2264742 : nin1 = ia - after
615 2264742 : nout1 = ia - atn
616 22043813 : DO ib = 1, before
617 19779071 : nin1 = nin1 + after
618 19779071 : nin2 = nin1 + atb
619 19779071 : nin3 = nin2 + atb
620 19779071 : nin4 = nin3 + atb
621 19779071 : nout1 = nout1 + atn
622 19779071 : nout2 = nout1 + after
623 19779071 : nout3 = nout2 + after
624 19779071 : nout4 = nout3 + after
625 406992809 : DO j = 1, nfft
626 384948996 : r1 = zin(1, j, nin1)
627 384948996 : s1 = zin(2, j, nin1)
628 384948996 : r2 = zin(1, j, nin2)
629 384948996 : s2 = zin(2, j, nin2)
630 384948996 : r3 = zin(1, j, nin3)
631 384948996 : s3 = zin(2, j, nin3)
632 384948996 : r4 = zin(1, j, nin4)
633 384948996 : s4 = zin(2, j, nin4)
634 384948996 : r = r1 + r3
635 384948996 : s = r2 + r4
636 384948996 : zout(1, j, nout1) = r + s
637 384948996 : zout(1, j, nout3) = r - s
638 384948996 : r = r1 - r3
639 384948996 : s = s2 - s4
640 384948996 : zout(1, j, nout2) = r + s
641 384948996 : zout(1, j, nout4) = r - s
642 384948996 : r = s1 + s3
643 384948996 : s = s2 + s4
644 384948996 : zout(2, j, nout1) = r + s
645 384948996 : zout(2, j, nout3) = r - s
646 384948996 : r = s1 - s3
647 384948996 : s = r2 - r4
648 384948996 : zout(2, j, nout2) = r - s
649 404728067 : zout(2, j, nout4) = r + s
650 : END DO; END DO
651 20947391 : DO 4100, ia = 2, after
652 18682649 : ias = ia - 1
653 18682649 : IF (2*ias .EQ. after) THEN
654 852899 : nin1 = ia - after
655 852899 : nout1 = ia - atn
656 1927048 : DO ib = 1, before
657 1074149 : nin1 = nin1 + after
658 1074149 : nin2 = nin1 + atb
659 1074149 : nin3 = nin2 + atb
660 1074149 : nin4 = nin3 + atb
661 1074149 : nout1 = nout1 + atn
662 1074149 : nout2 = nout1 + after
663 1074149 : nout3 = nout2 + after
664 1074149 : nout4 = nout3 + after
665 23292304 : DO j = 1, nfft
666 21365256 : r1 = zin(1, j, nin1)
667 21365256 : s1 = zin(2, j, nin1)
668 21365256 : r = zin(1, j, nin2)
669 21365256 : s = zin(2, j, nin2)
670 21365256 : r2 = (r + s)*rt2i
671 21365256 : s2 = (s - r)*rt2i
672 21365256 : r3 = zin(2, j, nin3)
673 21365256 : s3 = zin(1, j, nin3)
674 21365256 : r = zin(1, j, nin4)
675 21365256 : s = zin(2, j, nin4)
676 21365256 : r4 = (s - r)*rt2i
677 21365256 : s4 = (r + s)*rt2i
678 21365256 : r = r1 + r3
679 21365256 : s = r2 + r4
680 21365256 : zout(1, j, nout1) = r + s
681 21365256 : zout(1, j, nout3) = r - s
682 21365256 : r = r1 - r3
683 21365256 : s = s2 + s4
684 21365256 : zout(1, j, nout2) = r + s
685 21365256 : zout(1, j, nout4) = r - s
686 21365256 : r = s1 - s3
687 21365256 : s = s2 - s4
688 21365256 : zout(2, j, nout1) = r + s
689 21365256 : zout(2, j, nout3) = r - s
690 21365256 : r = s1 + s3
691 21365256 : s = r2 - r4
692 21365256 : zout(2, j, nout2) = r - s
693 22439405 : zout(2, j, nout4) = r + s
694 : END DO; END DO
695 : ELSE
696 17829750 : itt = ias*before
697 17829750 : itrig = itt + 1
698 17829750 : cr2 = trig(1, itrig)
699 17829750 : ci2 = trig(2, itrig)
700 17829750 : itrig = itrig + itt
701 17829750 : cr3 = trig(1, itrig)
702 17829750 : ci3 = trig(2, itrig)
703 17829750 : itrig = itrig + itt
704 17829750 : cr4 = trig(1, itrig)
705 17829750 : ci4 = trig(2, itrig)
706 17829750 : nin1 = ia - after
707 17829750 : nout1 = ia - atn
708 44486232 : DO ib = 1, before
709 26656482 : nin1 = nin1 + after
710 26656482 : nin2 = nin1 + atb
711 26656482 : nin3 = nin2 + atb
712 26656482 : nin4 = nin3 + atb
713 26656482 : nout1 = nout1 + atn
714 26656482 : nout2 = nout1 + after
715 26656482 : nout3 = nout2 + after
716 26656482 : nout4 = nout3 + after
717 554182248 : DO j = 1, nfft
718 509696016 : r1 = zin(1, j, nin1)
719 509696016 : s1 = zin(2, j, nin1)
720 509696016 : r = zin(1, j, nin2)
721 509696016 : s = zin(2, j, nin2)
722 509696016 : r2 = r*cr2 - s*ci2
723 509696016 : s2 = r*ci2 + s*cr2
724 509696016 : r = zin(1, j, nin3)
725 509696016 : s = zin(2, j, nin3)
726 509696016 : r3 = r*cr3 - s*ci3
727 509696016 : s3 = r*ci3 + s*cr3
728 509696016 : r = zin(1, j, nin4)
729 509696016 : s = zin(2, j, nin4)
730 509696016 : r4 = r*cr4 - s*ci4
731 509696016 : s4 = r*ci4 + s*cr4
732 509696016 : r = r1 + r3
733 509696016 : s = r2 + r4
734 509696016 : zout(1, j, nout1) = r + s
735 509696016 : zout(1, j, nout3) = r - s
736 509696016 : r = r1 - r3
737 509696016 : s = s2 - s4
738 509696016 : zout(1, j, nout2) = r + s
739 509696016 : zout(1, j, nout4) = r - s
740 509696016 : r = s1 + s3
741 509696016 : s = s2 + s4
742 509696016 : zout(2, j, nout1) = r + s
743 509696016 : zout(2, j, nout3) = r - s
744 509696016 : r = s1 - s3
745 509696016 : s = r2 - r4
746 509696016 : zout(2, j, nout2) = r - s
747 536352498 : zout(2, j, nout4) = r + s
748 : END DO; END DO
749 : END IF
750 2264742 : 4100 CONTINUE
751 : END IF
752 : ELSE IF (now .EQ. 8) THEN
753 2149517 : IF (isign .EQ. -1) THEN
754 1037882 : ia = 1
755 1037882 : nin1 = ia - after
756 1037882 : nout1 = ia - atn
757 8808928 : DO ib = 1, before
758 7771046 : nin1 = nin1 + after
759 7771046 : nin2 = nin1 + atb
760 7771046 : nin3 = nin2 + atb
761 7771046 : nin4 = nin3 + atb
762 7771046 : nin5 = nin4 + atb
763 7771046 : nin6 = nin5 + atb
764 7771046 : nin7 = nin6 + atb
765 7771046 : nin8 = nin7 + atb
766 7771046 : nout1 = nout1 + atn
767 7771046 : nout2 = nout1 + after
768 7771046 : nout3 = nout2 + after
769 7771046 : nout4 = nout3 + after
770 7771046 : nout5 = nout4 + after
771 7771046 : nout6 = nout5 + after
772 7771046 : nout7 = nout6 + after
773 7771046 : nout8 = nout7 + after
774 157654420 : DO j = 1, nfft
775 148845492 : r1 = zin(1, j, nin1)
776 148845492 : s1 = zin(2, j, nin1)
777 148845492 : r2 = zin(1, j, nin2)
778 148845492 : s2 = zin(2, j, nin2)
779 148845492 : r3 = zin(1, j, nin3)
780 148845492 : s3 = zin(2, j, nin3)
781 148845492 : r4 = zin(1, j, nin4)
782 148845492 : s4 = zin(2, j, nin4)
783 148845492 : r5 = zin(1, j, nin5)
784 148845492 : s5 = zin(2, j, nin5)
785 148845492 : r6 = zin(1, j, nin6)
786 148845492 : s6 = zin(2, j, nin6)
787 148845492 : r7 = zin(1, j, nin7)
788 148845492 : s7 = zin(2, j, nin7)
789 148845492 : r8 = zin(1, j, nin8)
790 148845492 : s8 = zin(2, j, nin8)
791 148845492 : r = r1 + r5
792 148845492 : s = r3 + r7
793 148845492 : ap = r + s
794 148845492 : am = r - s
795 148845492 : r = r2 + r6
796 148845492 : s = r4 + r8
797 148845492 : bp = r + s
798 148845492 : bm = r - s
799 148845492 : r = s1 + s5
800 148845492 : s = s3 + s7
801 148845492 : cp = r + s
802 148845492 : cm = r - s
803 148845492 : r = s2 + s6
804 148845492 : s = s4 + s8
805 148845492 : dpp = r + s
806 148845492 : dm = r - s
807 148845492 : zout(1, j, nout1) = ap + bp
808 148845492 : zout(2, j, nout1) = cp + dpp
809 148845492 : zout(1, j, nout5) = ap - bp
810 148845492 : zout(2, j, nout5) = cp - dpp
811 148845492 : zout(1, j, nout3) = am + dm
812 148845492 : zout(2, j, nout3) = cm - bm
813 148845492 : zout(1, j, nout7) = am - dm
814 148845492 : zout(2, j, nout7) = cm + bm
815 148845492 : r = r1 - r5
816 148845492 : s = s3 - s7
817 148845492 : ap = r + s
818 148845492 : am = r - s
819 148845492 : r = s1 - s5
820 148845492 : s = r3 - r7
821 148845492 : bp = r + s
822 148845492 : bm = r - s
823 148845492 : r = s4 - s8
824 148845492 : s = r2 - r6
825 148845492 : cp = r + s
826 148845492 : cm = r - s
827 148845492 : r = s2 - s6
828 148845492 : s = r4 - r8
829 148845492 : dpp = r + s
830 148845492 : dm = r - s
831 148845492 : r = (cp + dm)*rt2i
832 148845492 : s = (dm - cp)*rt2i
833 148845492 : cp = (cm + dpp)*rt2i
834 148845492 : dpp = (cm - dpp)*rt2i
835 148845492 : zout(1, j, nout2) = ap + r
836 148845492 : zout(2, j, nout2) = bm + s
837 148845492 : zout(1, j, nout6) = ap - r
838 148845492 : zout(2, j, nout6) = bm - s
839 148845492 : zout(1, j, nout4) = am + cp
840 148845492 : zout(2, j, nout4) = bp + dpp
841 148845492 : zout(1, j, nout8) = am - cp
842 156616538 : zout(2, j, nout8) = bp - dpp
843 : END DO; END DO
844 2911011 : DO 8000, ia = 2, after
845 1873129 : ias = ia - 1
846 1873129 : itt = ias*before
847 1873129 : itrig = itt + 1
848 1873129 : cr2 = trig(1, itrig)
849 1873129 : ci2 = trig(2, itrig)
850 1873129 : itrig = itrig + itt
851 1873129 : cr3 = trig(1, itrig)
852 1873129 : ci3 = trig(2, itrig)
853 1873129 : itrig = itrig + itt
854 1873129 : cr4 = trig(1, itrig)
855 1873129 : ci4 = trig(2, itrig)
856 1873129 : itrig = itrig + itt
857 1873129 : cr5 = trig(1, itrig)
858 1873129 : ci5 = trig(2, itrig)
859 1873129 : itrig = itrig + itt
860 1873129 : cr6 = trig(1, itrig)
861 1873129 : ci6 = trig(2, itrig)
862 1873129 : itrig = itrig + itt
863 1873129 : cr7 = trig(1, itrig)
864 1873129 : ci7 = trig(2, itrig)
865 1873129 : itrig = itrig + itt
866 1873129 : cr8 = trig(1, itrig)
867 1873129 : ci8 = trig(2, itrig)
868 1873129 : nin1 = ia - after
869 1873129 : nout1 = ia - atn
870 6940468 : DO ib = 1, before
871 5067339 : nin1 = nin1 + after
872 5067339 : nin2 = nin1 + atb
873 5067339 : nin3 = nin2 + atb
874 5067339 : nin4 = nin3 + atb
875 5067339 : nin5 = nin4 + atb
876 5067339 : nin6 = nin5 + atb
877 5067339 : nin7 = nin6 + atb
878 5067339 : nin8 = nin7 + atb
879 5067339 : nout1 = nout1 + atn
880 5067339 : nout2 = nout1 + after
881 5067339 : nout3 = nout2 + after
882 5067339 : nout4 = nout3 + after
883 5067339 : nout5 = nout4 + after
884 5067339 : nout6 = nout5 + after
885 5067339 : nout7 = nout6 + after
886 5067339 : nout8 = nout7 + after
887 74662396 : DO j = 1, nfft
888 67721928 : r1 = zin(1, j, nin1)
889 67721928 : s1 = zin(2, j, nin1)
890 67721928 : r = zin(1, j, nin2)
891 67721928 : s = zin(2, j, nin2)
892 67721928 : r2 = r*cr2 - s*ci2
893 67721928 : s2 = r*ci2 + s*cr2
894 67721928 : r = zin(1, j, nin3)
895 67721928 : s = zin(2, j, nin3)
896 67721928 : r3 = r*cr3 - s*ci3
897 67721928 : s3 = r*ci3 + s*cr3
898 67721928 : r = zin(1, j, nin4)
899 67721928 : s = zin(2, j, nin4)
900 67721928 : r4 = r*cr4 - s*ci4
901 67721928 : s4 = r*ci4 + s*cr4
902 67721928 : r = zin(1, j, nin5)
903 67721928 : s = zin(2, j, nin5)
904 67721928 : r5 = r*cr5 - s*ci5
905 67721928 : s5 = r*ci5 + s*cr5
906 67721928 : r = zin(1, j, nin6)
907 67721928 : s = zin(2, j, nin6)
908 67721928 : r6 = r*cr6 - s*ci6
909 67721928 : s6 = r*ci6 + s*cr6
910 67721928 : r = zin(1, j, nin7)
911 67721928 : s = zin(2, j, nin7)
912 67721928 : r7 = r*cr7 - s*ci7
913 67721928 : s7 = r*ci7 + s*cr7
914 67721928 : r = zin(1, j, nin8)
915 67721928 : s = zin(2, j, nin8)
916 67721928 : r8 = r*cr8 - s*ci8
917 67721928 : s8 = r*ci8 + s*cr8
918 67721928 : r = r1 + r5
919 67721928 : s = r3 + r7
920 67721928 : ap = r + s
921 67721928 : am = r - s
922 67721928 : r = r2 + r6
923 67721928 : s = r4 + r8
924 67721928 : bp = r + s
925 67721928 : bm = r - s
926 67721928 : r = s1 + s5
927 67721928 : s = s3 + s7
928 67721928 : cp = r + s
929 67721928 : cm = r - s
930 67721928 : r = s2 + s6
931 67721928 : s = s4 + s8
932 67721928 : dpp = r + s
933 67721928 : dm = r - s
934 67721928 : zout(1, j, nout1) = ap + bp
935 67721928 : zout(2, j, nout1) = cp + dpp
936 67721928 : zout(1, j, nout5) = ap - bp
937 67721928 : zout(2, j, nout5) = cp - dpp
938 67721928 : zout(1, j, nout3) = am + dm
939 67721928 : zout(2, j, nout3) = cm - bm
940 67721928 : zout(1, j, nout7) = am - dm
941 67721928 : zout(2, j, nout7) = cm + bm
942 67721928 : r = r1 - r5
943 67721928 : s = s3 - s7
944 67721928 : ap = r + s
945 67721928 : am = r - s
946 67721928 : r = s1 - s5
947 67721928 : s = r3 - r7
948 67721928 : bp = r + s
949 67721928 : bm = r - s
950 67721928 : r = s4 - s8
951 67721928 : s = r2 - r6
952 67721928 : cp = r + s
953 67721928 : cm = r - s
954 67721928 : r = s2 - s6
955 67721928 : s = r4 - r8
956 67721928 : dpp = r + s
957 67721928 : dm = r - s
958 67721928 : r = (cp + dm)*rt2i
959 67721928 : s = (dm - cp)*rt2i
960 67721928 : cp = (cm + dpp)*rt2i
961 67721928 : dpp = (cm - dpp)*rt2i
962 67721928 : zout(1, j, nout2) = ap + r
963 67721928 : zout(2, j, nout2) = bm + s
964 67721928 : zout(1, j, nout6) = ap - r
965 67721928 : zout(2, j, nout6) = bm - s
966 67721928 : zout(1, j, nout4) = am + cp
967 67721928 : zout(2, j, nout4) = bp + dpp
968 67721928 : zout(1, j, nout8) = am - cp
969 72789267 : zout(2, j, nout8) = bp - dpp
970 : END DO; END DO
971 1037882 : 8000 CONTINUE
972 :
973 : ELSE
974 1111635 : ia = 1
975 1111635 : nin1 = ia - after
976 1111635 : nout1 = ia - atn
977 9558463 : DO ib = 1, before
978 8446828 : nin1 = nin1 + after
979 8446828 : nin2 = nin1 + atb
980 8446828 : nin3 = nin2 + atb
981 8446828 : nin4 = nin3 + atb
982 8446828 : nin5 = nin4 + atb
983 8446828 : nin6 = nin5 + atb
984 8446828 : nin7 = nin6 + atb
985 8446828 : nin8 = nin7 + atb
986 8446828 : nout1 = nout1 + atn
987 8446828 : nout2 = nout1 + after
988 8446828 : nout3 = nout2 + after
989 8446828 : nout4 = nout3 + after
990 8446828 : nout5 = nout4 + after
991 8446828 : nout6 = nout5 + after
992 8446828 : nout7 = nout6 + after
993 8446828 : nout8 = nout7 + after
994 170329134 : DO j = 1, nfft
995 160770671 : r1 = zin(1, j, nin1)
996 160770671 : s1 = zin(2, j, nin1)
997 160770671 : r2 = zin(1, j, nin2)
998 160770671 : s2 = zin(2, j, nin2)
999 160770671 : r3 = zin(1, j, nin3)
1000 160770671 : s3 = zin(2, j, nin3)
1001 160770671 : r4 = zin(1, j, nin4)
1002 160770671 : s4 = zin(2, j, nin4)
1003 160770671 : r5 = zin(1, j, nin5)
1004 160770671 : s5 = zin(2, j, nin5)
1005 160770671 : r6 = zin(1, j, nin6)
1006 160770671 : s6 = zin(2, j, nin6)
1007 160770671 : r7 = zin(1, j, nin7)
1008 160770671 : s7 = zin(2, j, nin7)
1009 160770671 : r8 = zin(1, j, nin8)
1010 160770671 : s8 = zin(2, j, nin8)
1011 160770671 : r = r1 + r5
1012 160770671 : s = r3 + r7
1013 160770671 : ap = r + s
1014 160770671 : am = r - s
1015 160770671 : r = r2 + r6
1016 160770671 : s = r4 + r8
1017 160770671 : bp = r + s
1018 160770671 : bm = r - s
1019 160770671 : r = s1 + s5
1020 160770671 : s = s3 + s7
1021 160770671 : cp = r + s
1022 160770671 : cm = r - s
1023 160770671 : r = s2 + s6
1024 160770671 : s = s4 + s8
1025 160770671 : dpp = r + s
1026 160770671 : dm = r - s
1027 160770671 : zout(1, j, nout1) = ap + bp
1028 160770671 : zout(2, j, nout1) = cp + dpp
1029 160770671 : zout(1, j, nout5) = ap - bp
1030 160770671 : zout(2, j, nout5) = cp - dpp
1031 160770671 : zout(1, j, nout3) = am - dm
1032 160770671 : zout(2, j, nout3) = cm + bm
1033 160770671 : zout(1, j, nout7) = am + dm
1034 160770671 : zout(2, j, nout7) = cm - bm
1035 160770671 : r = r1 - r5
1036 160770671 : s = -s3 + s7
1037 160770671 : ap = r + s
1038 160770671 : am = r - s
1039 160770671 : r = s1 - s5
1040 160770671 : s = r7 - r3
1041 160770671 : bp = r + s
1042 160770671 : bm = r - s
1043 160770671 : r = -s4 + s8
1044 160770671 : s = r2 - r6
1045 160770671 : cp = r + s
1046 160770671 : cm = r - s
1047 160770671 : r = -s2 + s6
1048 160770671 : s = r4 - r8
1049 160770671 : dpp = r + s
1050 160770671 : dm = r - s
1051 160770671 : r = (cp + dm)*rt2i
1052 160770671 : s = (cp - dm)*rt2i
1053 160770671 : cp = (cm + dpp)*rt2i
1054 160770671 : dpp = (dpp - cm)*rt2i
1055 160770671 : zout(1, j, nout2) = ap + r
1056 160770671 : zout(2, j, nout2) = bm + s
1057 160770671 : zout(1, j, nout6) = ap - r
1058 160770671 : zout(2, j, nout6) = bm - s
1059 160770671 : zout(1, j, nout4) = am + cp
1060 160770671 : zout(2, j, nout4) = bp + dpp
1061 160770671 : zout(1, j, nout8) = am - cp
1062 169217499 : zout(2, j, nout8) = bp - dpp
1063 : END DO; END DO
1064 :
1065 3116295 : DO 8001, ia = 2, after
1066 2004660 : ias = ia - 1
1067 2004660 : itt = ias*before
1068 2004660 : itrig = itt + 1
1069 2004660 : cr2 = trig(1, itrig)
1070 2004660 : ci2 = trig(2, itrig)
1071 2004660 : itrig = itrig + itt
1072 2004660 : cr3 = trig(1, itrig)
1073 2004660 : ci3 = trig(2, itrig)
1074 2004660 : itrig = itrig + itt
1075 2004660 : cr4 = trig(1, itrig)
1076 2004660 : ci4 = trig(2, itrig)
1077 2004660 : itrig = itrig + itt
1078 2004660 : cr5 = trig(1, itrig)
1079 2004660 : ci5 = trig(2, itrig)
1080 2004660 : itrig = itrig + itt
1081 2004660 : cr6 = trig(1, itrig)
1082 2004660 : ci6 = trig(2, itrig)
1083 2004660 : itrig = itrig + itt
1084 2004660 : cr7 = trig(1, itrig)
1085 2004660 : ci7 = trig(2, itrig)
1086 2004660 : itrig = itrig + itt
1087 2004660 : cr8 = trig(1, itrig)
1088 2004660 : ci8 = trig(2, itrig)
1089 2004660 : nin1 = ia - after
1090 2004660 : nout1 = ia - atn
1091 7485191 : DO ib = 1, before
1092 5480531 : nin1 = nin1 + after
1093 5480531 : nin2 = nin1 + atb
1094 5480531 : nin3 = nin2 + atb
1095 5480531 : nin4 = nin3 + atb
1096 5480531 : nin5 = nin4 + atb
1097 5480531 : nin6 = nin5 + atb
1098 5480531 : nin7 = nin6 + atb
1099 5480531 : nin8 = nin7 + atb
1100 5480531 : nout1 = nout1 + atn
1101 5480531 : nout2 = nout1 + after
1102 5480531 : nout3 = nout2 + after
1103 5480531 : nout4 = nout3 + after
1104 5480531 : nout5 = nout4 + after
1105 5480531 : nout6 = nout5 + after
1106 5480531 : nout7 = nout6 + after
1107 5480531 : nout8 = nout7 + after
1108 79787877 : DO j = 1, nfft
1109 72302686 : r1 = zin(1, j, nin1)
1110 72302686 : s1 = zin(2, j, nin1)
1111 72302686 : r = zin(1, j, nin2)
1112 72302686 : s = zin(2, j, nin2)
1113 72302686 : r2 = r*cr2 - s*ci2
1114 72302686 : s2 = r*ci2 + s*cr2
1115 72302686 : r = zin(1, j, nin3)
1116 72302686 : s = zin(2, j, nin3)
1117 72302686 : r3 = r*cr3 - s*ci3
1118 72302686 : s3 = r*ci3 + s*cr3
1119 72302686 : r = zin(1, j, nin4)
1120 72302686 : s = zin(2, j, nin4)
1121 72302686 : r4 = r*cr4 - s*ci4
1122 72302686 : s4 = r*ci4 + s*cr4
1123 72302686 : r = zin(1, j, nin5)
1124 72302686 : s = zin(2, j, nin5)
1125 72302686 : r5 = r*cr5 - s*ci5
1126 72302686 : s5 = r*ci5 + s*cr5
1127 72302686 : r = zin(1, j, nin6)
1128 72302686 : s = zin(2, j, nin6)
1129 72302686 : r6 = r*cr6 - s*ci6
1130 72302686 : s6 = r*ci6 + s*cr6
1131 72302686 : r = zin(1, j, nin7)
1132 72302686 : s = zin(2, j, nin7)
1133 72302686 : r7 = r*cr7 - s*ci7
1134 72302686 : s7 = r*ci7 + s*cr7
1135 72302686 : r = zin(1, j, nin8)
1136 72302686 : s = zin(2, j, nin8)
1137 72302686 : r8 = r*cr8 - s*ci8
1138 72302686 : s8 = r*ci8 + s*cr8
1139 72302686 : r = r1 + r5
1140 72302686 : s = r3 + r7
1141 72302686 : ap = r + s
1142 72302686 : am = r - s
1143 72302686 : r = r2 + r6
1144 72302686 : s = r4 + r8
1145 72302686 : bp = r + s
1146 72302686 : bm = r - s
1147 72302686 : r = s1 + s5
1148 72302686 : s = s3 + s7
1149 72302686 : cp = r + s
1150 72302686 : cm = r - s
1151 72302686 : r = s2 + s6
1152 72302686 : s = s4 + s8
1153 72302686 : dpp = r + s
1154 72302686 : dm = r - s
1155 72302686 : zout(1, j, nout1) = ap + bp
1156 72302686 : zout(2, j, nout1) = cp + dpp
1157 72302686 : zout(1, j, nout5) = ap - bp
1158 72302686 : zout(2, j, nout5) = cp - dpp
1159 72302686 : zout(1, j, nout3) = am - dm
1160 72302686 : zout(2, j, nout3) = cm + bm
1161 72302686 : zout(1, j, nout7) = am + dm
1162 72302686 : zout(2, j, nout7) = cm - bm
1163 72302686 : r = r1 - r5
1164 72302686 : s = -s3 + s7
1165 72302686 : ap = r + s
1166 72302686 : am = r - s
1167 72302686 : r = s1 - s5
1168 72302686 : s = r7 - r3
1169 72302686 : bp = r + s
1170 72302686 : bm = r - s
1171 72302686 : r = -s4 + s8
1172 72302686 : s = r2 - r6
1173 72302686 : cp = r + s
1174 72302686 : cm = r - s
1175 72302686 : r = -s2 + s6
1176 72302686 : s = r4 - r8
1177 72302686 : dpp = r + s
1178 72302686 : dm = r - s
1179 72302686 : r = (cp + dm)*rt2i
1180 72302686 : s = (cp - dm)*rt2i
1181 72302686 : cp = (cm + dpp)*rt2i
1182 72302686 : dpp = (dpp - cm)*rt2i
1183 72302686 : zout(1, j, nout2) = ap + r
1184 72302686 : zout(2, j, nout2) = bm + s
1185 72302686 : zout(1, j, nout6) = ap - r
1186 72302686 : zout(2, j, nout6) = bm - s
1187 72302686 : zout(1, j, nout4) = am + cp
1188 72302686 : zout(2, j, nout4) = bp + dpp
1189 72302686 : zout(1, j, nout8) = am - cp
1190 77783217 : zout(2, j, nout8) = bp - dpp
1191 : END DO; END DO
1192 1111635 : 8001 CONTINUE
1193 :
1194 : END IF
1195 : ELSE IF (now .EQ. 3) THEN
1196 : ! .5_dp*sqrt(3._dp)
1197 8840676 : bb = isign*0.8660254037844387_dp
1198 8840676 : ia = 1
1199 8840676 : nin1 = ia - after
1200 8840676 : nout1 = ia - atn
1201 32184910 : DO ib = 1, before
1202 23344234 : nin1 = nin1 + after
1203 23344234 : nin2 = nin1 + atb
1204 23344234 : nin3 = nin2 + atb
1205 23344234 : nout1 = nout1 + atn
1206 23344234 : nout2 = nout1 + after
1207 23344234 : nout3 = nout2 + after
1208 486805186 : DO j = 1, nfft
1209 454620276 : r1 = zin(1, j, nin1)
1210 454620276 : s1 = zin(2, j, nin1)
1211 454620276 : r2 = zin(1, j, nin2)
1212 454620276 : s2 = zin(2, j, nin2)
1213 454620276 : r3 = zin(1, j, nin3)
1214 454620276 : s3 = zin(2, j, nin3)
1215 454620276 : r = r2 + r3
1216 454620276 : s = s2 + s3
1217 454620276 : zout(1, j, nout1) = r + r1
1218 454620276 : zout(2, j, nout1) = s + s1
1219 454620276 : r1 = r1 - .5_dp*r
1220 454620276 : s1 = s1 - .5_dp*s
1221 454620276 : r2 = bb*(r2 - r3)
1222 454620276 : s2 = bb*(s2 - s3)
1223 454620276 : zout(1, j, nout2) = r1 - s2
1224 454620276 : zout(2, j, nout2) = s1 + r2
1225 454620276 : zout(1, j, nout3) = r1 + s2
1226 477964510 : zout(2, j, nout3) = s1 - r2
1227 : END DO; END DO
1228 161073778 : DO 3000, ia = 2, after
1229 152233102 : ias = ia - 1
1230 152233102 : IF (4*ias .EQ. 3*after) THEN
1231 5740655 : IF (isign .EQ. 1) THEN
1232 2947927 : nin1 = ia - after
1233 2947927 : nout1 = ia - atn
1234 12049224 : DO ib = 1, before
1235 9101297 : nin1 = nin1 + after
1236 9101297 : nin2 = nin1 + atb
1237 9101297 : nin3 = nin2 + atb
1238 9101297 : nout1 = nout1 + atn
1239 9101297 : nout2 = nout1 + after
1240 9101297 : nout3 = nout2 + after
1241 185997352 : DO j = 1, nfft
1242 173948128 : r1 = zin(1, j, nin1)
1243 173948128 : s1 = zin(2, j, nin1)
1244 173948128 : r2 = zin(2, j, nin2)
1245 173948128 : s2 = zin(1, j, nin2)
1246 173948128 : r3 = zin(1, j, nin3)
1247 173948128 : s3 = zin(2, j, nin3)
1248 173948128 : r = r3 + r2
1249 173948128 : s = s2 - s3
1250 173948128 : zout(1, j, nout1) = r1 - r
1251 173948128 : zout(2, j, nout1) = s + s1
1252 173948128 : r1 = r1 + .5_dp*r
1253 173948128 : s1 = s1 - .5_dp*s
1254 173948128 : r2 = bb*(r2 - r3)
1255 173948128 : s2 = bb*(s2 + s3)
1256 173948128 : zout(1, j, nout2) = r1 - s2
1257 173948128 : zout(2, j, nout2) = s1 - r2
1258 173948128 : zout(1, j, nout3) = r1 + s2
1259 183049425 : zout(2, j, nout3) = s1 + r2
1260 : END DO; END DO
1261 : ELSE
1262 2792728 : nin1 = ia - after
1263 2792728 : nout1 = ia - atn
1264 11406510 : DO ib = 1, before
1265 8613782 : nin1 = nin1 + after
1266 8613782 : nin2 = nin1 + atb
1267 8613782 : nin3 = nin2 + atb
1268 8613782 : nout1 = nout1 + atn
1269 8613782 : nout2 = nout1 + after
1270 8613782 : nout3 = nout2 + after
1271 176682786 : DO j = 1, nfft
1272 165276276 : r1 = zin(1, j, nin1)
1273 165276276 : s1 = zin(2, j, nin1)
1274 165276276 : r2 = zin(2, j, nin2)
1275 165276276 : s2 = zin(1, j, nin2)
1276 165276276 : r3 = zin(1, j, nin3)
1277 165276276 : s3 = zin(2, j, nin3)
1278 165276276 : r = r2 - r3
1279 165276276 : s = s2 + s3
1280 165276276 : zout(1, j, nout1) = r + r1
1281 165276276 : zout(2, j, nout1) = s1 - s
1282 165276276 : r1 = r1 - .5_dp*r
1283 165276276 : s1 = s1 + .5_dp*s
1284 165276276 : r2 = bb*(r2 + r3)
1285 165276276 : s2 = bb*(s2 - s3)
1286 165276276 : zout(1, j, nout2) = r1 + s2
1287 165276276 : zout(2, j, nout2) = s1 + r2
1288 165276276 : zout(1, j, nout3) = r1 - s2
1289 173890058 : zout(2, j, nout3) = s1 - r2
1290 : END DO; END DO
1291 : END IF
1292 146492447 : ELSE IF (8*ias .EQ. 3*after) THEN
1293 1910407 : IF (isign .EQ. 1) THEN
1294 982133 : nin1 = ia - after
1295 982133 : nout1 = ia - atn
1296 2375112 : DO ib = 1, before
1297 1392979 : nin1 = nin1 + after
1298 1392979 : nin2 = nin1 + atb
1299 1392979 : nin3 = nin2 + atb
1300 1392979 : nout1 = nout1 + atn
1301 1392979 : nout2 = nout1 + after
1302 1392979 : nout3 = nout2 + after
1303 29906542 : DO j = 1, nfft
1304 27531430 : r1 = zin(1, j, nin1)
1305 27531430 : s1 = zin(2, j, nin1)
1306 27531430 : r = zin(1, j, nin2)
1307 27531430 : s = zin(2, j, nin2)
1308 27531430 : r2 = (r - s)*rt2i
1309 27531430 : s2 = (r + s)*rt2i
1310 27531430 : r3 = zin(2, j, nin3)
1311 27531430 : s3 = zin(1, j, nin3)
1312 27531430 : r = r2 - r3
1313 27531430 : s = s2 + s3
1314 27531430 : zout(1, j, nout1) = r + r1
1315 27531430 : zout(2, j, nout1) = s + s1
1316 27531430 : r1 = r1 - .5_dp*r
1317 27531430 : s1 = s1 - .5_dp*s
1318 27531430 : r2 = bb*(r2 + r3)
1319 27531430 : s2 = bb*(s2 - s3)
1320 27531430 : zout(1, j, nout2) = r1 - s2
1321 27531430 : zout(2, j, nout2) = s1 + r2
1322 27531430 : zout(1, j, nout3) = r1 + s2
1323 28924409 : zout(2, j, nout3) = s1 - r2
1324 : END DO; END DO
1325 : ELSE
1326 928274 : nin1 = ia - after
1327 928274 : nout1 = ia - atn
1328 2239998 : DO ib = 1, before
1329 1311724 : nin1 = nin1 + after
1330 1311724 : nin2 = nin1 + atb
1331 1311724 : nin3 = nin2 + atb
1332 1311724 : nout1 = nout1 + atn
1333 1311724 : nout2 = nout1 + after
1334 1311724 : nout3 = nout2 + after
1335 28046334 : DO j = 1, nfft
1336 25806336 : r1 = zin(1, j, nin1)
1337 25806336 : s1 = zin(2, j, nin1)
1338 25806336 : r = zin(1, j, nin2)
1339 25806336 : s = zin(2, j, nin2)
1340 25806336 : r2 = (r + s)*rt2i
1341 25806336 : s2 = (s - r)*rt2i
1342 25806336 : r3 = zin(2, j, nin3)
1343 25806336 : s3 = zin(1, j, nin3)
1344 25806336 : r = r2 + r3
1345 25806336 : s = s2 - s3
1346 25806336 : zout(1, j, nout1) = r + r1
1347 25806336 : zout(2, j, nout1) = s + s1
1348 25806336 : r1 = r1 - .5_dp*r
1349 25806336 : s1 = s1 - .5_dp*s
1350 25806336 : r2 = bb*(r2 - r3)
1351 25806336 : s2 = bb*(s2 + s3)
1352 25806336 : zout(1, j, nout2) = r1 - s2
1353 25806336 : zout(2, j, nout2) = s1 + r2
1354 25806336 : zout(1, j, nout3) = r1 + s2
1355 27118060 : zout(2, j, nout3) = s1 - r2
1356 : END DO; END DO
1357 : END IF
1358 : ELSE
1359 144582040 : itt = ias*before
1360 144582040 : itrig = itt + 1
1361 144582040 : cr2 = trig(1, itrig)
1362 144582040 : ci2 = trig(2, itrig)
1363 144582040 : itrig = itrig + itt
1364 144582040 : cr3 = trig(1, itrig)
1365 144582040 : ci3 = trig(2, itrig)
1366 144582040 : nin1 = ia - after
1367 144582040 : nout1 = ia - atn
1368 347588130 : DO ib = 1, before
1369 203006090 : nin1 = nin1 + after
1370 203006090 : nin2 = nin1 + atb
1371 203006090 : nin3 = nin2 + atb
1372 203006090 : nout1 = nout1 + atn
1373 203006090 : nout2 = nout1 + after
1374 203006090 : nout3 = nout2 + after
1375 4051267928 : DO j = 1, nfft
1376 3703679798 : r1 = zin(1, j, nin1)
1377 3703679798 : s1 = zin(2, j, nin1)
1378 3703679798 : r = zin(1, j, nin2)
1379 3703679798 : s = zin(2, j, nin2)
1380 3703679798 : r2 = r*cr2 - s*ci2
1381 3703679798 : s2 = r*ci2 + s*cr2
1382 3703679798 : r = zin(1, j, nin3)
1383 3703679798 : s = zin(2, j, nin3)
1384 3703679798 : r3 = r*cr3 - s*ci3
1385 3703679798 : s3 = r*ci3 + s*cr3
1386 3703679798 : r = r2 + r3
1387 3703679798 : s = s2 + s3
1388 3703679798 : zout(1, j, nout1) = r + r1
1389 3703679798 : zout(2, j, nout1) = s + s1
1390 3703679798 : r1 = r1 - .5_dp*r
1391 3703679798 : s1 = s1 - .5_dp*s
1392 3703679798 : r2 = bb*(r2 - r3)
1393 3703679798 : s2 = bb*(s2 - s3)
1394 3703679798 : zout(1, j, nout2) = r1 - s2
1395 3703679798 : zout(2, j, nout2) = s1 + r2
1396 3703679798 : zout(1, j, nout3) = r1 + s2
1397 3906685888 : zout(2, j, nout3) = s1 - r2
1398 : END DO; END DO
1399 : END IF
1400 8840676 : 3000 CONTINUE
1401 : ELSE IF (now .EQ. 5) THEN
1402 : ! cos(2._dp*pi/5._dp)
1403 2964058 : cos2 = 0.3090169943749474_dp
1404 : ! cos(4._dp*pi/5._dp)
1405 2964058 : cos4 = -0.8090169943749474_dp
1406 : ! sin(2._dp*pi/5._dp)
1407 2964058 : sin2 = isign*0.9510565162951536_dp
1408 : ! sin(4._dp*pi/5._dp)
1409 2964058 : sin4 = isign*0.5877852522924731_dp
1410 2964058 : ia = 1
1411 2964058 : nin1 = ia - after
1412 2964058 : nout1 = ia - atn
1413 28792868 : DO ib = 1, before
1414 25828810 : nin1 = nin1 + after
1415 25828810 : nin2 = nin1 + atb
1416 25828810 : nin3 = nin2 + atb
1417 25828810 : nin4 = nin3 + atb
1418 25828810 : nin5 = nin4 + atb
1419 25828810 : nout1 = nout1 + atn
1420 25828810 : nout2 = nout1 + after
1421 25828810 : nout3 = nout2 + after
1422 25828810 : nout4 = nout3 + after
1423 25828810 : nout5 = nout4 + after
1424 548385109 : DO j = 1, nfft
1425 519592241 : r1 = zin(1, j, nin1)
1426 519592241 : s1 = zin(2, j, nin1)
1427 519592241 : r2 = zin(1, j, nin2)
1428 519592241 : s2 = zin(2, j, nin2)
1429 519592241 : r3 = zin(1, j, nin3)
1430 519592241 : s3 = zin(2, j, nin3)
1431 519592241 : r4 = zin(1, j, nin4)
1432 519592241 : s4 = zin(2, j, nin4)
1433 519592241 : r5 = zin(1, j, nin5)
1434 519592241 : s5 = zin(2, j, nin5)
1435 519592241 : r25 = r2 + r5
1436 519592241 : r34 = r3 + r4
1437 519592241 : s25 = s2 - s5
1438 519592241 : s34 = s3 - s4
1439 519592241 : zout(1, j, nout1) = r1 + r25 + r34
1440 519592241 : r = r1 + cos2*r25 + cos4*r34
1441 519592241 : s = sin2*s25 + sin4*s34
1442 519592241 : zout(1, j, nout2) = r - s
1443 519592241 : zout(1, j, nout5) = r + s
1444 519592241 : r = r1 + cos4*r25 + cos2*r34
1445 519592241 : s = sin4*s25 - sin2*s34
1446 519592241 : zout(1, j, nout3) = r - s
1447 519592241 : zout(1, j, nout4) = r + s
1448 519592241 : r25 = r2 - r5
1449 519592241 : r34 = r3 - r4
1450 519592241 : s25 = s2 + s5
1451 519592241 : s34 = s3 + s4
1452 519592241 : zout(2, j, nout1) = s1 + s25 + s34
1453 519592241 : r = s1 + cos2*s25 + cos4*s34
1454 519592241 : s = sin2*r25 + sin4*r34
1455 519592241 : zout(2, j, nout2) = r + s
1456 519592241 : zout(2, j, nout5) = r - s
1457 519592241 : r = s1 + cos4*s25 + cos2*s34
1458 519592241 : s = sin4*r25 - sin2*r34
1459 519592241 : zout(2, j, nout3) = r + s
1460 545421051 : zout(2, j, nout4) = r - s
1461 : END DO; END DO
1462 10808226 : DO 5000, ia = 2, after
1463 7844168 : ias = ia - 1
1464 7844168 : IF (8*ias .EQ. 5*after) THEN
1465 565384 : IF (isign .EQ. 1) THEN
1466 294306 : nin1 = ia - after
1467 294306 : nout1 = ia - atn
1468 888732 : DO ib = 1, before
1469 594426 : nin1 = nin1 + after
1470 594426 : nin2 = nin1 + atb
1471 594426 : nin3 = nin2 + atb
1472 594426 : nin4 = nin3 + atb
1473 594426 : nin5 = nin4 + atb
1474 594426 : nout1 = nout1 + atn
1475 594426 : nout2 = nout1 + after
1476 594426 : nout3 = nout2 + after
1477 594426 : nout4 = nout3 + after
1478 594426 : nout5 = nout4 + after
1479 13412919 : DO j = 1, nfft
1480 12524187 : r1 = zin(1, j, nin1)
1481 12524187 : s1 = zin(2, j, nin1)
1482 12524187 : r = zin(1, j, nin2)
1483 12524187 : s = zin(2, j, nin2)
1484 12524187 : r2 = (r - s)*rt2i
1485 12524187 : s2 = (r + s)*rt2i
1486 12524187 : r3 = zin(2, j, nin3)
1487 12524187 : s3 = zin(1, j, nin3)
1488 12524187 : r = zin(1, j, nin4)
1489 12524187 : s = zin(2, j, nin4)
1490 12524187 : r4 = (r + s)*rt2i
1491 12524187 : s4 = (r - s)*rt2i
1492 12524187 : r5 = zin(1, j, nin5)
1493 12524187 : s5 = zin(2, j, nin5)
1494 12524187 : r25 = r2 - r5
1495 12524187 : r34 = r3 + r4
1496 12524187 : s25 = s2 + s5
1497 12524187 : s34 = s3 - s4
1498 12524187 : zout(1, j, nout1) = r1 + r25 - r34
1499 12524187 : r = r1 + cos2*r25 - cos4*r34
1500 12524187 : s = sin2*s25 + sin4*s34
1501 12524187 : zout(1, j, nout2) = r - s
1502 12524187 : zout(1, j, nout5) = r + s
1503 12524187 : r = r1 + cos4*r25 - cos2*r34
1504 12524187 : s = sin4*s25 - sin2*s34
1505 12524187 : zout(1, j, nout3) = r - s
1506 12524187 : zout(1, j, nout4) = r + s
1507 12524187 : r25 = r2 + r5
1508 12524187 : r34 = r4 - r3
1509 12524187 : s25 = s2 - s5
1510 12524187 : s34 = s3 + s4
1511 12524187 : zout(2, j, nout1) = s1 + s25 + s34
1512 12524187 : r = s1 + cos2*s25 + cos4*s34
1513 12524187 : s = sin2*r25 + sin4*r34
1514 12524187 : zout(2, j, nout2) = r + s
1515 12524187 : zout(2, j, nout5) = r - s
1516 12524187 : r = s1 + cos4*s25 + cos2*s34
1517 12524187 : s = sin4*r25 - sin2*r34
1518 12524187 : zout(2, j, nout3) = r + s
1519 13118613 : zout(2, j, nout4) = r - s
1520 : END DO; END DO
1521 : ELSE
1522 271078 : nin1 = ia - after
1523 271078 : nout1 = ia - atn
1524 829100 : DO ib = 1, before
1525 558022 : nin1 = nin1 + after
1526 558022 : nin2 = nin1 + atb
1527 558022 : nin3 = nin2 + atb
1528 558022 : nin4 = nin3 + atb
1529 558022 : nin5 = nin4 + atb
1530 558022 : nout1 = nout1 + atn
1531 558022 : nout2 = nout1 + after
1532 558022 : nout3 = nout2 + after
1533 558022 : nout4 = nout3 + after
1534 558022 : nout5 = nout4 + after
1535 12389580 : DO j = 1, nfft
1536 11560480 : r1 = zin(1, j, nin1)
1537 11560480 : s1 = zin(2, j, nin1)
1538 11560480 : r = zin(1, j, nin2)
1539 11560480 : s = zin(2, j, nin2)
1540 11560480 : r2 = (r + s)*rt2i
1541 11560480 : s2 = (s - r)*rt2i
1542 11560480 : r3 = zin(2, j, nin3)
1543 11560480 : s3 = zin(1, j, nin3)
1544 11560480 : r = zin(1, j, nin4)
1545 11560480 : s = zin(2, j, nin4)
1546 11560480 : r4 = (s - r)*rt2i
1547 11560480 : s4 = (r + s)*rt2i
1548 11560480 : r5 = zin(1, j, nin5)
1549 11560480 : s5 = zin(2, j, nin5)
1550 11560480 : r25 = r2 - r5
1551 11560480 : r34 = r3 + r4
1552 11560480 : s25 = s2 + s5
1553 11560480 : s34 = s4 - s3
1554 11560480 : zout(1, j, nout1) = r1 + r25 + r34
1555 11560480 : r = r1 + cos2*r25 + cos4*r34
1556 11560480 : s = sin2*s25 + sin4*s34
1557 11560480 : zout(1, j, nout2) = r - s
1558 11560480 : zout(1, j, nout5) = r + s
1559 11560480 : r = r1 + cos4*r25 + cos2*r34
1560 11560480 : s = sin4*s25 - sin2*s34
1561 11560480 : zout(1, j, nout3) = r - s
1562 11560480 : zout(1, j, nout4) = r + s
1563 11560480 : r25 = r2 + r5
1564 11560480 : r34 = r3 - r4
1565 11560480 : s25 = s2 - s5
1566 11560480 : s34 = s3 + s4
1567 11560480 : zout(2, j, nout1) = s1 + s25 - s34
1568 11560480 : r = s1 + cos2*s25 - cos4*s34
1569 11560480 : s = sin2*r25 + sin4*r34
1570 11560480 : zout(2, j, nout2) = r + s
1571 11560480 : zout(2, j, nout5) = r - s
1572 11560480 : r = s1 + cos4*s25 - cos2*s34
1573 11560480 : s = sin4*r25 - sin2*r34
1574 11560480 : zout(2, j, nout3) = r + s
1575 12118502 : zout(2, j, nout4) = r - s
1576 : END DO; END DO
1577 : END IF
1578 : ELSE
1579 7278784 : ias = ia - 1
1580 7278784 : itt = ias*before
1581 7278784 : itrig = itt + 1
1582 7278784 : cr2 = trig(1, itrig)
1583 7278784 : ci2 = trig(2, itrig)
1584 7278784 : itrig = itrig + itt
1585 7278784 : cr3 = trig(1, itrig)
1586 7278784 : ci3 = trig(2, itrig)
1587 7278784 : itrig = itrig + itt
1588 7278784 : cr4 = trig(1, itrig)
1589 7278784 : ci4 = trig(2, itrig)
1590 7278784 : itrig = itrig + itt
1591 7278784 : cr5 = trig(1, itrig)
1592 7278784 : ci5 = trig(2, itrig)
1593 7278784 : nin1 = ia - after
1594 7278784 : nout1 = ia - atn
1595 23877232 : DO ib = 1, before
1596 16598448 : nin1 = nin1 + after
1597 16598448 : nin2 = nin1 + atb
1598 16598448 : nin3 = nin2 + atb
1599 16598448 : nin4 = nin3 + atb
1600 16598448 : nin5 = nin4 + atb
1601 16598448 : nout1 = nout1 + atn
1602 16598448 : nout2 = nout1 + after
1603 16598448 : nout3 = nout2 + after
1604 16598448 : nout4 = nout3 + after
1605 16598448 : nout5 = nout4 + after
1606 341649034 : DO j = 1, nfft
1607 317771802 : r1 = zin(1, j, nin1)
1608 317771802 : s1 = zin(2, j, nin1)
1609 317771802 : r = zin(1, j, nin2)
1610 317771802 : s = zin(2, j, nin2)
1611 317771802 : r2 = r*cr2 - s*ci2
1612 317771802 : s2 = r*ci2 + s*cr2
1613 317771802 : r = zin(1, j, nin3)
1614 317771802 : s = zin(2, j, nin3)
1615 317771802 : r3 = r*cr3 - s*ci3
1616 317771802 : s3 = r*ci3 + s*cr3
1617 317771802 : r = zin(1, j, nin4)
1618 317771802 : s = zin(2, j, nin4)
1619 317771802 : r4 = r*cr4 - s*ci4
1620 317771802 : s4 = r*ci4 + s*cr4
1621 317771802 : r = zin(1, j, nin5)
1622 317771802 : s = zin(2, j, nin5)
1623 317771802 : r5 = r*cr5 - s*ci5
1624 317771802 : s5 = r*ci5 + s*cr5
1625 317771802 : r25 = r2 + r5
1626 317771802 : r34 = r3 + r4
1627 317771802 : s25 = s2 - s5
1628 317771802 : s34 = s3 - s4
1629 317771802 : zout(1, j, nout1) = r1 + r25 + r34
1630 317771802 : r = r1 + cos2*r25 + cos4*r34
1631 317771802 : s = sin2*s25 + sin4*s34
1632 317771802 : zout(1, j, nout2) = r - s
1633 317771802 : zout(1, j, nout5) = r + s
1634 317771802 : r = r1 + cos4*r25 + cos2*r34
1635 317771802 : s = sin4*s25 - sin2*s34
1636 317771802 : zout(1, j, nout3) = r - s
1637 317771802 : zout(1, j, nout4) = r + s
1638 317771802 : r25 = r2 - r5
1639 317771802 : r34 = r3 - r4
1640 317771802 : s25 = s2 + s5
1641 317771802 : s34 = s3 + s4
1642 317771802 : zout(2, j, nout1) = s1 + s25 + s34
1643 317771802 : r = s1 + cos2*s25 + cos4*s34
1644 317771802 : s = sin2*r25 + sin4*r34
1645 317771802 : zout(2, j, nout2) = r + s
1646 317771802 : zout(2, j, nout5) = r - s
1647 317771802 : r = s1 + cos4*s25 + cos2*s34
1648 317771802 : s = sin4*r25 - sin2*r34
1649 317771802 : zout(2, j, nout3) = r + s
1650 334370250 : zout(2, j, nout4) = r - s
1651 : END DO; END DO
1652 : END IF
1653 2964058 : 5000 CONTINUE
1654 : ELSE IF (now .EQ. 6) THEN
1655 : ! .5_dp*sqrt(3._dp)
1656 2709167 : bb = isign*0.8660254037844387_dp
1657 :
1658 2709167 : ia = 1
1659 2709167 : nin1 = ia - after
1660 2709167 : nout1 = ia - atn
1661 35774510 : DO ib = 1, before
1662 33065343 : nin1 = nin1 + after
1663 33065343 : nin2 = nin1 + atb
1664 33065343 : nin3 = nin2 + atb
1665 33065343 : nin4 = nin3 + atb
1666 33065343 : nin5 = nin4 + atb
1667 33065343 : nin6 = nin5 + atb
1668 33065343 : nout1 = nout1 + atn
1669 33065343 : nout2 = nout1 + after
1670 33065343 : nout3 = nout2 + after
1671 33065343 : nout4 = nout3 + after
1672 33065343 : nout5 = nout4 + after
1673 33065343 : nout6 = nout5 + after
1674 595327526 : DO j = 1, nfft
1675 559553016 : r2 = zin(1, j, nin3)
1676 559553016 : s2 = zin(2, j, nin3)
1677 559553016 : r3 = zin(1, j, nin5)
1678 559553016 : s3 = zin(2, j, nin5)
1679 559553016 : r = r2 + r3
1680 559553016 : s = s2 + s3
1681 559553016 : r1 = zin(1, j, nin1)
1682 559553016 : s1 = zin(2, j, nin1)
1683 559553016 : ur1 = r + r1
1684 559553016 : ui1 = s + s1
1685 559553016 : r1 = r1 - .5_dp*r
1686 559553016 : s1 = s1 - .5_dp*s
1687 559553016 : r = r2 - r3
1688 559553016 : s = s2 - s3
1689 559553016 : ur2 = r1 - s*bb
1690 559553016 : ui2 = s1 + r*bb
1691 559553016 : ur3 = r1 + s*bb
1692 559553016 : ui3 = s1 - r*bb
1693 :
1694 559553016 : r2 = zin(1, j, nin6)
1695 559553016 : s2 = zin(2, j, nin6)
1696 559553016 : r3 = zin(1, j, nin2)
1697 559553016 : s3 = zin(2, j, nin2)
1698 559553016 : r = r2 + r3
1699 559553016 : s = s2 + s3
1700 559553016 : r1 = zin(1, j, nin4)
1701 559553016 : s1 = zin(2, j, nin4)
1702 559553016 : vr1 = r + r1
1703 559553016 : vi1 = s + s1
1704 559553016 : r1 = r1 - .5_dp*r
1705 559553016 : s1 = s1 - .5_dp*s
1706 559553016 : r = r2 - r3
1707 559553016 : s = s2 - s3
1708 559553016 : vr2 = r1 - s*bb
1709 559553016 : vi2 = s1 + r*bb
1710 559553016 : vr3 = r1 + s*bb
1711 559553016 : vi3 = s1 - r*bb
1712 :
1713 559553016 : zout(1, j, nout1) = ur1 + vr1
1714 559553016 : zout(2, j, nout1) = ui1 + vi1
1715 559553016 : zout(1, j, nout5) = ur2 + vr2
1716 559553016 : zout(2, j, nout5) = ui2 + vi2
1717 559553016 : zout(1, j, nout3) = ur3 + vr3
1718 559553016 : zout(2, j, nout3) = ui3 + vi3
1719 559553016 : zout(1, j, nout4) = ur1 - vr1
1720 559553016 : zout(2, j, nout4) = ui1 - vi1
1721 559553016 : zout(1, j, nout2) = ur2 - vr2
1722 559553016 : zout(2, j, nout2) = ui2 - vi2
1723 559553016 : zout(1, j, nout6) = ur3 - vr3
1724 592618359 : zout(2, j, nout6) = ui3 - vi3
1725 : END DO; END DO
1726 : ELSE
1727 0 : CPABORT("error fftstp")
1728 : END IF
1729 :
1730 21309483 : END SUBROUTINE fftstp
1731 :
1732 : END MODULE ps_wavelet_fft3d
|