Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2026 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 112805 : 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, 25&
39 : , 27, 30, 32, 36, 40, 45, 48, 54, 60, 64, 72, 75, 80, 81, 90, 96, 100, 108, 120, 125, 128,&
40 : 135, 144, 150, 160, 162, 180, 192, 200, 216, 225, 240, 243, 256, 270, 288, 300, 320, 324, &
41 : 360, 375, 384, 400, 405, 432, 450, 480, 486, 500, 512, 540, 576, 600, 625, 640, 648, 675, &
42 : 720, 729, 750, 768, 800, 810, 864, 900, 960, 972, 1000, 1024, 1080, 1125, 1152, 1200, 1215&
43 : , 1280, 1296, 1350, 1440, 1458, 1500, 1536, 1600, 1620, 1728, 1800, 1875, 1920, 1944, 2000&
44 : , 2025, 2048, 2160, 2250, 2304, 2400, 2430, 2500, 2560, 2592, 2700, 2880, 3000, 3072, 3125&
45 : , 3200, 3240, 3375, 3456, 3600, 3750, 3840, 3888, 4000, 4050, 4096, 4320, 4500, 4608, 4800&
46 : , 5000, 5120, 5184, 5400, 5625, 5760, 6000, 6144, 6400, 6480, 6750, 6912, 7200, 7500, 7680&
47 : , 8000, ctrig_length]
48 :
49 : INTEGER :: i
50 :
51 : !Multiple of 2,3,5
52 :
53 1813914 : loop_data: DO i = 1, ndata1024
54 1813914 : IF (n <= idata(i)) THEN
55 112805 : n_next = idata(i)
56 112805 : 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 99713 : 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 1615972 : DO i = 1, 150
202 1615972 : 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 1615972 : IF (n == idata(1, i)) THEN
209 99713 : ic = 0
210 339983 : DO j = 1, 6
211 339983 : itt = idata(1 + j, i)
212 339983 : IF (itt > 1) THEN
213 240270 : ic = ic + 1
214 240270 : 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 99713 : after(1) = 1
224 99713 : before(ic) = 1
225 240270 : DO i = 2, ic
226 140557 : after(i) = after(i - 1)*now(i - 1)
227 240270 : before(ic - i + 1) = before(ic - i + 2)*now(ic - i + 2)
228 : END DO
229 :
230 99713 : twopi = 6.283185307179586_dp
231 99713 : angle = isign*twopi/n
232 99713 : IF (MOD(n, 2) == 0) THEN
233 88004 : nh = n/2
234 88004 : trig(1, 1) = 1._dp
235 88004 : trig(2, 1) = 0._dp
236 88004 : trig(1, nh + 1) = -1._dp
237 88004 : trig(2, nh + 1) = 0._dp
238 1913170 : DO 40, i = 1, nh - 1
239 1825166 : trigc = COS(i*angle)
240 1825166 : trigs = SIN(i*angle)
241 1825166 : trig(1, i + 1) = trigc
242 1825166 : trig(2, i + 1) = trigs
243 1825166 : trig(1, n - i + 1) = trigc
244 1825166 : trig(2, n - i + 1) = -trigs
245 88004 : 40 CONTINUE
246 : ELSE
247 11709 : nh = (n - 1)/2
248 11709 : trig(1, 1) = 1._dp
249 11709 : trig(2, 1) = 0._dp
250 117090 : DO 20, i = 1, nh
251 105381 : trigc = COS(i*angle)
252 105381 : trigs = SIN(i*angle)
253 105381 : trig(1, i + 1) = trigc
254 105381 : trig(2, i + 1) = trigs
255 105381 : trig(1, n - i + 1) = trigc
256 105381 : trig(2, n - i + 1) = -trigs
257 11709 : 20 CONTINUE
258 : END IF
259 :
260 99713 : 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 23355934 : 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 23355934 : atn = after*now
300 23355934 : atb = after*before
301 :
302 : ! sqrt(.5_dp)
303 23355934 : rt2i = 0.7071067811865475_dp
304 : IF (now == 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 == after) THEN
326 0 : IF (isign == 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 == after) THEN
364 0 : IF (isign == 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 == 3*after) THEN
406 0 : IF (isign == 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 == 4) THEN
473 5618969 : IF (isign == 1) THEN
474 2878588 : ia = 1
475 2878588 : nin1 = ia - after
476 2878588 : nout1 = ia - atn
477 25426577 : DO ib = 1, before
478 22547989 : nin1 = nin1 + after
479 22547989 : nin2 = nin1 + atb
480 22547989 : nin3 = nin2 + atb
481 22547989 : nin4 = nin3 + atb
482 22547989 : nout1 = nout1 + atn
483 22547989 : nout2 = nout1 + after
484 22547989 : nout3 = nout2 + after
485 22547989 : nout4 = nout3 + after
486 461382774 : DO j = 1, nfft
487 435956197 : r1 = zin(1, j, nin1)
488 435956197 : s1 = zin(2, j, nin1)
489 435956197 : r2 = zin(1, j, nin2)
490 435956197 : s2 = zin(2, j, nin2)
491 435956197 : r3 = zin(1, j, nin3)
492 435956197 : s3 = zin(2, j, nin3)
493 435956197 : r4 = zin(1, j, nin4)
494 435956197 : s4 = zin(2, j, nin4)
495 435956197 : r = r1 + r3
496 435956197 : s = r2 + r4
497 435956197 : zout(1, j, nout1) = r + s
498 435956197 : zout(1, j, nout3) = r - s
499 435956197 : r = r1 - r3
500 435956197 : s = s2 - s4
501 435956197 : zout(1, j, nout2) = r - s
502 435956197 : zout(1, j, nout4) = r + s
503 435956197 : r = s1 + s3
504 435956197 : s = s2 + s4
505 435956197 : zout(2, j, nout1) = r + s
506 435956197 : zout(2, j, nout3) = r - s
507 435956197 : r = s1 - s3
508 435956197 : s = r2 - r4
509 435956197 : zout(2, j, nout2) = r + s
510 458504186 : zout(2, j, nout4) = r - s
511 : END DO; END DO
512 30255821 : DO 4000, ia = 2, after
513 27377233 : ias = ia - 1
514 27377233 : IF (2*ias == after) THEN
515 1205047 : nin1 = ia - after
516 1205047 : nout1 = ia - atn
517 2794937 : DO ib = 1, before
518 1589890 : nin1 = nin1 + after
519 1589890 : nin2 = nin1 + atb
520 1589890 : nin3 = nin2 + atb
521 1589890 : nin4 = nin3 + atb
522 1589890 : nout1 = nout1 + atn
523 1589890 : nout2 = nout1 + after
524 1589890 : nout3 = nout2 + after
525 1589890 : nout4 = nout3 + after
526 33173244 : DO j = 1, nfft
527 30378307 : r1 = zin(1, j, nin1)
528 30378307 : s1 = zin(2, j, nin1)
529 30378307 : r = zin(1, j, nin2)
530 30378307 : s = zin(2, j, nin2)
531 30378307 : r2 = (r - s)*rt2i
532 30378307 : s2 = (r + s)*rt2i
533 30378307 : r3 = zin(2, j, nin3)
534 30378307 : s3 = zin(1, j, nin3)
535 30378307 : r = zin(1, j, nin4)
536 30378307 : s = zin(2, j, nin4)
537 30378307 : r4 = (r + s)*rt2i
538 30378307 : s4 = (r - s)*rt2i
539 30378307 : r = r1 - r3
540 30378307 : s = r2 - r4
541 30378307 : zout(1, j, nout1) = r + s
542 30378307 : zout(1, j, nout3) = r - s
543 30378307 : r = r1 + r3
544 30378307 : s = s2 - s4
545 30378307 : zout(1, j, nout2) = r - s
546 30378307 : zout(1, j, nout4) = r + s
547 30378307 : r = s1 + s3
548 30378307 : s = s2 + s4
549 30378307 : zout(2, j, nout1) = r + s
550 30378307 : zout(2, j, nout3) = r - s
551 30378307 : r = s1 - s3
552 30378307 : s = r2 + r4
553 30378307 : zout(2, j, nout2) = r + s
554 31968197 : zout(2, j, nout4) = r - s
555 : END DO; END DO
556 : ELSE
557 26172186 : itt = ias*before
558 26172186 : itrig = itt + 1
559 26172186 : cr2 = trig(1, itrig)
560 26172186 : ci2 = trig(2, itrig)
561 26172186 : itrig = itrig + itt
562 26172186 : cr3 = trig(1, itrig)
563 26172186 : ci3 = trig(2, itrig)
564 26172186 : itrig = itrig + itt
565 26172186 : cr4 = trig(1, itrig)
566 26172186 : ci4 = trig(2, itrig)
567 26172186 : nin1 = ia - after
568 26172186 : nout1 = ia - atn
569 64571478 : DO ib = 1, before
570 38399292 : nin1 = nin1 + after
571 38399292 : nin2 = nin1 + atb
572 38399292 : nin3 = nin2 + atb
573 38399292 : nin4 = nin3 + atb
574 38399292 : nout1 = nout1 + atn
575 38399292 : nout2 = nout1 + after
576 38399292 : nout3 = nout2 + after
577 38399292 : nout4 = nout3 + after
578 776718208 : DO j = 1, nfft
579 712146730 : r1 = zin(1, j, nin1)
580 712146730 : s1 = zin(2, j, nin1)
581 712146730 : r = zin(1, j, nin2)
582 712146730 : s = zin(2, j, nin2)
583 712146730 : r2 = r*cr2 - s*ci2
584 712146730 : s2 = r*ci2 + s*cr2
585 712146730 : r = zin(1, j, nin3)
586 712146730 : s = zin(2, j, nin3)
587 712146730 : r3 = r*cr3 - s*ci3
588 712146730 : s3 = r*ci3 + s*cr3
589 712146730 : r = zin(1, j, nin4)
590 712146730 : s = zin(2, j, nin4)
591 712146730 : r4 = r*cr4 - s*ci4
592 712146730 : s4 = r*ci4 + s*cr4
593 712146730 : r = r1 + r3
594 712146730 : s = r2 + r4
595 712146730 : zout(1, j, nout1) = r + s
596 712146730 : zout(1, j, nout3) = r - s
597 712146730 : r = r1 - r3
598 712146730 : s = s2 - s4
599 712146730 : zout(1, j, nout2) = r - s
600 712146730 : zout(1, j, nout4) = r + s
601 712146730 : r = s1 + s3
602 712146730 : s = s2 + s4
603 712146730 : zout(2, j, nout1) = r + s
604 712146730 : zout(2, j, nout3) = r - s
605 712146730 : r = s1 - s3
606 712146730 : s = r2 - r4
607 712146730 : zout(2, j, nout2) = r + s
608 750546022 : zout(2, j, nout4) = r - s
609 : END DO; END DO
610 : END IF
611 2878588 : 4000 CONTINUE
612 : ELSE
613 2740381 : ia = 1
614 2740381 : nin1 = ia - after
615 2740381 : nout1 = ia - atn
616 24127741 : DO ib = 1, before
617 21387360 : nin1 = nin1 + after
618 21387360 : nin2 = nin1 + atb
619 21387360 : nin3 = nin2 + atb
620 21387360 : nin4 = nin3 + atb
621 21387360 : nout1 = nout1 + atn
622 21387360 : nout2 = nout1 + after
623 21387360 : nout3 = nout2 + after
624 21387360 : nout4 = nout3 + after
625 438885033 : DO j = 1, nfft
626 414757292 : r1 = zin(1, j, nin1)
627 414757292 : s1 = zin(2, j, nin1)
628 414757292 : r2 = zin(1, j, nin2)
629 414757292 : s2 = zin(2, j, nin2)
630 414757292 : r3 = zin(1, j, nin3)
631 414757292 : s3 = zin(2, j, nin3)
632 414757292 : r4 = zin(1, j, nin4)
633 414757292 : s4 = zin(2, j, nin4)
634 414757292 : r = r1 + r3
635 414757292 : s = r2 + r4
636 414757292 : zout(1, j, nout1) = r + s
637 414757292 : zout(1, j, nout3) = r - s
638 414757292 : r = r1 - r3
639 414757292 : s = s2 - s4
640 414757292 : zout(1, j, nout2) = r + s
641 414757292 : zout(1, j, nout4) = r - s
642 414757292 : r = s1 + s3
643 414757292 : s = s2 + s4
644 414757292 : zout(2, j, nout1) = r + s
645 414757292 : zout(2, j, nout3) = r - s
646 414757292 : r = s1 - s3
647 414757292 : s = r2 - r4
648 414757292 : zout(2, j, nout2) = r - s
649 436144652 : zout(2, j, nout4) = r + s
650 : END DO; END DO
651 28519318 : DO 4100, ia = 2, after
652 25778937 : ias = ia - 1
653 25778937 : IF (2*ias == after) THEN
654 1141203 : nin1 = ia - after
655 1141203 : nout1 = ia - atn
656 2629116 : DO ib = 1, before
657 1487913 : nin1 = nin1 + after
658 1487913 : nin2 = nin1 + atb
659 1487913 : nin3 = nin2 + atb
660 1487913 : nin4 = nin3 + atb
661 1487913 : nout1 = nout1 + atn
662 1487913 : nout2 = nout1 + after
663 1487913 : nout3 = nout2 + after
664 1487913 : nout4 = nout3 + after
665 31089098 : DO j = 1, nfft
666 28459982 : r1 = zin(1, j, nin1)
667 28459982 : s1 = zin(2, j, nin1)
668 28459982 : r = zin(1, j, nin2)
669 28459982 : s = zin(2, j, nin2)
670 28459982 : r2 = (r + s)*rt2i
671 28459982 : s2 = (s - r)*rt2i
672 28459982 : r3 = zin(2, j, nin3)
673 28459982 : s3 = zin(1, j, nin3)
674 28459982 : r = zin(1, j, nin4)
675 28459982 : s = zin(2, j, nin4)
676 28459982 : r4 = (s - r)*rt2i
677 28459982 : s4 = (r + s)*rt2i
678 28459982 : r = r1 + r3
679 28459982 : s = r2 + r4
680 28459982 : zout(1, j, nout1) = r + s
681 28459982 : zout(1, j, nout3) = r - s
682 28459982 : r = r1 - r3
683 28459982 : s = s2 + s4
684 28459982 : zout(1, j, nout2) = r + s
685 28459982 : zout(1, j, nout4) = r - s
686 28459982 : r = s1 - s3
687 28459982 : s = s2 - s4
688 28459982 : zout(2, j, nout1) = r + s
689 28459982 : zout(2, j, nout3) = r - s
690 28459982 : r = s1 + s3
691 28459982 : s = r2 - r4
692 28459982 : zout(2, j, nout2) = r - s
693 29947895 : zout(2, j, nout4) = r + s
694 : END DO; END DO
695 : ELSE
696 24637734 : itt = ias*before
697 24637734 : itrig = itt + 1
698 24637734 : cr2 = trig(1, itrig)
699 24637734 : ci2 = trig(2, itrig)
700 24637734 : itrig = itrig + itt
701 24637734 : cr3 = trig(1, itrig)
702 24637734 : ci3 = trig(2, itrig)
703 24637734 : itrig = itrig + itt
704 24637734 : cr4 = trig(1, itrig)
705 24637734 : ci4 = trig(2, itrig)
706 24637734 : nin1 = ia - after
707 24637734 : nout1 = ia - atn
708 60913440 : DO ib = 1, before
709 36275706 : nin1 = nin1 + after
710 36275706 : nin2 = nin1 + atb
711 36275706 : nin3 = nin2 + atb
712 36275706 : nin4 = nin3 + atb
713 36275706 : nout1 = nout1 + atn
714 36275706 : nout2 = nout1 + after
715 36275706 : nout3 = nout2 + after
716 36275706 : nout4 = nout3 + after
717 737646012 : DO j = 1, nfft
718 676732572 : r1 = zin(1, j, nin1)
719 676732572 : s1 = zin(2, j, nin1)
720 676732572 : r = zin(1, j, nin2)
721 676732572 : s = zin(2, j, nin2)
722 676732572 : r2 = r*cr2 - s*ci2
723 676732572 : s2 = r*ci2 + s*cr2
724 676732572 : r = zin(1, j, nin3)
725 676732572 : s = zin(2, j, nin3)
726 676732572 : r3 = r*cr3 - s*ci3
727 676732572 : s3 = r*ci3 + s*cr3
728 676732572 : r = zin(1, j, nin4)
729 676732572 : s = zin(2, j, nin4)
730 676732572 : r4 = r*cr4 - s*ci4
731 676732572 : s4 = r*ci4 + s*cr4
732 676732572 : r = r1 + r3
733 676732572 : s = r2 + r4
734 676732572 : zout(1, j, nout1) = r + s
735 676732572 : zout(1, j, nout3) = r - s
736 676732572 : r = r1 - r3
737 676732572 : s = s2 - s4
738 676732572 : zout(1, j, nout2) = r + s
739 676732572 : zout(1, j, nout4) = r - s
740 676732572 : r = s1 + s3
741 676732572 : s = s2 + s4
742 676732572 : zout(2, j, nout1) = r + s
743 676732572 : zout(2, j, nout3) = r - s
744 676732572 : r = s1 - s3
745 676732572 : s = r2 - r4
746 676732572 : zout(2, j, nout2) = r - s
747 713008278 : zout(2, j, nout4) = r + s
748 : END DO; END DO
749 : END IF
750 2740381 : 4100 CONTINUE
751 : END IF
752 : ELSE IF (now == 8) THEN
753 2328736 : IF (isign == -1) THEN
754 1122648 : ia = 1
755 1122648 : nin1 = ia - after
756 1122648 : nout1 = ia - atn
757 9798324 : DO ib = 1, before
758 8675676 : nin1 = nin1 + after
759 8675676 : nin2 = nin1 + atb
760 8675676 : nin3 = nin2 + atb
761 8675676 : nin4 = nin3 + atb
762 8675676 : nin5 = nin4 + atb
763 8675676 : nin6 = nin5 + atb
764 8675676 : nin7 = nin6 + atb
765 8675676 : nin8 = nin7 + atb
766 8675676 : nout1 = nout1 + atn
767 8675676 : nout2 = nout1 + after
768 8675676 : nout3 = nout2 + after
769 8675676 : nout4 = nout3 + after
770 8675676 : nout5 = nout4 + after
771 8675676 : nout6 = nout5 + after
772 8675676 : nout7 = nout6 + after
773 8675676 : nout8 = nout7 + after
774 177120248 : DO j = 1, nfft
775 167321924 : r1 = zin(1, j, nin1)
776 167321924 : s1 = zin(2, j, nin1)
777 167321924 : r2 = zin(1, j, nin2)
778 167321924 : s2 = zin(2, j, nin2)
779 167321924 : r3 = zin(1, j, nin3)
780 167321924 : s3 = zin(2, j, nin3)
781 167321924 : r4 = zin(1, j, nin4)
782 167321924 : s4 = zin(2, j, nin4)
783 167321924 : r5 = zin(1, j, nin5)
784 167321924 : s5 = zin(2, j, nin5)
785 167321924 : r6 = zin(1, j, nin6)
786 167321924 : s6 = zin(2, j, nin6)
787 167321924 : r7 = zin(1, j, nin7)
788 167321924 : s7 = zin(2, j, nin7)
789 167321924 : r8 = zin(1, j, nin8)
790 167321924 : s8 = zin(2, j, nin8)
791 167321924 : r = r1 + r5
792 167321924 : s = r3 + r7
793 167321924 : ap = r + s
794 167321924 : am = r - s
795 167321924 : r = r2 + r6
796 167321924 : s = r4 + r8
797 167321924 : bp = r + s
798 167321924 : bm = r - s
799 167321924 : r = s1 + s5
800 167321924 : s = s3 + s7
801 167321924 : cp = r + s
802 167321924 : cm = r - s
803 167321924 : r = s2 + s6
804 167321924 : s = s4 + s8
805 167321924 : dpp = r + s
806 167321924 : dm = r - s
807 167321924 : zout(1, j, nout1) = ap + bp
808 167321924 : zout(2, j, nout1) = cp + dpp
809 167321924 : zout(1, j, nout5) = ap - bp
810 167321924 : zout(2, j, nout5) = cp - dpp
811 167321924 : zout(1, j, nout3) = am + dm
812 167321924 : zout(2, j, nout3) = cm - bm
813 167321924 : zout(1, j, nout7) = am - dm
814 167321924 : zout(2, j, nout7) = cm + bm
815 167321924 : r = r1 - r5
816 167321924 : s = s3 - s7
817 167321924 : ap = r + s
818 167321924 : am = r - s
819 167321924 : r = s1 - s5
820 167321924 : s = r3 - r7
821 167321924 : bp = r + s
822 167321924 : bm = r - s
823 167321924 : r = s4 - s8
824 167321924 : s = r2 - r6
825 167321924 : cp = r + s
826 167321924 : cm = r - s
827 167321924 : r = s2 - s6
828 167321924 : s = r4 - r8
829 167321924 : dpp = r + s
830 167321924 : dm = r - s
831 167321924 : r = (cp + dm)*rt2i
832 167321924 : s = (dm - cp)*rt2i
833 167321924 : cp = (cm + dpp)*rt2i
834 167321924 : dpp = (cm - dpp)*rt2i
835 167321924 : zout(1, j, nout2) = ap + r
836 167321924 : zout(2, j, nout2) = bm + s
837 167321924 : zout(1, j, nout6) = ap - r
838 167321924 : zout(2, j, nout6) = bm - s
839 167321924 : zout(1, j, nout4) = am + cp
840 167321924 : zout(2, j, nout4) = bp + dpp
841 167321924 : zout(1, j, nout8) = am - cp
842 175997600 : zout(2, j, nout8) = bp - dpp
843 : END DO; END DO
844 3052099 : DO 8000, ia = 2, after
845 1929451 : ias = ia - 1
846 1929451 : itt = ias*before
847 1929451 : itrig = itt + 1
848 1929451 : cr2 = trig(1, itrig)
849 1929451 : ci2 = trig(2, itrig)
850 1929451 : itrig = itrig + itt
851 1929451 : cr3 = trig(1, itrig)
852 1929451 : ci3 = trig(2, itrig)
853 1929451 : itrig = itrig + itt
854 1929451 : cr4 = trig(1, itrig)
855 1929451 : ci4 = trig(2, itrig)
856 1929451 : itrig = itrig + itt
857 1929451 : cr5 = trig(1, itrig)
858 1929451 : ci5 = trig(2, itrig)
859 1929451 : itrig = itrig + itt
860 1929451 : cr6 = trig(1, itrig)
861 1929451 : ci6 = trig(2, itrig)
862 1929451 : itrig = itrig + itt
863 1929451 : cr7 = trig(1, itrig)
864 1929451 : ci7 = trig(2, itrig)
865 1929451 : itrig = itrig + itt
866 1929451 : cr8 = trig(1, itrig)
867 1929451 : ci8 = trig(2, itrig)
868 1929451 : nin1 = ia - after
869 1929451 : nout1 = ia - atn
870 7204612 : DO ib = 1, before
871 5275161 : nin1 = nin1 + after
872 5275161 : nin2 = nin1 + atb
873 5275161 : nin3 = nin2 + atb
874 5275161 : nin4 = nin3 + atb
875 5275161 : nin5 = nin4 + atb
876 5275161 : nin6 = nin5 + atb
877 5275161 : nin7 = nin6 + atb
878 5275161 : nin8 = nin7 + atb
879 5275161 : nout1 = nout1 + atn
880 5275161 : nout2 = nout1 + after
881 5275161 : nout3 = nout2 + after
882 5275161 : nout4 = nout3 + after
883 5275161 : nout5 = nout4 + after
884 5275161 : nout6 = nout5 + after
885 5275161 : nout7 = nout6 + after
886 5275161 : nout8 = nout7 + after
887 76707484 : DO j = 1, nfft
888 69502872 : r1 = zin(1, j, nin1)
889 69502872 : s1 = zin(2, j, nin1)
890 69502872 : r = zin(1, j, nin2)
891 69502872 : s = zin(2, j, nin2)
892 69502872 : r2 = r*cr2 - s*ci2
893 69502872 : s2 = r*ci2 + s*cr2
894 69502872 : r = zin(1, j, nin3)
895 69502872 : s = zin(2, j, nin3)
896 69502872 : r3 = r*cr3 - s*ci3
897 69502872 : s3 = r*ci3 + s*cr3
898 69502872 : r = zin(1, j, nin4)
899 69502872 : s = zin(2, j, nin4)
900 69502872 : r4 = r*cr4 - s*ci4
901 69502872 : s4 = r*ci4 + s*cr4
902 69502872 : r = zin(1, j, nin5)
903 69502872 : s = zin(2, j, nin5)
904 69502872 : r5 = r*cr5 - s*ci5
905 69502872 : s5 = r*ci5 + s*cr5
906 69502872 : r = zin(1, j, nin6)
907 69502872 : s = zin(2, j, nin6)
908 69502872 : r6 = r*cr6 - s*ci6
909 69502872 : s6 = r*ci6 + s*cr6
910 69502872 : r = zin(1, j, nin7)
911 69502872 : s = zin(2, j, nin7)
912 69502872 : r7 = r*cr7 - s*ci7
913 69502872 : s7 = r*ci7 + s*cr7
914 69502872 : r = zin(1, j, nin8)
915 69502872 : s = zin(2, j, nin8)
916 69502872 : r8 = r*cr8 - s*ci8
917 69502872 : s8 = r*ci8 + s*cr8
918 69502872 : r = r1 + r5
919 69502872 : s = r3 + r7
920 69502872 : ap = r + s
921 69502872 : am = r - s
922 69502872 : r = r2 + r6
923 69502872 : s = r4 + r8
924 69502872 : bp = r + s
925 69502872 : bm = r - s
926 69502872 : r = s1 + s5
927 69502872 : s = s3 + s7
928 69502872 : cp = r + s
929 69502872 : cm = r - s
930 69502872 : r = s2 + s6
931 69502872 : s = s4 + s8
932 69502872 : dpp = r + s
933 69502872 : dm = r - s
934 69502872 : zout(1, j, nout1) = ap + bp
935 69502872 : zout(2, j, nout1) = cp + dpp
936 69502872 : zout(1, j, nout5) = ap - bp
937 69502872 : zout(2, j, nout5) = cp - dpp
938 69502872 : zout(1, j, nout3) = am + dm
939 69502872 : zout(2, j, nout3) = cm - bm
940 69502872 : zout(1, j, nout7) = am - dm
941 69502872 : zout(2, j, nout7) = cm + bm
942 69502872 : r = r1 - r5
943 69502872 : s = s3 - s7
944 69502872 : ap = r + s
945 69502872 : am = r - s
946 69502872 : r = s1 - s5
947 69502872 : s = r3 - r7
948 69502872 : bp = r + s
949 69502872 : bm = r - s
950 69502872 : r = s4 - s8
951 69502872 : s = r2 - r6
952 69502872 : cp = r + s
953 69502872 : cm = r - s
954 69502872 : r = s2 - s6
955 69502872 : s = r4 - r8
956 69502872 : dpp = r + s
957 69502872 : dm = r - s
958 69502872 : r = (cp + dm)*rt2i
959 69502872 : s = (dm - cp)*rt2i
960 69502872 : cp = (cm + dpp)*rt2i
961 69502872 : dpp = (cm - dpp)*rt2i
962 69502872 : zout(1, j, nout2) = ap + r
963 69502872 : zout(2, j, nout2) = bm + s
964 69502872 : zout(1, j, nout6) = ap - r
965 69502872 : zout(2, j, nout6) = bm - s
966 69502872 : zout(1, j, nout4) = am + cp
967 69502872 : zout(2, j, nout4) = bp + dpp
968 69502872 : zout(1, j, nout8) = am - cp
969 74778033 : zout(2, j, nout8) = bp - dpp
970 : END DO; END DO
971 1122648 : 8000 CONTINUE
972 :
973 : ELSE
974 1206088 : ia = 1
975 1206088 : nin1 = ia - after
976 1206088 : nout1 = ia - atn
977 10648329 : DO ib = 1, before
978 9442241 : nin1 = nin1 + after
979 9442241 : nin2 = nin1 + atb
980 9442241 : nin3 = nin2 + atb
981 9442241 : nin4 = nin3 + atb
982 9442241 : nin5 = nin4 + atb
983 9442241 : nin6 = nin5 + atb
984 9442241 : nin7 = nin6 + atb
985 9442241 : nin8 = nin7 + atb
986 9442241 : nout1 = nout1 + atn
987 9442241 : nout2 = nout1 + after
988 9442241 : nout3 = nout2 + after
989 9442241 : nout4 = nout3 + after
990 9442241 : nout5 = nout4 + after
991 9442241 : nout6 = nout5 + after
992 9442241 : nout7 = nout6 + after
993 9442241 : nout8 = nout7 + after
994 191838581 : DO j = 1, nfft
995 181190252 : r1 = zin(1, j, nin1)
996 181190252 : s1 = zin(2, j, nin1)
997 181190252 : r2 = zin(1, j, nin2)
998 181190252 : s2 = zin(2, j, nin2)
999 181190252 : r3 = zin(1, j, nin3)
1000 181190252 : s3 = zin(2, j, nin3)
1001 181190252 : r4 = zin(1, j, nin4)
1002 181190252 : s4 = zin(2, j, nin4)
1003 181190252 : r5 = zin(1, j, nin5)
1004 181190252 : s5 = zin(2, j, nin5)
1005 181190252 : r6 = zin(1, j, nin6)
1006 181190252 : s6 = zin(2, j, nin6)
1007 181190252 : r7 = zin(1, j, nin7)
1008 181190252 : s7 = zin(2, j, nin7)
1009 181190252 : r8 = zin(1, j, nin8)
1010 181190252 : s8 = zin(2, j, nin8)
1011 181190252 : r = r1 + r5
1012 181190252 : s = r3 + r7
1013 181190252 : ap = r + s
1014 181190252 : am = r - s
1015 181190252 : r = r2 + r6
1016 181190252 : s = r4 + r8
1017 181190252 : bp = r + s
1018 181190252 : bm = r - s
1019 181190252 : r = s1 + s5
1020 181190252 : s = s3 + s7
1021 181190252 : cp = r + s
1022 181190252 : cm = r - s
1023 181190252 : r = s2 + s6
1024 181190252 : s = s4 + s8
1025 181190252 : dpp = r + s
1026 181190252 : dm = r - s
1027 181190252 : zout(1, j, nout1) = ap + bp
1028 181190252 : zout(2, j, nout1) = cp + dpp
1029 181190252 : zout(1, j, nout5) = ap - bp
1030 181190252 : zout(2, j, nout5) = cp - dpp
1031 181190252 : zout(1, j, nout3) = am - dm
1032 181190252 : zout(2, j, nout3) = cm + bm
1033 181190252 : zout(1, j, nout7) = am + dm
1034 181190252 : zout(2, j, nout7) = cm - bm
1035 181190252 : r = r1 - r5
1036 181190252 : s = -s3 + s7
1037 181190252 : ap = r + s
1038 181190252 : am = r - s
1039 181190252 : r = s1 - s5
1040 181190252 : s = r7 - r3
1041 181190252 : bp = r + s
1042 181190252 : bm = r - s
1043 181190252 : r = -s4 + s8
1044 181190252 : s = r2 - r6
1045 181190252 : cp = r + s
1046 181190252 : cm = r - s
1047 181190252 : r = -s2 + s6
1048 181190252 : s = r4 - r8
1049 181190252 : dpp = r + s
1050 181190252 : dm = r - s
1051 181190252 : r = (cp + dm)*rt2i
1052 181190252 : s = (cp - dm)*rt2i
1053 181190252 : cp = (cm + dpp)*rt2i
1054 181190252 : dpp = (dpp - cm)*rt2i
1055 181190252 : zout(1, j, nout2) = ap + r
1056 181190252 : zout(2, j, nout2) = bm + s
1057 181190252 : zout(1, j, nout6) = ap - r
1058 181190252 : zout(2, j, nout6) = bm - s
1059 181190252 : zout(1, j, nout4) = am + cp
1060 181190252 : zout(2, j, nout4) = bp + dpp
1061 181190252 : zout(1, j, nout8) = am - cp
1062 190632493 : zout(2, j, nout8) = bp - dpp
1063 : END DO; END DO
1064 :
1065 3279189 : DO 8001, ia = 2, after
1066 2073101 : ias = ia - 1
1067 2073101 : itt = ias*before
1068 2073101 : itrig = itt + 1
1069 2073101 : cr2 = trig(1, itrig)
1070 2073101 : ci2 = trig(2, itrig)
1071 2073101 : itrig = itrig + itt
1072 2073101 : cr3 = trig(1, itrig)
1073 2073101 : ci3 = trig(2, itrig)
1074 2073101 : itrig = itrig + itt
1075 2073101 : cr4 = trig(1, itrig)
1076 2073101 : ci4 = trig(2, itrig)
1077 2073101 : itrig = itrig + itt
1078 2073101 : cr5 = trig(1, itrig)
1079 2073101 : ci5 = trig(2, itrig)
1080 2073101 : itrig = itrig + itt
1081 2073101 : cr6 = trig(1, itrig)
1082 2073101 : ci6 = trig(2, itrig)
1083 2073101 : itrig = itrig + itt
1084 2073101 : cr7 = trig(1, itrig)
1085 2073101 : ci7 = trig(2, itrig)
1086 2073101 : itrig = itrig + itt
1087 2073101 : cr8 = trig(1, itrig)
1088 2073101 : ci8 = trig(2, itrig)
1089 2073101 : nin1 = ia - after
1090 2073101 : nout1 = ia - atn
1091 7779993 : DO ib = 1, before
1092 5706892 : nin1 = nin1 + after
1093 5706892 : nin2 = nin1 + atb
1094 5706892 : nin3 = nin2 + atb
1095 5706892 : nin4 = nin3 + atb
1096 5706892 : nin5 = nin4 + atb
1097 5706892 : nin6 = nin5 + atb
1098 5706892 : nin7 = nin6 + atb
1099 5706892 : nin8 = nin7 + atb
1100 5706892 : nout1 = nout1 + atn
1101 5706892 : nout2 = nout1 + after
1102 5706892 : nout3 = nout2 + after
1103 5706892 : nout4 = nout3 + after
1104 5706892 : nout5 = nout4 + after
1105 5706892 : nout6 = nout5 + after
1106 5706892 : nout7 = nout6 + after
1107 5706892 : nout8 = nout7 + after
1108 82215004 : DO j = 1, nfft
1109 74435011 : r1 = zin(1, j, nin1)
1110 74435011 : s1 = zin(2, j, nin1)
1111 74435011 : r = zin(1, j, nin2)
1112 74435011 : s = zin(2, j, nin2)
1113 74435011 : r2 = r*cr2 - s*ci2
1114 74435011 : s2 = r*ci2 + s*cr2
1115 74435011 : r = zin(1, j, nin3)
1116 74435011 : s = zin(2, j, nin3)
1117 74435011 : r3 = r*cr3 - s*ci3
1118 74435011 : s3 = r*ci3 + s*cr3
1119 74435011 : r = zin(1, j, nin4)
1120 74435011 : s = zin(2, j, nin4)
1121 74435011 : r4 = r*cr4 - s*ci4
1122 74435011 : s4 = r*ci4 + s*cr4
1123 74435011 : r = zin(1, j, nin5)
1124 74435011 : s = zin(2, j, nin5)
1125 74435011 : r5 = r*cr5 - s*ci5
1126 74435011 : s5 = r*ci5 + s*cr5
1127 74435011 : r = zin(1, j, nin6)
1128 74435011 : s = zin(2, j, nin6)
1129 74435011 : r6 = r*cr6 - s*ci6
1130 74435011 : s6 = r*ci6 + s*cr6
1131 74435011 : r = zin(1, j, nin7)
1132 74435011 : s = zin(2, j, nin7)
1133 74435011 : r7 = r*cr7 - s*ci7
1134 74435011 : s7 = r*ci7 + s*cr7
1135 74435011 : r = zin(1, j, nin8)
1136 74435011 : s = zin(2, j, nin8)
1137 74435011 : r8 = r*cr8 - s*ci8
1138 74435011 : s8 = r*ci8 + s*cr8
1139 74435011 : r = r1 + r5
1140 74435011 : s = r3 + r7
1141 74435011 : ap = r + s
1142 74435011 : am = r - s
1143 74435011 : r = r2 + r6
1144 74435011 : s = r4 + r8
1145 74435011 : bp = r + s
1146 74435011 : bm = r - s
1147 74435011 : r = s1 + s5
1148 74435011 : s = s3 + s7
1149 74435011 : cp = r + s
1150 74435011 : cm = r - s
1151 74435011 : r = s2 + s6
1152 74435011 : s = s4 + s8
1153 74435011 : dpp = r + s
1154 74435011 : dm = r - s
1155 74435011 : zout(1, j, nout1) = ap + bp
1156 74435011 : zout(2, j, nout1) = cp + dpp
1157 74435011 : zout(1, j, nout5) = ap - bp
1158 74435011 : zout(2, j, nout5) = cp - dpp
1159 74435011 : zout(1, j, nout3) = am - dm
1160 74435011 : zout(2, j, nout3) = cm + bm
1161 74435011 : zout(1, j, nout7) = am + dm
1162 74435011 : zout(2, j, nout7) = cm - bm
1163 74435011 : r = r1 - r5
1164 74435011 : s = -s3 + s7
1165 74435011 : ap = r + s
1166 74435011 : am = r - s
1167 74435011 : r = s1 - s5
1168 74435011 : s = r7 - r3
1169 74435011 : bp = r + s
1170 74435011 : bm = r - s
1171 74435011 : r = -s4 + s8
1172 74435011 : s = r2 - r6
1173 74435011 : cp = r + s
1174 74435011 : cm = r - s
1175 74435011 : r = -s2 + s6
1176 74435011 : s = r4 - r8
1177 74435011 : dpp = r + s
1178 74435011 : dm = r - s
1179 74435011 : r = (cp + dm)*rt2i
1180 74435011 : s = (cp - dm)*rt2i
1181 74435011 : cp = (cm + dpp)*rt2i
1182 74435011 : dpp = (dpp - cm)*rt2i
1183 74435011 : zout(1, j, nout2) = ap + r
1184 74435011 : zout(2, j, nout2) = bm + s
1185 74435011 : zout(1, j, nout6) = ap - r
1186 74435011 : zout(2, j, nout6) = bm - s
1187 74435011 : zout(1, j, nout4) = am + cp
1188 74435011 : zout(2, j, nout4) = bp + dpp
1189 74435011 : zout(1, j, nout8) = am - cp
1190 80141903 : zout(2, j, nout8) = bp - dpp
1191 : END DO; END DO
1192 1206088 : 8001 CONTINUE
1193 :
1194 : END IF
1195 : ELSE IF (now == 3) THEN
1196 : ! .5_dp*sqrt(3._dp)
1197 9219351 : bb = isign*0.8660254037844387_dp
1198 9219351 : ia = 1
1199 9219351 : nin1 = ia - after
1200 9219351 : nout1 = ia - atn
1201 34416968 : DO ib = 1, before
1202 25197617 : nin1 = nin1 + after
1203 25197617 : nin2 = nin1 + atb
1204 25197617 : nin3 = nin2 + atb
1205 25197617 : nout1 = nout1 + atn
1206 25197617 : nout2 = nout1 + after
1207 25197617 : nout3 = nout2 + after
1208 513518127 : DO j = 1, nfft
1209 479101159 : r1 = zin(1, j, nin1)
1210 479101159 : s1 = zin(2, j, nin1)
1211 479101159 : r2 = zin(1, j, nin2)
1212 479101159 : s2 = zin(2, j, nin2)
1213 479101159 : r3 = zin(1, j, nin3)
1214 479101159 : s3 = zin(2, j, nin3)
1215 479101159 : r = r2 + r3
1216 479101159 : s = s2 + s3
1217 479101159 : zout(1, j, nout1) = r + r1
1218 479101159 : zout(2, j, nout1) = s + s1
1219 479101159 : r1 = r1 - .5_dp*r
1220 479101159 : s1 = s1 - .5_dp*s
1221 479101159 : r2 = bb*(r2 - r3)
1222 479101159 : s2 = bb*(s2 - s3)
1223 479101159 : zout(1, j, nout2) = r1 - s2
1224 479101159 : zout(2, j, nout2) = s1 + r2
1225 479101159 : zout(1, j, nout3) = r1 + s2
1226 504298776 : zout(2, j, nout3) = s1 - r2
1227 : END DO; END DO
1228 167358678 : DO 3000, ia = 2, after
1229 158139327 : ias = ia - 1
1230 158139327 : IF (4*ias == 3*after) THEN
1231 5764208 : IF (isign == 1) THEN
1232 2957725 : nin1 = ia - after
1233 2957725 : nout1 = ia - atn
1234 12264626 : DO ib = 1, before
1235 9306901 : nin1 = nin1 + after
1236 9306901 : nin2 = nin1 + atb
1237 9306901 : nin3 = nin2 + atb
1238 9306901 : nout1 = nout1 + atn
1239 9306901 : nout2 = nout1 + after
1240 9306901 : nout3 = nout2 + after
1241 189882005 : DO j = 1, nfft
1242 177617379 : r1 = zin(1, j, nin1)
1243 177617379 : s1 = zin(2, j, nin1)
1244 177617379 : r2 = zin(2, j, nin2)
1245 177617379 : s2 = zin(1, j, nin2)
1246 177617379 : r3 = zin(1, j, nin3)
1247 177617379 : s3 = zin(2, j, nin3)
1248 177617379 : r = r3 + r2
1249 177617379 : s = s2 - s3
1250 177617379 : zout(1, j, nout1) = r1 - r
1251 177617379 : zout(2, j, nout1) = s + s1
1252 177617379 : r1 = r1 + .5_dp*r
1253 177617379 : s1 = s1 - .5_dp*s
1254 177617379 : r2 = bb*(r2 - r3)
1255 177617379 : s2 = bb*(s2 + s3)
1256 177617379 : zout(1, j, nout2) = r1 - s2
1257 177617379 : zout(2, j, nout2) = s1 - r2
1258 177617379 : zout(1, j, nout3) = r1 + s2
1259 186924280 : zout(2, j, nout3) = s1 + r2
1260 : END DO; END DO
1261 : ELSE
1262 2806483 : nin1 = ia - after
1263 2806483 : nout1 = ia - atn
1264 11624010 : DO ib = 1, before
1265 8817527 : nin1 = nin1 + after
1266 8817527 : nin2 = nin1 + atb
1267 8817527 : nin3 = nin2 + atb
1268 8817527 : nout1 = nout1 + atn
1269 8817527 : nout2 = nout1 + after
1270 8817527 : nout3 = nout2 + after
1271 180604038 : DO j = 1, nfft
1272 168980028 : r1 = zin(1, j, nin1)
1273 168980028 : s1 = zin(2, j, nin1)
1274 168980028 : r2 = zin(2, j, nin2)
1275 168980028 : s2 = zin(1, j, nin2)
1276 168980028 : r3 = zin(1, j, nin3)
1277 168980028 : s3 = zin(2, j, nin3)
1278 168980028 : r = r2 - r3
1279 168980028 : s = s2 + s3
1280 168980028 : zout(1, j, nout1) = r + r1
1281 168980028 : zout(2, j, nout1) = s1 - s
1282 168980028 : r1 = r1 - .5_dp*r
1283 168980028 : s1 = s1 + .5_dp*s
1284 168980028 : r2 = bb*(r2 + r3)
1285 168980028 : s2 = bb*(s2 - s3)
1286 168980028 : zout(1, j, nout2) = r1 + s2
1287 168980028 : zout(2, j, nout2) = s1 + r2
1288 168980028 : zout(1, j, nout3) = r1 - s2
1289 177797555 : zout(2, j, nout3) = s1 - r2
1290 : END DO; END DO
1291 : END IF
1292 152375119 : ELSE IF (8*ias == 3*after) THEN
1293 1808890 : IF (isign == 1) THEN
1294 927746 : nin1 = ia - after
1295 927746 : nout1 = ia - atn
1296 2248194 : DO ib = 1, before
1297 1320448 : nin1 = nin1 + after
1298 1320448 : nin2 = nin1 + atb
1299 1320448 : nin3 = nin2 + atb
1300 1320448 : nout1 = nout1 + atn
1301 1320448 : nout2 = nout1 + after
1302 1320448 : nout3 = nout2 + after
1303 28466755 : DO j = 1, nfft
1304 26218561 : r1 = zin(1, j, nin1)
1305 26218561 : s1 = zin(2, j, nin1)
1306 26218561 : r = zin(1, j, nin2)
1307 26218561 : s = zin(2, j, nin2)
1308 26218561 : r2 = (r - s)*rt2i
1309 26218561 : s2 = (r + s)*rt2i
1310 26218561 : r3 = zin(2, j, nin3)
1311 26218561 : s3 = zin(1, j, nin3)
1312 26218561 : r = r2 - r3
1313 26218561 : s = s2 + s3
1314 26218561 : zout(1, j, nout1) = r + r1
1315 26218561 : zout(2, j, nout1) = s + s1
1316 26218561 : r1 = r1 - .5_dp*r
1317 26218561 : s1 = s1 - .5_dp*s
1318 26218561 : r2 = bb*(r2 + r3)
1319 26218561 : s2 = bb*(s2 - s3)
1320 26218561 : zout(1, j, nout2) = r1 - s2
1321 26218561 : zout(2, j, nout2) = s1 + r2
1322 26218561 : zout(1, j, nout3) = r1 + s2
1323 27539009 : zout(2, j, nout3) = s1 - r2
1324 : END DO; END DO
1325 : ELSE
1326 881144 : nin1 = ia - after
1327 881144 : nout1 = ia - atn
1328 2132778 : DO ib = 1, before
1329 1251634 : nin1 = nin1 + after
1330 1251634 : nin2 = nin1 + atb
1331 1251634 : nin3 = nin2 + atb
1332 1251634 : nout1 = nout1 + atn
1333 1251634 : nout2 = nout1 + after
1334 1251634 : nout3 = nout2 + after
1335 26893836 : DO j = 1, nfft
1336 24761058 : r1 = zin(1, j, nin1)
1337 24761058 : s1 = zin(2, j, nin1)
1338 24761058 : r = zin(1, j, nin2)
1339 24761058 : s = zin(2, j, nin2)
1340 24761058 : r2 = (r + s)*rt2i
1341 24761058 : s2 = (s - r)*rt2i
1342 24761058 : r3 = zin(2, j, nin3)
1343 24761058 : s3 = zin(1, j, nin3)
1344 24761058 : r = r2 + r3
1345 24761058 : s = s2 - s3
1346 24761058 : zout(1, j, nout1) = r + r1
1347 24761058 : zout(2, j, nout1) = s + s1
1348 24761058 : r1 = r1 - .5_dp*r
1349 24761058 : s1 = s1 - .5_dp*s
1350 24761058 : r2 = bb*(r2 - r3)
1351 24761058 : s2 = bb*(s2 + s3)
1352 24761058 : zout(1, j, nout2) = r1 - s2
1353 24761058 : zout(2, j, nout2) = s1 + r2
1354 24761058 : zout(1, j, nout3) = r1 + s2
1355 26012692 : zout(2, j, nout3) = s1 - r2
1356 : END DO; END DO
1357 : END IF
1358 : ELSE
1359 150566229 : itt = ias*before
1360 150566229 : itrig = itt + 1
1361 150566229 : cr2 = trig(1, itrig)
1362 150566229 : ci2 = trig(2, itrig)
1363 150566229 : itrig = itrig + itt
1364 150566229 : cr3 = trig(1, itrig)
1365 150566229 : ci3 = trig(2, itrig)
1366 150566229 : nin1 = ia - after
1367 150566229 : nout1 = ia - atn
1368 368944388 : DO ib = 1, before
1369 218378159 : nin1 = nin1 + after
1370 218378159 : nin2 = nin1 + atb
1371 218378159 : nin3 = nin2 + atb
1372 218378159 : nout1 = nout1 + atn
1373 218378159 : nout2 = nout1 + after
1374 218378159 : nout3 = nout2 + after
1375 4262592967 : DO j = 1, nfft
1376 3893648579 : r1 = zin(1, j, nin1)
1377 3893648579 : s1 = zin(2, j, nin1)
1378 3893648579 : r = zin(1, j, nin2)
1379 3893648579 : s = zin(2, j, nin2)
1380 3893648579 : r2 = r*cr2 - s*ci2
1381 3893648579 : s2 = r*ci2 + s*cr2
1382 3893648579 : r = zin(1, j, nin3)
1383 3893648579 : s = zin(2, j, nin3)
1384 3893648579 : r3 = r*cr3 - s*ci3
1385 3893648579 : s3 = r*ci3 + s*cr3
1386 3893648579 : r = r2 + r3
1387 3893648579 : s = s2 + s3
1388 3893648579 : zout(1, j, nout1) = r + r1
1389 3893648579 : zout(2, j, nout1) = s + s1
1390 3893648579 : r1 = r1 - .5_dp*r
1391 3893648579 : s1 = s1 - .5_dp*s
1392 3893648579 : r2 = bb*(r2 - r3)
1393 3893648579 : s2 = bb*(s2 - s3)
1394 3893648579 : zout(1, j, nout2) = r1 - s2
1395 3893648579 : zout(2, j, nout2) = s1 + r2
1396 3893648579 : zout(1, j, nout3) = r1 + s2
1397 4112026738 : zout(2, j, nout3) = s1 - r2
1398 : END DO; END DO
1399 : END IF
1400 9219351 : 3000 CONTINUE
1401 : ELSE IF (now == 5) THEN
1402 : ! cos(2._dp*pi/5._dp)
1403 3349836 : cos2 = 0.3090169943749474_dp
1404 : ! cos(4._dp*pi/5._dp)
1405 3349836 : cos4 = -0.8090169943749474_dp
1406 : ! sin(2._dp*pi/5._dp)
1407 3349836 : sin2 = isign*0.9510565162951536_dp
1408 : ! sin(4._dp*pi/5._dp)
1409 3349836 : sin4 = isign*0.5877852522924731_dp
1410 3349836 : ia = 1
1411 3349836 : nin1 = ia - after
1412 3349836 : nout1 = ia - atn
1413 34693718 : DO ib = 1, before
1414 31343882 : nin1 = nin1 + after
1415 31343882 : nin2 = nin1 + atb
1416 31343882 : nin3 = nin2 + atb
1417 31343882 : nin4 = nin3 + atb
1418 31343882 : nin5 = nin4 + atb
1419 31343882 : nout1 = nout1 + atn
1420 31343882 : nout2 = nout1 + after
1421 31343882 : nout3 = nout2 + after
1422 31343882 : nout4 = nout3 + after
1423 31343882 : nout5 = nout4 + after
1424 666135931 : DO j = 1, nfft
1425 631442213 : r1 = zin(1, j, nin1)
1426 631442213 : s1 = zin(2, j, nin1)
1427 631442213 : r2 = zin(1, j, nin2)
1428 631442213 : s2 = zin(2, j, nin2)
1429 631442213 : r3 = zin(1, j, nin3)
1430 631442213 : s3 = zin(2, j, nin3)
1431 631442213 : r4 = zin(1, j, nin4)
1432 631442213 : s4 = zin(2, j, nin4)
1433 631442213 : r5 = zin(1, j, nin5)
1434 631442213 : s5 = zin(2, j, nin5)
1435 631442213 : r25 = r2 + r5
1436 631442213 : r34 = r3 + r4
1437 631442213 : s25 = s2 - s5
1438 631442213 : s34 = s3 - s4
1439 631442213 : zout(1, j, nout1) = r1 + r25 + r34
1440 631442213 : r = r1 + cos2*r25 + cos4*r34
1441 631442213 : s = sin2*s25 + sin4*s34
1442 631442213 : zout(1, j, nout2) = r - s
1443 631442213 : zout(1, j, nout5) = r + s
1444 631442213 : r = r1 + cos4*r25 + cos2*r34
1445 631442213 : s = sin4*s25 - sin2*s34
1446 631442213 : zout(1, j, nout3) = r - s
1447 631442213 : zout(1, j, nout4) = r + s
1448 631442213 : r25 = r2 - r5
1449 631442213 : r34 = r3 - r4
1450 631442213 : s25 = s2 + s5
1451 631442213 : s34 = s3 + s4
1452 631442213 : zout(2, j, nout1) = s1 + s25 + s34
1453 631442213 : r = s1 + cos2*s25 + cos4*s34
1454 631442213 : s = sin2*r25 + sin4*r34
1455 631442213 : zout(2, j, nout2) = r + s
1456 631442213 : zout(2, j, nout5) = r - s
1457 631442213 : r = s1 + cos4*s25 + cos2*s34
1458 631442213 : s = sin4*r25 - sin2*r34
1459 631442213 : zout(2, j, nout3) = r + s
1460 662786095 : zout(2, j, nout4) = r - s
1461 : END DO; END DO
1462 11488616 : DO 5000, ia = 2, after
1463 8138780 : ias = ia - 1
1464 8138780 : IF (8*ias == 5*after) THEN
1465 623624 : IF (isign == 1) THEN
1466 324946 : nin1 = ia - after
1467 324946 : nout1 = ia - atn
1468 950012 : DO ib = 1, before
1469 625066 : nin1 = nin1 + after
1470 625066 : nin2 = nin1 + atb
1471 625066 : nin3 = nin2 + atb
1472 625066 : nin4 = nin3 + atb
1473 625066 : nin5 = nin4 + atb
1474 625066 : nout1 = nout1 + atn
1475 625066 : nout2 = nout1 + after
1476 625066 : nout3 = nout2 + after
1477 625066 : nout4 = nout3 + after
1478 625066 : nout5 = nout4 + after
1479 14699799 : DO j = 1, nfft
1480 13749787 : r1 = zin(1, j, nin1)
1481 13749787 : s1 = zin(2, j, nin1)
1482 13749787 : r = zin(1, j, nin2)
1483 13749787 : s = zin(2, j, nin2)
1484 13749787 : r2 = (r - s)*rt2i
1485 13749787 : s2 = (r + s)*rt2i
1486 13749787 : r3 = zin(2, j, nin3)
1487 13749787 : s3 = zin(1, j, nin3)
1488 13749787 : r = zin(1, j, nin4)
1489 13749787 : s = zin(2, j, nin4)
1490 13749787 : r4 = (r + s)*rt2i
1491 13749787 : s4 = (r - s)*rt2i
1492 13749787 : r5 = zin(1, j, nin5)
1493 13749787 : s5 = zin(2, j, nin5)
1494 13749787 : r25 = r2 - r5
1495 13749787 : r34 = r3 + r4
1496 13749787 : s25 = s2 + s5
1497 13749787 : s34 = s3 - s4
1498 13749787 : zout(1, j, nout1) = r1 + r25 - r34
1499 13749787 : r = r1 + cos2*r25 - cos4*r34
1500 13749787 : s = sin2*s25 + sin4*s34
1501 13749787 : zout(1, j, nout2) = r - s
1502 13749787 : zout(1, j, nout5) = r + s
1503 13749787 : r = r1 + cos4*r25 - cos2*r34
1504 13749787 : s = sin4*s25 - sin2*s34
1505 13749787 : zout(1, j, nout3) = r - s
1506 13749787 : zout(1, j, nout4) = r + s
1507 13749787 : r25 = r2 + r5
1508 13749787 : r34 = r4 - r3
1509 13749787 : s25 = s2 - s5
1510 13749787 : s34 = s3 + s4
1511 13749787 : zout(2, j, nout1) = s1 + s25 + s34
1512 13749787 : r = s1 + cos2*s25 + cos4*s34
1513 13749787 : s = sin2*r25 + sin4*r34
1514 13749787 : zout(2, j, nout2) = r + s
1515 13749787 : zout(2, j, nout5) = r - s
1516 13749787 : r = s1 + cos4*s25 + cos2*s34
1517 13749787 : s = sin4*r25 - sin2*r34
1518 13749787 : zout(2, j, nout3) = r + s
1519 14374853 : zout(2, j, nout4) = r - s
1520 : END DO; END DO
1521 : ELSE
1522 298678 : nin1 = ia - after
1523 298678 : nout1 = ia - atn
1524 884300 : DO ib = 1, before
1525 585622 : nin1 = nin1 + after
1526 585622 : nin2 = nin1 + atb
1527 585622 : nin3 = nin2 + atb
1528 585622 : nin4 = nin3 + atb
1529 585622 : nin5 = nin4 + atb
1530 585622 : nout1 = nout1 + atn
1531 585622 : nout2 = nout1 + after
1532 585622 : nout3 = nout2 + after
1533 585622 : nout4 = nout3 + after
1534 585622 : nout5 = nout4 + after
1535 13548780 : DO j = 1, nfft
1536 12664480 : r1 = zin(1, j, nin1)
1537 12664480 : s1 = zin(2, j, nin1)
1538 12664480 : r = zin(1, j, nin2)
1539 12664480 : s = zin(2, j, nin2)
1540 12664480 : r2 = (r + s)*rt2i
1541 12664480 : s2 = (s - r)*rt2i
1542 12664480 : r3 = zin(2, j, nin3)
1543 12664480 : s3 = zin(1, j, nin3)
1544 12664480 : r = zin(1, j, nin4)
1545 12664480 : s = zin(2, j, nin4)
1546 12664480 : r4 = (s - r)*rt2i
1547 12664480 : s4 = (r + s)*rt2i
1548 12664480 : r5 = zin(1, j, nin5)
1549 12664480 : s5 = zin(2, j, nin5)
1550 12664480 : r25 = r2 - r5
1551 12664480 : r34 = r3 + r4
1552 12664480 : s25 = s2 + s5
1553 12664480 : s34 = s4 - s3
1554 12664480 : zout(1, j, nout1) = r1 + r25 + r34
1555 12664480 : r = r1 + cos2*r25 + cos4*r34
1556 12664480 : s = sin2*s25 + sin4*s34
1557 12664480 : zout(1, j, nout2) = r - s
1558 12664480 : zout(1, j, nout5) = r + s
1559 12664480 : r = r1 + cos4*r25 + cos2*r34
1560 12664480 : s = sin4*s25 - sin2*s34
1561 12664480 : zout(1, j, nout3) = r - s
1562 12664480 : zout(1, j, nout4) = r + s
1563 12664480 : r25 = r2 + r5
1564 12664480 : r34 = r3 - r4
1565 12664480 : s25 = s2 - s5
1566 12664480 : s34 = s3 + s4
1567 12664480 : zout(2, j, nout1) = s1 + s25 - s34
1568 12664480 : r = s1 + cos2*s25 - cos4*s34
1569 12664480 : s = sin2*r25 + sin4*r34
1570 12664480 : zout(2, j, nout2) = r + s
1571 12664480 : zout(2, j, nout5) = r - s
1572 12664480 : r = s1 + cos4*s25 - cos2*s34
1573 12664480 : s = sin4*r25 - sin2*r34
1574 12664480 : zout(2, j, nout3) = r + s
1575 13250102 : zout(2, j, nout4) = r - s
1576 : END DO; END DO
1577 : END IF
1578 : ELSE
1579 7515156 : ias = ia - 1
1580 7515156 : itt = ias*before
1581 7515156 : itrig = itt + 1
1582 7515156 : cr2 = trig(1, itrig)
1583 7515156 : ci2 = trig(2, itrig)
1584 7515156 : itrig = itrig + itt
1585 7515156 : cr3 = trig(1, itrig)
1586 7515156 : ci3 = trig(2, itrig)
1587 7515156 : itrig = itrig + itt
1588 7515156 : cr4 = trig(1, itrig)
1589 7515156 : ci4 = trig(2, itrig)
1590 7515156 : itrig = itrig + itt
1591 7515156 : cr5 = trig(1, itrig)
1592 7515156 : ci5 = trig(2, itrig)
1593 7515156 : nin1 = ia - after
1594 7515156 : nout1 = ia - atn
1595 24084936 : DO ib = 1, before
1596 16569780 : nin1 = nin1 + after
1597 16569780 : nin2 = nin1 + atb
1598 16569780 : nin3 = nin2 + atb
1599 16569780 : nin4 = nin3 + atb
1600 16569780 : nin5 = nin4 + atb
1601 16569780 : nout1 = nout1 + atn
1602 16569780 : nout2 = nout1 + after
1603 16569780 : nout3 = nout2 + after
1604 16569780 : nout4 = nout3 + after
1605 16569780 : nout5 = nout4 + after
1606 349478778 : DO j = 1, nfft
1607 325393842 : r1 = zin(1, j, nin1)
1608 325393842 : s1 = zin(2, j, nin1)
1609 325393842 : r = zin(1, j, nin2)
1610 325393842 : s = zin(2, j, nin2)
1611 325393842 : r2 = r*cr2 - s*ci2
1612 325393842 : s2 = r*ci2 + s*cr2
1613 325393842 : r = zin(1, j, nin3)
1614 325393842 : s = zin(2, j, nin3)
1615 325393842 : r3 = r*cr3 - s*ci3
1616 325393842 : s3 = r*ci3 + s*cr3
1617 325393842 : r = zin(1, j, nin4)
1618 325393842 : s = zin(2, j, nin4)
1619 325393842 : r4 = r*cr4 - s*ci4
1620 325393842 : s4 = r*ci4 + s*cr4
1621 325393842 : r = zin(1, j, nin5)
1622 325393842 : s = zin(2, j, nin5)
1623 325393842 : r5 = r*cr5 - s*ci5
1624 325393842 : s5 = r*ci5 + s*cr5
1625 325393842 : r25 = r2 + r5
1626 325393842 : r34 = r3 + r4
1627 325393842 : s25 = s2 - s5
1628 325393842 : s34 = s3 - s4
1629 325393842 : zout(1, j, nout1) = r1 + r25 + r34
1630 325393842 : r = r1 + cos2*r25 + cos4*r34
1631 325393842 : s = sin2*s25 + sin4*s34
1632 325393842 : zout(1, j, nout2) = r - s
1633 325393842 : zout(1, j, nout5) = r + s
1634 325393842 : r = r1 + cos4*r25 + cos2*r34
1635 325393842 : s = sin4*s25 - sin2*s34
1636 325393842 : zout(1, j, nout3) = r - s
1637 325393842 : zout(1, j, nout4) = r + s
1638 325393842 : r25 = r2 - r5
1639 325393842 : r34 = r3 - r4
1640 325393842 : s25 = s2 + s5
1641 325393842 : s34 = s3 + s4
1642 325393842 : zout(2, j, nout1) = s1 + s25 + s34
1643 325393842 : r = s1 + cos2*s25 + cos4*s34
1644 325393842 : s = sin2*r25 + sin4*r34
1645 325393842 : zout(2, j, nout2) = r + s
1646 325393842 : zout(2, j, nout5) = r - s
1647 325393842 : r = s1 + cos4*s25 + cos2*s34
1648 325393842 : s = sin4*r25 - sin2*r34
1649 325393842 : zout(2, j, nout3) = r + s
1650 341963622 : zout(2, j, nout4) = r - s
1651 : END DO; END DO
1652 : END IF
1653 3349836 : 5000 CONTINUE
1654 : ELSE IF (now == 6) THEN
1655 : ! .5_dp*sqrt(3._dp)
1656 2839042 : bb = isign*0.8660254037844387_dp
1657 :
1658 2839042 : ia = 1
1659 2839042 : nin1 = ia - after
1660 2839042 : nout1 = ia - atn
1661 39060889 : DO ib = 1, before
1662 36221847 : nin1 = nin1 + after
1663 36221847 : nin2 = nin1 + atb
1664 36221847 : nin3 = nin2 + atb
1665 36221847 : nin4 = nin3 + atb
1666 36221847 : nin5 = nin4 + atb
1667 36221847 : nin6 = nin5 + atb
1668 36221847 : nout1 = nout1 + atn
1669 36221847 : nout2 = nout1 + after
1670 36221847 : nout3 = nout2 + after
1671 36221847 : nout4 = nout3 + after
1672 36221847 : nout5 = nout4 + after
1673 36221847 : nout6 = nout5 + after
1674 627645225 : DO j = 1, nfft
1675 588584336 : r2 = zin(1, j, nin3)
1676 588584336 : s2 = zin(2, j, nin3)
1677 588584336 : r3 = zin(1, j, nin5)
1678 588584336 : s3 = zin(2, j, nin5)
1679 588584336 : r = r2 + r3
1680 588584336 : s = s2 + s3
1681 588584336 : r1 = zin(1, j, nin1)
1682 588584336 : s1 = zin(2, j, nin1)
1683 588584336 : ur1 = r + r1
1684 588584336 : ui1 = s + s1
1685 588584336 : r1 = r1 - .5_dp*r
1686 588584336 : s1 = s1 - .5_dp*s
1687 588584336 : r = r2 - r3
1688 588584336 : s = s2 - s3
1689 588584336 : ur2 = r1 - s*bb
1690 588584336 : ui2 = s1 + r*bb
1691 588584336 : ur3 = r1 + s*bb
1692 588584336 : ui3 = s1 - r*bb
1693 :
1694 588584336 : r2 = zin(1, j, nin6)
1695 588584336 : s2 = zin(2, j, nin6)
1696 588584336 : r3 = zin(1, j, nin2)
1697 588584336 : s3 = zin(2, j, nin2)
1698 588584336 : r = r2 + r3
1699 588584336 : s = s2 + s3
1700 588584336 : r1 = zin(1, j, nin4)
1701 588584336 : s1 = zin(2, j, nin4)
1702 588584336 : vr1 = r + r1
1703 588584336 : vi1 = s + s1
1704 588584336 : r1 = r1 - .5_dp*r
1705 588584336 : s1 = s1 - .5_dp*s
1706 588584336 : r = r2 - r3
1707 588584336 : s = s2 - s3
1708 588584336 : vr2 = r1 - s*bb
1709 588584336 : vi2 = s1 + r*bb
1710 588584336 : vr3 = r1 + s*bb
1711 588584336 : vi3 = s1 - r*bb
1712 :
1713 588584336 : zout(1, j, nout1) = ur1 + vr1
1714 588584336 : zout(2, j, nout1) = ui1 + vi1
1715 588584336 : zout(1, j, nout5) = ur2 + vr2
1716 588584336 : zout(2, j, nout5) = ui2 + vi2
1717 588584336 : zout(1, j, nout3) = ur3 + vr3
1718 588584336 : zout(2, j, nout3) = ui3 + vi3
1719 588584336 : zout(1, j, nout4) = ur1 - vr1
1720 588584336 : zout(2, j, nout4) = ui1 - vi1
1721 588584336 : zout(1, j, nout2) = ur2 - vr2
1722 588584336 : zout(2, j, nout2) = ui2 - vi2
1723 588584336 : zout(1, j, nout6) = ur3 - vr3
1724 624806183 : zout(2, j, nout6) = ui3 - vi3
1725 : END DO; END DO
1726 : ELSE
1727 0 : CPABORT("error fftstp")
1728 : END IF
1729 :
1730 23355934 : END SUBROUTINE fftstp
1731 :
1732 : END MODULE ps_wavelet_fft3d
|