Line data Source code
1 : !--------------------------------------------------------------------------------------------------!
2 : ! CP2K: A general program to perform molecular dynamics simulations !
3 : ! Copyright 2000-2025 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 109423 : 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 1761126 : loop_data: DO i = 1, ndata1024
54 1761126 : IF (n <= idata(i)) THEN
55 109423 : n_next = idata(i)
56 109423 : 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 96449 : 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 1565336 : DO i = 1, 150
202 1565336 : 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 1565336 : IF (n .EQ. idata(1, i)) THEN
209 96449 : ic = 0
210 328953 : DO j = 1, 6
211 328953 : itt = idata(1 + j, i)
212 328953 : IF (itt .GT. 1) THEN
213 232504 : ic = ic + 1
214 232504 : 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 96449 : after(1) = 1
224 96449 : before(ic) = 1
225 232504 : DO i = 2, ic
226 136055 : after(i) = after(i - 1)*now(i - 1)
227 232504 : before(ic - i + 1) = before(ic - i + 2)*now(ic - i + 2)
228 : END DO
229 :
230 96449 : twopi = 6.283185307179586_dp
231 96449 : angle = isign*twopi/n
232 96449 : IF (MOD(n, 2) .EQ. 0) THEN
233 85034 : nh = n/2
234 85034 : trig(1, 1) = 1._dp
235 85034 : trig(2, 1) = 0._dp
236 85034 : trig(1, nh + 1) = -1._dp
237 85034 : trig(2, nh + 1) = 0._dp
238 1850674 : DO 40, i = 1, nh - 1
239 1765640 : trigc = COS(i*angle)
240 1765640 : trigs = SIN(i*angle)
241 1765640 : trig(1, i + 1) = trigc
242 1765640 : trig(2, i + 1) = trigs
243 1765640 : trig(1, n - i + 1) = trigc
244 1765640 : trig(2, n - i + 1) = -trigs
245 85034 : 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 96449 : 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 21936468 : 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 21936468 : atn = after*now
300 21936468 : atb = after*before
301 :
302 : ! sqrt(.5_dp)
303 21936468 : 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 5354147 : IF (isign .EQ. 1) THEN
474 2741866 : ia = 1
475 2741866 : nin1 = ia - after
476 2741866 : nout1 = ia - atn
477 23561825 : DO ib = 1, before
478 20819959 : nin1 = nin1 + after
479 20819959 : nin2 = nin1 + atb
480 20819959 : nin3 = nin2 + atb
481 20819959 : nin4 = nin3 + atb
482 20819959 : nout1 = nout1 + atn
483 20819959 : nout2 = nout1 + after
484 20819959 : nout3 = nout2 + after
485 20819959 : nout4 = nout3 + after
486 428692414 : DO j = 1, nfft
487 405130589 : r1 = zin(1, j, nin1)
488 405130589 : s1 = zin(2, j, nin1)
489 405130589 : r2 = zin(1, j, nin2)
490 405130589 : s2 = zin(2, j, nin2)
491 405130589 : r3 = zin(1, j, nin3)
492 405130589 : s3 = zin(2, j, nin3)
493 405130589 : r4 = zin(1, j, nin4)
494 405130589 : s4 = zin(2, j, nin4)
495 405130589 : r = r1 + r3
496 405130589 : s = r2 + r4
497 405130589 : zout(1, j, nout1) = r + s
498 405130589 : zout(1, j, nout3) = r - s
499 405130589 : r = r1 - r3
500 405130589 : s = s2 - s4
501 405130589 : zout(1, j, nout2) = r - s
502 405130589 : zout(1, j, nout4) = r + s
503 405130589 : r = s1 + s3
504 405130589 : s = s2 + s4
505 405130589 : zout(2, j, nout1) = r + s
506 405130589 : zout(2, j, nout3) = r - s
507 405130589 : r = s1 - s3
508 405130589 : s = r2 - r4
509 405130589 : zout(2, j, nout2) = r + s
510 425950548 : zout(2, j, nout4) = r - s
511 : END DO; END DO
512 27913901 : DO 4000, ia = 2, after
513 25172035 : ias = ia - 1
514 25172035 : IF (2*ias .EQ. after) THEN
515 1143301 : nin1 = ia - after
516 1143301 : nout1 = ia - atn
517 2656085 : DO ib = 1, before
518 1512784 : nin1 = nin1 + after
519 1512784 : nin2 = nin1 + atb
520 1512784 : nin3 = nin2 + atb
521 1512784 : nin4 = nin3 + atb
522 1512784 : nout1 = nout1 + atn
523 1512784 : nout2 = nout1 + after
524 1512784 : nout3 = nout2 + after
525 1512784 : nout4 = nout3 + after
526 31903998 : DO j = 1, nfft
527 29247913 : r1 = zin(1, j, nin1)
528 29247913 : s1 = zin(2, j, nin1)
529 29247913 : r = zin(1, j, nin2)
530 29247913 : s = zin(2, j, nin2)
531 29247913 : r2 = (r - s)*rt2i
532 29247913 : s2 = (r + s)*rt2i
533 29247913 : r3 = zin(2, j, nin3)
534 29247913 : s3 = zin(1, j, nin3)
535 29247913 : r = zin(1, j, nin4)
536 29247913 : s = zin(2, j, nin4)
537 29247913 : r4 = (r + s)*rt2i
538 29247913 : s4 = (r - s)*rt2i
539 29247913 : r = r1 - r3
540 29247913 : s = r2 - r4
541 29247913 : zout(1, j, nout1) = r + s
542 29247913 : zout(1, j, nout3) = r - s
543 29247913 : r = r1 + r3
544 29247913 : s = s2 - s4
545 29247913 : zout(1, j, nout2) = r - s
546 29247913 : zout(1, j, nout4) = r + s
547 29247913 : r = s1 + s3
548 29247913 : s = s2 + s4
549 29247913 : zout(2, j, nout1) = r + s
550 29247913 : zout(2, j, nout3) = r - s
551 29247913 : r = s1 - s3
552 29247913 : s = r2 + r4
553 29247913 : zout(2, j, nout2) = r + s
554 30760697 : zout(2, j, nout4) = r - s
555 : END DO; END DO
556 : ELSE
557 24028734 : itt = ias*before
558 24028734 : itrig = itt + 1
559 24028734 : cr2 = trig(1, itrig)
560 24028734 : ci2 = trig(2, itrig)
561 24028734 : itrig = itrig + itt
562 24028734 : cr3 = trig(1, itrig)
563 24028734 : ci3 = trig(2, itrig)
564 24028734 : itrig = itrig + itt
565 24028734 : cr4 = trig(1, itrig)
566 24028734 : ci4 = trig(2, itrig)
567 24028734 : nin1 = ia - after
568 24028734 : nout1 = ia - atn
569 59997582 : DO ib = 1, before
570 35968848 : nin1 = nin1 + after
571 35968848 : nin2 = nin1 + atb
572 35968848 : nin3 = nin2 + atb
573 35968848 : nin4 = nin3 + atb
574 35968848 : nout1 = nout1 + atn
575 35968848 : nout2 = nout1 + after
576 35968848 : nout3 = nout2 + after
577 35968848 : nout4 = nout3 + after
578 741738040 : DO j = 1, nfft
579 681740458 : r1 = zin(1, j, nin1)
580 681740458 : s1 = zin(2, j, nin1)
581 681740458 : r = zin(1, j, nin2)
582 681740458 : s = zin(2, j, nin2)
583 681740458 : r2 = r*cr2 - s*ci2
584 681740458 : s2 = r*ci2 + s*cr2
585 681740458 : r = zin(1, j, nin3)
586 681740458 : s = zin(2, j, nin3)
587 681740458 : r3 = r*cr3 - s*ci3
588 681740458 : s3 = r*ci3 + s*cr3
589 681740458 : r = zin(1, j, nin4)
590 681740458 : s = zin(2, j, nin4)
591 681740458 : r4 = r*cr4 - s*ci4
592 681740458 : s4 = r*ci4 + s*cr4
593 681740458 : r = r1 + r3
594 681740458 : s = r2 + r4
595 681740458 : zout(1, j, nout1) = r + s
596 681740458 : zout(1, j, nout3) = r - s
597 681740458 : r = r1 - r3
598 681740458 : s = s2 - s4
599 681740458 : zout(1, j, nout2) = r - s
600 681740458 : zout(1, j, nout4) = r + s
601 681740458 : r = s1 + s3
602 681740458 : s = s2 + s4
603 681740458 : zout(2, j, nout1) = r + s
604 681740458 : zout(2, j, nout3) = r - s
605 681740458 : r = s1 - s3
606 681740458 : s = r2 - r4
607 681740458 : zout(2, j, nout2) = r + s
608 717709306 : zout(2, j, nout4) = r - s
609 : END DO; END DO
610 : END IF
611 2741866 : 4000 CONTINUE
612 : ELSE
613 2612281 : ia = 1
614 2612281 : nin1 = ia - after
615 2612281 : nout1 = ia - atn
616 22370611 : DO ib = 1, before
617 19758330 : nin1 = nin1 + after
618 19758330 : nin2 = nin1 + atb
619 19758330 : nin3 = nin2 + atb
620 19758330 : nin4 = nin3 + atb
621 19758330 : nout1 = nout1 + atn
622 19758330 : nout2 = nout1 + after
623 19758330 : nout3 = nout2 + after
624 19758330 : nout4 = nout3 + after
625 407918055 : DO j = 1, nfft
626 385547444 : r1 = zin(1, j, nin1)
627 385547444 : s1 = zin(2, j, nin1)
628 385547444 : r2 = zin(1, j, nin2)
629 385547444 : s2 = zin(2, j, nin2)
630 385547444 : r3 = zin(1, j, nin3)
631 385547444 : s3 = zin(2, j, nin3)
632 385547444 : r4 = zin(1, j, nin4)
633 385547444 : s4 = zin(2, j, nin4)
634 385547444 : r = r1 + r3
635 385547444 : s = r2 + r4
636 385547444 : zout(1, j, nout1) = r + s
637 385547444 : zout(1, j, nout3) = r - s
638 385547444 : r = r1 - r3
639 385547444 : s = s2 - s4
640 385547444 : zout(1, j, nout2) = r + s
641 385547444 : zout(1, j, nout4) = r - s
642 385547444 : r = s1 + s3
643 385547444 : s = s2 + s4
644 385547444 : zout(2, j, nout1) = r + s
645 385547444 : zout(2, j, nout3) = r - s
646 385547444 : r = s1 - s3
647 385547444 : s = r2 - r4
648 385547444 : zout(2, j, nout2) = r - s
649 405305774 : zout(2, j, nout4) = r + s
650 : END DO; END DO
651 26341888 : DO 4100, ia = 2, after
652 23729607 : ias = ia - 1
653 23729607 : IF (2*ias .EQ. after) THEN
654 1084533 : nin1 = ia - after
655 1084533 : nout1 = ia - atn
656 2504256 : DO ib = 1, before
657 1419723 : nin1 = nin1 + after
658 1419723 : nin2 = nin1 + atb
659 1419723 : nin3 = nin2 + atb
660 1419723 : nin4 = nin3 + atb
661 1419723 : nout1 = nout1 + atn
662 1419723 : nout2 = nout1 + after
663 1419723 : nout3 = nout2 + after
664 1419723 : nout4 = nout3 + after
665 29977430 : DO j = 1, nfft
666 27473174 : r1 = zin(1, j, nin1)
667 27473174 : s1 = zin(2, j, nin1)
668 27473174 : r = zin(1, j, nin2)
669 27473174 : s = zin(2, j, nin2)
670 27473174 : r2 = (r + s)*rt2i
671 27473174 : s2 = (s - r)*rt2i
672 27473174 : r3 = zin(2, j, nin3)
673 27473174 : s3 = zin(1, j, nin3)
674 27473174 : r = zin(1, j, nin4)
675 27473174 : s = zin(2, j, nin4)
676 27473174 : r4 = (s - r)*rt2i
677 27473174 : s4 = (r + s)*rt2i
678 27473174 : r = r1 + r3
679 27473174 : s = r2 + r4
680 27473174 : zout(1, j, nout1) = r + s
681 27473174 : zout(1, j, nout3) = r - s
682 27473174 : r = r1 - r3
683 27473174 : s = s2 + s4
684 27473174 : zout(1, j, nout2) = r + s
685 27473174 : zout(1, j, nout4) = r - s
686 27473174 : r = s1 - s3
687 27473174 : s = s2 - s4
688 27473174 : zout(2, j, nout1) = r + s
689 27473174 : zout(2, j, nout3) = r - s
690 27473174 : r = s1 + s3
691 27473174 : s = r2 - r4
692 27473174 : zout(2, j, nout2) = r - s
693 28892897 : zout(2, j, nout4) = r + s
694 : END DO; END DO
695 : ELSE
696 22645074 : itt = ias*before
697 22645074 : itrig = itt + 1
698 22645074 : cr2 = trig(1, itrig)
699 22645074 : ci2 = trig(2, itrig)
700 22645074 : itrig = itrig + itt
701 22645074 : cr3 = trig(1, itrig)
702 22645074 : ci3 = trig(2, itrig)
703 22645074 : itrig = itrig + itt
704 22645074 : cr4 = trig(1, itrig)
705 22645074 : ci4 = trig(2, itrig)
706 22645074 : nin1 = ia - after
707 22645074 : nout1 = ia - atn
708 56667120 : DO ib = 1, before
709 34022046 : nin1 = nin1 + after
710 34022046 : nin2 = nin1 + atb
711 34022046 : nin3 = nin2 + atb
712 34022046 : nin4 = nin3 + atb
713 34022046 : nout1 = nout1 + atn
714 34022046 : nout2 = nout1 + after
715 34022046 : nout3 = nout2 + after
716 34022046 : nout4 = nout3 + after
717 705115164 : DO j = 1, nfft
718 648448044 : r1 = zin(1, j, nin1)
719 648448044 : s1 = zin(2, j, nin1)
720 648448044 : r = zin(1, j, nin2)
721 648448044 : s = zin(2, j, nin2)
722 648448044 : r2 = r*cr2 - s*ci2
723 648448044 : s2 = r*ci2 + s*cr2
724 648448044 : r = zin(1, j, nin3)
725 648448044 : s = zin(2, j, nin3)
726 648448044 : r3 = r*cr3 - s*ci3
727 648448044 : s3 = r*ci3 + s*cr3
728 648448044 : r = zin(1, j, nin4)
729 648448044 : s = zin(2, j, nin4)
730 648448044 : r4 = r*cr4 - s*ci4
731 648448044 : s4 = r*ci4 + s*cr4
732 648448044 : r = r1 + r3
733 648448044 : s = r2 + r4
734 648448044 : zout(1, j, nout1) = r + s
735 648448044 : zout(1, j, nout3) = r - s
736 648448044 : r = r1 - r3
737 648448044 : s = s2 - s4
738 648448044 : zout(1, j, nout2) = r + s
739 648448044 : zout(1, j, nout4) = r - s
740 648448044 : r = s1 + s3
741 648448044 : s = s2 + s4
742 648448044 : zout(2, j, nout1) = r + s
743 648448044 : zout(2, j, nout3) = r - s
744 648448044 : r = s1 - s3
745 648448044 : s = r2 - r4
746 648448044 : zout(2, j, nout2) = r - s
747 682470090 : zout(2, j, nout4) = r + s
748 : END DO; END DO
749 : END IF
750 2612281 : 4100 CONTINUE
751 : END IF
752 : ELSE IF (now .EQ. 8) THEN
753 2237186 : IF (isign .EQ. -1) THEN
754 1079368 : ia = 1
755 1079368 : nin1 = ia - after
756 1079368 : nout1 = ia - atn
757 9533244 : DO ib = 1, before
758 8453876 : nin1 = nin1 + after
759 8453876 : nin2 = nin1 + atb
760 8453876 : nin3 = nin2 + atb
761 8453876 : nin4 = nin3 + atb
762 8453876 : nin5 = nin4 + atb
763 8453876 : nin6 = nin5 + atb
764 8453876 : nin7 = nin6 + atb
765 8453876 : nin8 = nin7 + atb
766 8453876 : nout1 = nout1 + atn
767 8453876 : nout2 = nout1 + after
768 8453876 : nout3 = nout2 + after
769 8453876 : nout4 = nout3 + after
770 8453876 : nout5 = nout4 + after
771 8453876 : nout6 = nout5 + after
772 8453876 : nout7 = nout6 + after
773 8453876 : nout8 = nout7 + after
774 173667136 : DO j = 1, nfft
775 164133892 : r1 = zin(1, j, nin1)
776 164133892 : s1 = zin(2, j, nin1)
777 164133892 : r2 = zin(1, j, nin2)
778 164133892 : s2 = zin(2, j, nin2)
779 164133892 : r3 = zin(1, j, nin3)
780 164133892 : s3 = zin(2, j, nin3)
781 164133892 : r4 = zin(1, j, nin4)
782 164133892 : s4 = zin(2, j, nin4)
783 164133892 : r5 = zin(1, j, nin5)
784 164133892 : s5 = zin(2, j, nin5)
785 164133892 : r6 = zin(1, j, nin6)
786 164133892 : s6 = zin(2, j, nin6)
787 164133892 : r7 = zin(1, j, nin7)
788 164133892 : s7 = zin(2, j, nin7)
789 164133892 : r8 = zin(1, j, nin8)
790 164133892 : s8 = zin(2, j, nin8)
791 164133892 : r = r1 + r5
792 164133892 : s = r3 + r7
793 164133892 : ap = r + s
794 164133892 : am = r - s
795 164133892 : r = r2 + r6
796 164133892 : s = r4 + r8
797 164133892 : bp = r + s
798 164133892 : bm = r - s
799 164133892 : r = s1 + s5
800 164133892 : s = s3 + s7
801 164133892 : cp = r + s
802 164133892 : cm = r - s
803 164133892 : r = s2 + s6
804 164133892 : s = s4 + s8
805 164133892 : dpp = r + s
806 164133892 : dm = r - s
807 164133892 : zout(1, j, nout1) = ap + bp
808 164133892 : zout(2, j, nout1) = cp + dpp
809 164133892 : zout(1, j, nout5) = ap - bp
810 164133892 : zout(2, j, nout5) = cp - dpp
811 164133892 : zout(1, j, nout3) = am + dm
812 164133892 : zout(2, j, nout3) = cm - bm
813 164133892 : zout(1, j, nout7) = am - dm
814 164133892 : zout(2, j, nout7) = cm + bm
815 164133892 : r = r1 - r5
816 164133892 : s = s3 - s7
817 164133892 : ap = r + s
818 164133892 : am = r - s
819 164133892 : r = s1 - s5
820 164133892 : s = r3 - r7
821 164133892 : bp = r + s
822 164133892 : bm = r - s
823 164133892 : r = s4 - s8
824 164133892 : s = r2 - r6
825 164133892 : cp = r + s
826 164133892 : cm = r - s
827 164133892 : r = s2 - s6
828 164133892 : s = r4 - r8
829 164133892 : dpp = r + s
830 164133892 : dm = r - s
831 164133892 : r = (cp + dm)*rt2i
832 164133892 : s = (dm - cp)*rt2i
833 164133892 : cp = (cm + dpp)*rt2i
834 164133892 : dpp = (cm - dpp)*rt2i
835 164133892 : zout(1, j, nout2) = ap + r
836 164133892 : zout(2, j, nout2) = bm + s
837 164133892 : zout(1, j, nout6) = ap - r
838 164133892 : zout(2, j, nout6) = bm - s
839 164133892 : zout(1, j, nout4) = am + cp
840 164133892 : zout(2, j, nout4) = bp + dpp
841 164133892 : zout(1, j, nout8) = am - cp
842 172587768 : zout(2, j, nout8) = bp - dpp
843 : END DO; END DO
844 2834219 : DO 8000, ia = 2, after
845 1754851 : ias = ia - 1
846 1754851 : itt = ias*before
847 1754851 : itrig = itt + 1
848 1754851 : cr2 = trig(1, itrig)
849 1754851 : ci2 = trig(2, itrig)
850 1754851 : itrig = itrig + itt
851 1754851 : cr3 = trig(1, itrig)
852 1754851 : ci3 = trig(2, itrig)
853 1754851 : itrig = itrig + itt
854 1754851 : cr4 = trig(1, itrig)
855 1754851 : ci4 = trig(2, itrig)
856 1754851 : itrig = itrig + itt
857 1754851 : cr5 = trig(1, itrig)
858 1754851 : ci5 = trig(2, itrig)
859 1754851 : itrig = itrig + itt
860 1754851 : cr6 = trig(1, itrig)
861 1754851 : ci6 = trig(2, itrig)
862 1754851 : itrig = itrig + itt
863 1754851 : cr7 = trig(1, itrig)
864 1754851 : ci7 = trig(2, itrig)
865 1754851 : itrig = itrig + itt
866 1754851 : cr8 = trig(1, itrig)
867 1754851 : ci8 = trig(2, itrig)
868 1754851 : nin1 = ia - after
869 1754851 : nout1 = ia - atn
870 6331612 : DO ib = 1, before
871 4576761 : nin1 = nin1 + after
872 4576761 : nin2 = nin1 + atb
873 4576761 : nin3 = nin2 + atb
874 4576761 : nin4 = nin3 + atb
875 4576761 : nin5 = nin4 + atb
876 4576761 : nin6 = nin5 + atb
877 4576761 : nin7 = nin6 + atb
878 4576761 : nin8 = nin7 + atb
879 4576761 : nout1 = nout1 + atn
880 4576761 : nout2 = nout1 + after
881 4576761 : nout3 = nout2 + after
882 4576761 : nout4 = nout3 + after
883 4576761 : nout5 = nout4 + after
884 4576761 : nout6 = nout5 + after
885 4576761 : nout7 = nout6 + after
886 4576761 : nout8 = nout7 + after
887 69129844 : DO j = 1, nfft
888 62798232 : r1 = zin(1, j, nin1)
889 62798232 : s1 = zin(2, j, nin1)
890 62798232 : r = zin(1, j, nin2)
891 62798232 : s = zin(2, j, nin2)
892 62798232 : r2 = r*cr2 - s*ci2
893 62798232 : s2 = r*ci2 + s*cr2
894 62798232 : r = zin(1, j, nin3)
895 62798232 : s = zin(2, j, nin3)
896 62798232 : r3 = r*cr3 - s*ci3
897 62798232 : s3 = r*ci3 + s*cr3
898 62798232 : r = zin(1, j, nin4)
899 62798232 : s = zin(2, j, nin4)
900 62798232 : r4 = r*cr4 - s*ci4
901 62798232 : s4 = r*ci4 + s*cr4
902 62798232 : r = zin(1, j, nin5)
903 62798232 : s = zin(2, j, nin5)
904 62798232 : r5 = r*cr5 - s*ci5
905 62798232 : s5 = r*ci5 + s*cr5
906 62798232 : r = zin(1, j, nin6)
907 62798232 : s = zin(2, j, nin6)
908 62798232 : r6 = r*cr6 - s*ci6
909 62798232 : s6 = r*ci6 + s*cr6
910 62798232 : r = zin(1, j, nin7)
911 62798232 : s = zin(2, j, nin7)
912 62798232 : r7 = r*cr7 - s*ci7
913 62798232 : s7 = r*ci7 + s*cr7
914 62798232 : r = zin(1, j, nin8)
915 62798232 : s = zin(2, j, nin8)
916 62798232 : r8 = r*cr8 - s*ci8
917 62798232 : s8 = r*ci8 + s*cr8
918 62798232 : r = r1 + r5
919 62798232 : s = r3 + r7
920 62798232 : ap = r + s
921 62798232 : am = r - s
922 62798232 : r = r2 + r6
923 62798232 : s = r4 + r8
924 62798232 : bp = r + s
925 62798232 : bm = r - s
926 62798232 : r = s1 + s5
927 62798232 : s = s3 + s7
928 62798232 : cp = r + s
929 62798232 : cm = r - s
930 62798232 : r = s2 + s6
931 62798232 : s = s4 + s8
932 62798232 : dpp = r + s
933 62798232 : dm = r - s
934 62798232 : zout(1, j, nout1) = ap + bp
935 62798232 : zout(2, j, nout1) = cp + dpp
936 62798232 : zout(1, j, nout5) = ap - bp
937 62798232 : zout(2, j, nout5) = cp - dpp
938 62798232 : zout(1, j, nout3) = am + dm
939 62798232 : zout(2, j, nout3) = cm - bm
940 62798232 : zout(1, j, nout7) = am - dm
941 62798232 : zout(2, j, nout7) = cm + bm
942 62798232 : r = r1 - r5
943 62798232 : s = s3 - s7
944 62798232 : ap = r + s
945 62798232 : am = r - s
946 62798232 : r = s1 - s5
947 62798232 : s = r3 - r7
948 62798232 : bp = r + s
949 62798232 : bm = r - s
950 62798232 : r = s4 - s8
951 62798232 : s = r2 - r6
952 62798232 : cp = r + s
953 62798232 : cm = r - s
954 62798232 : r = s2 - s6
955 62798232 : s = r4 - r8
956 62798232 : dpp = r + s
957 62798232 : dm = r - s
958 62798232 : r = (cp + dm)*rt2i
959 62798232 : s = (dm - cp)*rt2i
960 62798232 : cp = (cm + dpp)*rt2i
961 62798232 : dpp = (cm - dpp)*rt2i
962 62798232 : zout(1, j, nout2) = ap + r
963 62798232 : zout(2, j, nout2) = bm + s
964 62798232 : zout(1, j, nout6) = ap - r
965 62798232 : zout(2, j, nout6) = bm - s
966 62798232 : zout(1, j, nout4) = am + cp
967 62798232 : zout(2, j, nout4) = bp + dpp
968 62798232 : zout(1, j, nout8) = am - cp
969 67374993 : zout(2, j, nout8) = bp - dpp
970 : END DO; END DO
971 1079368 : 8000 CONTINUE
972 :
973 : ELSE
974 1157818 : ia = 1
975 1157818 : nin1 = ia - after
976 1157818 : nout1 = ia - atn
977 10342779 : DO ib = 1, before
978 9184961 : nin1 = nin1 + after
979 9184961 : nin2 = nin1 + atb
980 9184961 : nin3 = nin2 + atb
981 9184961 : nin4 = nin3 + atb
982 9184961 : nin5 = nin4 + atb
983 9184961 : nin6 = nin5 + atb
984 9184961 : nin7 = nin6 + atb
985 9184961 : nin8 = nin7 + atb
986 9184961 : nout1 = nout1 + atn
987 9184961 : nout2 = nout1 + after
988 9184961 : nout3 = nout2 + after
989 9184961 : nout4 = nout3 + after
990 9184961 : nout5 = nout4 + after
991 9184961 : nout6 = nout5 + after
992 9184961 : nout7 = nout6 + after
993 9184961 : nout8 = nout7 + after
994 187758499 : DO j = 1, nfft
995 177415720 : r1 = zin(1, j, nin1)
996 177415720 : s1 = zin(2, j, nin1)
997 177415720 : r2 = zin(1, j, nin2)
998 177415720 : s2 = zin(2, j, nin2)
999 177415720 : r3 = zin(1, j, nin3)
1000 177415720 : s3 = zin(2, j, nin3)
1001 177415720 : r4 = zin(1, j, nin4)
1002 177415720 : s4 = zin(2, j, nin4)
1003 177415720 : r5 = zin(1, j, nin5)
1004 177415720 : s5 = zin(2, j, nin5)
1005 177415720 : r6 = zin(1, j, nin6)
1006 177415720 : s6 = zin(2, j, nin6)
1007 177415720 : r7 = zin(1, j, nin7)
1008 177415720 : s7 = zin(2, j, nin7)
1009 177415720 : r8 = zin(1, j, nin8)
1010 177415720 : s8 = zin(2, j, nin8)
1011 177415720 : r = r1 + r5
1012 177415720 : s = r3 + r7
1013 177415720 : ap = r + s
1014 177415720 : am = r - s
1015 177415720 : r = r2 + r6
1016 177415720 : s = r4 + r8
1017 177415720 : bp = r + s
1018 177415720 : bm = r - s
1019 177415720 : r = s1 + s5
1020 177415720 : s = s3 + s7
1021 177415720 : cp = r + s
1022 177415720 : cm = r - s
1023 177415720 : r = s2 + s6
1024 177415720 : s = s4 + s8
1025 177415720 : dpp = r + s
1026 177415720 : dm = r - s
1027 177415720 : zout(1, j, nout1) = ap + bp
1028 177415720 : zout(2, j, nout1) = cp + dpp
1029 177415720 : zout(1, j, nout5) = ap - bp
1030 177415720 : zout(2, j, nout5) = cp - dpp
1031 177415720 : zout(1, j, nout3) = am - dm
1032 177415720 : zout(2, j, nout3) = cm + bm
1033 177415720 : zout(1, j, nout7) = am + dm
1034 177415720 : zout(2, j, nout7) = cm - bm
1035 177415720 : r = r1 - r5
1036 177415720 : s = -s3 + s7
1037 177415720 : ap = r + s
1038 177415720 : am = r - s
1039 177415720 : r = s1 - s5
1040 177415720 : s = r7 - r3
1041 177415720 : bp = r + s
1042 177415720 : bm = r - s
1043 177415720 : r = -s4 + s8
1044 177415720 : s = r2 - r6
1045 177415720 : cp = r + s
1046 177415720 : cm = r - s
1047 177415720 : r = -s2 + s6
1048 177415720 : s = r4 - r8
1049 177415720 : dpp = r + s
1050 177415720 : dm = r - s
1051 177415720 : r = (cp + dm)*rt2i
1052 177415720 : s = (cp - dm)*rt2i
1053 177415720 : cp = (cm + dpp)*rt2i
1054 177415720 : dpp = (dpp - cm)*rt2i
1055 177415720 : zout(1, j, nout2) = ap + r
1056 177415720 : zout(2, j, nout2) = bm + s
1057 177415720 : zout(1, j, nout6) = ap - r
1058 177415720 : zout(2, j, nout6) = bm - s
1059 177415720 : zout(1, j, nout4) = am + cp
1060 177415720 : zout(2, j, nout4) = bp + dpp
1061 177415720 : zout(1, j, nout8) = am - cp
1062 186600681 : zout(2, j, nout8) = bp - dpp
1063 : END DO; END DO
1064 :
1065 3041769 : DO 8001, ia = 2, after
1066 1883951 : ias = ia - 1
1067 1883951 : itt = ias*before
1068 1883951 : itrig = itt + 1
1069 1883951 : cr2 = trig(1, itrig)
1070 1883951 : ci2 = trig(2, itrig)
1071 1883951 : itrig = itrig + itt
1072 1883951 : cr3 = trig(1, itrig)
1073 1883951 : ci3 = trig(2, itrig)
1074 1883951 : itrig = itrig + itt
1075 1883951 : cr4 = trig(1, itrig)
1076 1883951 : ci4 = trig(2, itrig)
1077 1883951 : itrig = itrig + itt
1078 1883951 : cr5 = trig(1, itrig)
1079 1883951 : ci5 = trig(2, itrig)
1080 1883951 : itrig = itrig + itt
1081 1883951 : cr6 = trig(1, itrig)
1082 1883951 : ci6 = trig(2, itrig)
1083 1883951 : itrig = itrig + itt
1084 1883951 : cr7 = trig(1, itrig)
1085 1883951 : ci7 = trig(2, itrig)
1086 1883951 : itrig = itrig + itt
1087 1883951 : cr8 = trig(1, itrig)
1088 1883951 : ci8 = trig(2, itrig)
1089 1883951 : nin1 = ia - after
1090 1883951 : nout1 = ia - atn
1091 6834243 : DO ib = 1, before
1092 4950292 : nin1 = nin1 + after
1093 4950292 : nin2 = nin1 + atb
1094 4950292 : nin3 = nin2 + atb
1095 4950292 : nin4 = nin3 + atb
1096 4950292 : nin5 = nin4 + atb
1097 4950292 : nin6 = nin5 + atb
1098 4950292 : nin7 = nin6 + atb
1099 4950292 : nin8 = nin7 + atb
1100 4950292 : nout1 = nout1 + atn
1101 4950292 : nout2 = nout1 + after
1102 4950292 : nout3 = nout2 + after
1103 4950292 : nout4 = nout3 + after
1104 4950292 : nout5 = nout4 + after
1105 4950292 : nout6 = nout5 + after
1106 4950292 : nout7 = nout6 + after
1107 4950292 : nout8 = nout7 + after
1108 74003954 : DO j = 1, nfft
1109 67169711 : r1 = zin(1, j, nin1)
1110 67169711 : s1 = zin(2, j, nin1)
1111 67169711 : r = zin(1, j, nin2)
1112 67169711 : s = zin(2, j, nin2)
1113 67169711 : r2 = r*cr2 - s*ci2
1114 67169711 : s2 = r*ci2 + s*cr2
1115 67169711 : r = zin(1, j, nin3)
1116 67169711 : s = zin(2, j, nin3)
1117 67169711 : r3 = r*cr3 - s*ci3
1118 67169711 : s3 = r*ci3 + s*cr3
1119 67169711 : r = zin(1, j, nin4)
1120 67169711 : s = zin(2, j, nin4)
1121 67169711 : r4 = r*cr4 - s*ci4
1122 67169711 : s4 = r*ci4 + s*cr4
1123 67169711 : r = zin(1, j, nin5)
1124 67169711 : s = zin(2, j, nin5)
1125 67169711 : r5 = r*cr5 - s*ci5
1126 67169711 : s5 = r*ci5 + s*cr5
1127 67169711 : r = zin(1, j, nin6)
1128 67169711 : s = zin(2, j, nin6)
1129 67169711 : r6 = r*cr6 - s*ci6
1130 67169711 : s6 = r*ci6 + s*cr6
1131 67169711 : r = zin(1, j, nin7)
1132 67169711 : s = zin(2, j, nin7)
1133 67169711 : r7 = r*cr7 - s*ci7
1134 67169711 : s7 = r*ci7 + s*cr7
1135 67169711 : r = zin(1, j, nin8)
1136 67169711 : s = zin(2, j, nin8)
1137 67169711 : r8 = r*cr8 - s*ci8
1138 67169711 : s8 = r*ci8 + s*cr8
1139 67169711 : r = r1 + r5
1140 67169711 : s = r3 + r7
1141 67169711 : ap = r + s
1142 67169711 : am = r - s
1143 67169711 : r = r2 + r6
1144 67169711 : s = r4 + r8
1145 67169711 : bp = r + s
1146 67169711 : bm = r - s
1147 67169711 : r = s1 + s5
1148 67169711 : s = s3 + s7
1149 67169711 : cp = r + s
1150 67169711 : cm = r - s
1151 67169711 : r = s2 + s6
1152 67169711 : s = s4 + s8
1153 67169711 : dpp = r + s
1154 67169711 : dm = r - s
1155 67169711 : zout(1, j, nout1) = ap + bp
1156 67169711 : zout(2, j, nout1) = cp + dpp
1157 67169711 : zout(1, j, nout5) = ap - bp
1158 67169711 : zout(2, j, nout5) = cp - dpp
1159 67169711 : zout(1, j, nout3) = am - dm
1160 67169711 : zout(2, j, nout3) = cm + bm
1161 67169711 : zout(1, j, nout7) = am + dm
1162 67169711 : zout(2, j, nout7) = cm - bm
1163 67169711 : r = r1 - r5
1164 67169711 : s = -s3 + s7
1165 67169711 : ap = r + s
1166 67169711 : am = r - s
1167 67169711 : r = s1 - s5
1168 67169711 : s = r7 - r3
1169 67169711 : bp = r + s
1170 67169711 : bm = r - s
1171 67169711 : r = -s4 + s8
1172 67169711 : s = r2 - r6
1173 67169711 : cp = r + s
1174 67169711 : cm = r - s
1175 67169711 : r = -s2 + s6
1176 67169711 : s = r4 - r8
1177 67169711 : dpp = r + s
1178 67169711 : dm = r - s
1179 67169711 : r = (cp + dm)*rt2i
1180 67169711 : s = (cp - dm)*rt2i
1181 67169711 : cp = (cm + dpp)*rt2i
1182 67169711 : dpp = (dpp - cm)*rt2i
1183 67169711 : zout(1, j, nout2) = ap + r
1184 67169711 : zout(2, j, nout2) = bm + s
1185 67169711 : zout(1, j, nout6) = ap - r
1186 67169711 : zout(2, j, nout6) = bm - s
1187 67169711 : zout(1, j, nout4) = am + cp
1188 67169711 : zout(2, j, nout4) = bp + dpp
1189 67169711 : zout(1, j, nout8) = am - cp
1190 72120003 : zout(2, j, nout8) = bp - dpp
1191 : END DO; END DO
1192 1157818 : 8001 CONTINUE
1193 :
1194 : END IF
1195 : ELSE IF (now .EQ. 3) THEN
1196 : ! .5_dp*sqrt(3._dp)
1197 8450329 : bb = isign*0.8660254037844387_dp
1198 8450329 : ia = 1
1199 8450329 : nin1 = ia - after
1200 8450329 : nout1 = ia - atn
1201 30614204 : DO ib = 1, before
1202 22163875 : nin1 = nin1 + after
1203 22163875 : nin2 = nin1 + atb
1204 22163875 : nin3 = nin2 + atb
1205 22163875 : nout1 = nout1 + atn
1206 22163875 : nout2 = nout1 + after
1207 22163875 : nout3 = nout2 + after
1208 463417593 : DO j = 1, nfft
1209 432803389 : r1 = zin(1, j, nin1)
1210 432803389 : s1 = zin(2, j, nin1)
1211 432803389 : r2 = zin(1, j, nin2)
1212 432803389 : s2 = zin(2, j, nin2)
1213 432803389 : r3 = zin(1, j, nin3)
1214 432803389 : s3 = zin(2, j, nin3)
1215 432803389 : r = r2 + r3
1216 432803389 : s = s2 + s3
1217 432803389 : zout(1, j, nout1) = r + r1
1218 432803389 : zout(2, j, nout1) = s + s1
1219 432803389 : r1 = r1 - .5_dp*r
1220 432803389 : s1 = s1 - .5_dp*s
1221 432803389 : r2 = bb*(r2 - r3)
1222 432803389 : s2 = bb*(s2 - s3)
1223 432803389 : zout(1, j, nout2) = r1 - s2
1224 432803389 : zout(2, j, nout2) = s1 + r2
1225 432803389 : zout(1, j, nout3) = r1 + s2
1226 454967264 : zout(2, j, nout3) = s1 - r2
1227 : END DO; END DO
1228 151837674 : DO 3000, ia = 2, after
1229 143387345 : ias = ia - 1
1230 143387345 : IF (4*ias .EQ. 3*after) THEN
1231 5408228 : IF (isign .EQ. 1) THEN
1232 2773825 : nin1 = ia - after
1233 2773825 : nout1 = ia - atn
1234 11309426 : DO ib = 1, before
1235 8535601 : nin1 = nin1 + after
1236 8535601 : nin2 = nin1 + atb
1237 8535601 : nin3 = nin2 + atb
1238 8535601 : nout1 = nout1 + atn
1239 8535601 : nout2 = nout1 + after
1240 8535601 : nout3 = nout2 + after
1241 175107119 : DO j = 1, nfft
1242 163797693 : r1 = zin(1, j, nin1)
1243 163797693 : s1 = zin(2, j, nin1)
1244 163797693 : r2 = zin(2, j, nin2)
1245 163797693 : s2 = zin(1, j, nin2)
1246 163797693 : r3 = zin(1, j, nin3)
1247 163797693 : s3 = zin(2, j, nin3)
1248 163797693 : r = r3 + r2
1249 163797693 : s = s2 - s3
1250 163797693 : zout(1, j, nout1) = r1 - r
1251 163797693 : zout(2, j, nout1) = s + s1
1252 163797693 : r1 = r1 + .5_dp*r
1253 163797693 : s1 = s1 - .5_dp*s
1254 163797693 : r2 = bb*(r2 - r3)
1255 163797693 : s2 = bb*(s2 + s3)
1256 163797693 : zout(1, j, nout2) = r1 - s2
1257 163797693 : zout(2, j, nout2) = s1 - r2
1258 163797693 : zout(1, j, nout3) = r1 + s2
1259 172333294 : zout(2, j, nout3) = s1 + r2
1260 : END DO; END DO
1261 : ELSE
1262 2634403 : nin1 = ia - after
1263 2634403 : nout1 = ia - atn
1264 10725450 : DO ib = 1, before
1265 8091047 : nin1 = nin1 + after
1266 8091047 : nin2 = nin1 + atb
1267 8091047 : nin3 = nin2 + atb
1268 8091047 : nout1 = nout1 + atn
1269 8091047 : nout2 = nout1 + after
1270 8091047 : nout3 = nout2 + after
1271 166621926 : DO j = 1, nfft
1272 155896476 : r1 = zin(1, j, nin1)
1273 155896476 : s1 = zin(2, j, nin1)
1274 155896476 : r2 = zin(2, j, nin2)
1275 155896476 : s2 = zin(1, j, nin2)
1276 155896476 : r3 = zin(1, j, nin3)
1277 155896476 : s3 = zin(2, j, nin3)
1278 155896476 : r = r2 - r3
1279 155896476 : s = s2 + s3
1280 155896476 : zout(1, j, nout1) = r + r1
1281 155896476 : zout(2, j, nout1) = s1 - s
1282 155896476 : r1 = r1 - .5_dp*r
1283 155896476 : s1 = s1 + .5_dp*s
1284 155896476 : r2 = bb*(r2 + r3)
1285 155896476 : s2 = bb*(s2 - s3)
1286 155896476 : zout(1, j, nout2) = r1 + s2
1287 155896476 : zout(2, j, nout2) = s1 + r2
1288 155896476 : zout(1, j, nout3) = r1 - s2
1289 163987523 : zout(2, j, nout3) = s1 - r2
1290 : END DO; END DO
1291 : END IF
1292 137979117 : ELSE IF (8*ias .EQ. 3*after) THEN
1293 1795450 : IF (isign .EQ. 1) THEN
1294 920066 : nin1 = ia - after
1295 920066 : nout1 = ia - atn
1296 2232834 : DO ib = 1, before
1297 1312768 : nin1 = nin1 + after
1298 1312768 : nin2 = nin1 + atb
1299 1312768 : nin3 = nin2 + atb
1300 1312768 : nout1 = nout1 + atn
1301 1312768 : nout2 = nout1 + after
1302 1312768 : nout3 = nout2 + after
1303 28303939 : DO j = 1, nfft
1304 26071105 : r1 = zin(1, j, nin1)
1305 26071105 : s1 = zin(2, j, nin1)
1306 26071105 : r = zin(1, j, nin2)
1307 26071105 : s = zin(2, j, nin2)
1308 26071105 : r2 = (r - s)*rt2i
1309 26071105 : s2 = (r + s)*rt2i
1310 26071105 : r3 = zin(2, j, nin3)
1311 26071105 : s3 = zin(1, j, nin3)
1312 26071105 : r = r2 - r3
1313 26071105 : s = s2 + s3
1314 26071105 : zout(1, j, nout1) = r + r1
1315 26071105 : zout(2, j, nout1) = s + s1
1316 26071105 : r1 = r1 - .5_dp*r
1317 26071105 : s1 = s1 - .5_dp*s
1318 26071105 : r2 = bb*(r2 + r3)
1319 26071105 : s2 = bb*(s2 - s3)
1320 26071105 : zout(1, j, nout2) = r1 - s2
1321 26071105 : zout(2, j, nout2) = s1 + r2
1322 26071105 : zout(1, j, nout3) = r1 + s2
1323 27383873 : zout(2, j, nout3) = s1 - r2
1324 : END DO; END DO
1325 : ELSE
1326 875384 : nin1 = ia - after
1327 875384 : nout1 = ia - atn
1328 2121258 : DO ib = 1, before
1329 1245874 : nin1 = nin1 + after
1330 1245874 : nin2 = nin1 + atb
1331 1245874 : nin3 = nin2 + atb
1332 1245874 : nout1 = nout1 + atn
1333 1245874 : nout2 = nout1 + after
1334 1245874 : nout3 = nout2 + after
1335 26771724 : DO j = 1, nfft
1336 24650466 : r1 = zin(1, j, nin1)
1337 24650466 : s1 = zin(2, j, nin1)
1338 24650466 : r = zin(1, j, nin2)
1339 24650466 : s = zin(2, j, nin2)
1340 24650466 : r2 = (r + s)*rt2i
1341 24650466 : s2 = (s - r)*rt2i
1342 24650466 : r3 = zin(2, j, nin3)
1343 24650466 : s3 = zin(1, j, nin3)
1344 24650466 : r = r2 + r3
1345 24650466 : s = s2 - s3
1346 24650466 : zout(1, j, nout1) = r + r1
1347 24650466 : zout(2, j, nout1) = s + s1
1348 24650466 : r1 = r1 - .5_dp*r
1349 24650466 : s1 = s1 - .5_dp*s
1350 24650466 : r2 = bb*(r2 - r3)
1351 24650466 : s2 = bb*(s2 + s3)
1352 24650466 : zout(1, j, nout2) = r1 - s2
1353 24650466 : zout(2, j, nout2) = s1 + r2
1354 24650466 : zout(1, j, nout3) = r1 + s2
1355 25896340 : zout(2, j, nout3) = s1 - r2
1356 : END DO; END DO
1357 : END IF
1358 : ELSE
1359 136183667 : itt = ias*before
1360 136183667 : itrig = itt + 1
1361 136183667 : cr2 = trig(1, itrig)
1362 136183667 : ci2 = trig(2, itrig)
1363 136183667 : itrig = itrig + itt
1364 136183667 : cr3 = trig(1, itrig)
1365 136183667 : ci3 = trig(2, itrig)
1366 136183667 : nin1 = ia - after
1367 136183667 : nout1 = ia - atn
1368 327856184 : DO ib = 1, before
1369 191672517 : nin1 = nin1 + after
1370 191672517 : nin2 = nin1 + atb
1371 191672517 : nin3 = nin2 + atb
1372 191672517 : nout1 = nout1 + atn
1373 191672517 : nout2 = nout1 + after
1374 191672517 : nout3 = nout2 + after
1375 3838245499 : DO j = 1, nfft
1376 3510389315 : r1 = zin(1, j, nin1)
1377 3510389315 : s1 = zin(2, j, nin1)
1378 3510389315 : r = zin(1, j, nin2)
1379 3510389315 : s = zin(2, j, nin2)
1380 3510389315 : r2 = r*cr2 - s*ci2
1381 3510389315 : s2 = r*ci2 + s*cr2
1382 3510389315 : r = zin(1, j, nin3)
1383 3510389315 : s = zin(2, j, nin3)
1384 3510389315 : r3 = r*cr3 - s*ci3
1385 3510389315 : s3 = r*ci3 + s*cr3
1386 3510389315 : r = r2 + r3
1387 3510389315 : s = s2 + s3
1388 3510389315 : zout(1, j, nout1) = r + r1
1389 3510389315 : zout(2, j, nout1) = s + s1
1390 3510389315 : r1 = r1 - .5_dp*r
1391 3510389315 : s1 = s1 - .5_dp*s
1392 3510389315 : r2 = bb*(r2 - r3)
1393 3510389315 : s2 = bb*(s2 - s3)
1394 3510389315 : zout(1, j, nout2) = r1 - s2
1395 3510389315 : zout(2, j, nout2) = s1 + r2
1396 3510389315 : zout(1, j, nout3) = r1 + s2
1397 3702061832 : zout(2, j, nout3) = s1 - r2
1398 : END DO; END DO
1399 : END IF
1400 8450329 : 3000 CONTINUE
1401 : ELSE IF (now .EQ. 5) THEN
1402 : ! cos(2._dp*pi/5._dp)
1403 3304846 : cos2 = 0.3090169943749474_dp
1404 : ! cos(4._dp*pi/5._dp)
1405 3304846 : cos4 = -0.8090169943749474_dp
1406 : ! sin(2._dp*pi/5._dp)
1407 3304846 : sin2 = isign*0.9510565162951536_dp
1408 : ! sin(4._dp*pi/5._dp)
1409 3304846 : sin4 = isign*0.5877852522924731_dp
1410 3304846 : ia = 1
1411 3304846 : nin1 = ia - after
1412 3304846 : nout1 = ia - atn
1413 34105540 : DO ib = 1, before
1414 30800694 : nin1 = nin1 + after
1415 30800694 : nin2 = nin1 + atb
1416 30800694 : nin3 = nin2 + atb
1417 30800694 : nin4 = nin3 + atb
1418 30800694 : nin5 = nin4 + atb
1419 30800694 : nout1 = nout1 + atn
1420 30800694 : nout2 = nout1 + after
1421 30800694 : nout3 = nout2 + after
1422 30800694 : nout4 = nout3 + after
1423 30800694 : nout5 = nout4 + after
1424 654428141 : DO j = 1, nfft
1425 620322601 : r1 = zin(1, j, nin1)
1426 620322601 : s1 = zin(2, j, nin1)
1427 620322601 : r2 = zin(1, j, nin2)
1428 620322601 : s2 = zin(2, j, nin2)
1429 620322601 : r3 = zin(1, j, nin3)
1430 620322601 : s3 = zin(2, j, nin3)
1431 620322601 : r4 = zin(1, j, nin4)
1432 620322601 : s4 = zin(2, j, nin4)
1433 620322601 : r5 = zin(1, j, nin5)
1434 620322601 : s5 = zin(2, j, nin5)
1435 620322601 : r25 = r2 + r5
1436 620322601 : r34 = r3 + r4
1437 620322601 : s25 = s2 - s5
1438 620322601 : s34 = s3 - s4
1439 620322601 : zout(1, j, nout1) = r1 + r25 + r34
1440 620322601 : r = r1 + cos2*r25 + cos4*r34
1441 620322601 : s = sin2*s25 + sin4*s34
1442 620322601 : zout(1, j, nout2) = r - s
1443 620322601 : zout(1, j, nout5) = r + s
1444 620322601 : r = r1 + cos4*r25 + cos2*r34
1445 620322601 : s = sin4*s25 - sin2*s34
1446 620322601 : zout(1, j, nout3) = r - s
1447 620322601 : zout(1, j, nout4) = r + s
1448 620322601 : r25 = r2 - r5
1449 620322601 : r34 = r3 - r4
1450 620322601 : s25 = s2 + s5
1451 620322601 : s34 = s3 + s4
1452 620322601 : zout(2, j, nout1) = s1 + s25 + s34
1453 620322601 : r = s1 + cos2*s25 + cos4*s34
1454 620322601 : s = sin2*r25 + sin4*r34
1455 620322601 : zout(2, j, nout2) = r + s
1456 620322601 : zout(2, j, nout5) = r - s
1457 620322601 : r = s1 + cos4*s25 + cos2*s34
1458 620322601 : s = sin4*r25 - sin2*r34
1459 620322601 : zout(2, j, nout3) = r + s
1460 651123295 : zout(2, j, nout4) = r - s
1461 : END DO; END DO
1462 11399074 : DO 5000, ia = 2, after
1463 8094228 : ias = ia - 1
1464 8094228 : IF (8*ias .EQ. 5*after) THEN
1465 618264 : IF (isign .EQ. 1) THEN
1466 322186 : nin1 = ia - after
1467 322186 : nout1 = ia - atn
1468 944492 : DO ib = 1, before
1469 622306 : nin1 = nin1 + after
1470 622306 : nin2 = nin1 + atb
1471 622306 : nin3 = nin2 + atb
1472 622306 : nin4 = nin3 + atb
1473 622306 : nin5 = nin4 + atb
1474 622306 : nout1 = nout1 + atn
1475 622306 : nout2 = nout1 + after
1476 622306 : nout3 = nout2 + after
1477 622306 : nout4 = nout3 + after
1478 622306 : nout5 = nout4 + after
1479 14583879 : DO j = 1, nfft
1480 13639387 : r1 = zin(1, j, nin1)
1481 13639387 : s1 = zin(2, j, nin1)
1482 13639387 : r = zin(1, j, nin2)
1483 13639387 : s = zin(2, j, nin2)
1484 13639387 : r2 = (r - s)*rt2i
1485 13639387 : s2 = (r + s)*rt2i
1486 13639387 : r3 = zin(2, j, nin3)
1487 13639387 : s3 = zin(1, j, nin3)
1488 13639387 : r = zin(1, j, nin4)
1489 13639387 : s = zin(2, j, nin4)
1490 13639387 : r4 = (r + s)*rt2i
1491 13639387 : s4 = (r - s)*rt2i
1492 13639387 : r5 = zin(1, j, nin5)
1493 13639387 : s5 = zin(2, j, nin5)
1494 13639387 : r25 = r2 - r5
1495 13639387 : r34 = r3 + r4
1496 13639387 : s25 = s2 + s5
1497 13639387 : s34 = s3 - s4
1498 13639387 : zout(1, j, nout1) = r1 + r25 - r34
1499 13639387 : r = r1 + cos2*r25 - cos4*r34
1500 13639387 : s = sin2*s25 + sin4*s34
1501 13639387 : zout(1, j, nout2) = r - s
1502 13639387 : zout(1, j, nout5) = r + s
1503 13639387 : r = r1 + cos4*r25 - cos2*r34
1504 13639387 : s = sin4*s25 - sin2*s34
1505 13639387 : zout(1, j, nout3) = r - s
1506 13639387 : zout(1, j, nout4) = r + s
1507 13639387 : r25 = r2 + r5
1508 13639387 : r34 = r4 - r3
1509 13639387 : s25 = s2 - s5
1510 13639387 : s34 = s3 + s4
1511 13639387 : zout(2, j, nout1) = s1 + s25 + s34
1512 13639387 : r = s1 + cos2*s25 + cos4*s34
1513 13639387 : s = sin2*r25 + sin4*r34
1514 13639387 : zout(2, j, nout2) = r + s
1515 13639387 : zout(2, j, nout5) = r - s
1516 13639387 : r = s1 + cos4*s25 + cos2*s34
1517 13639387 : s = sin4*r25 - sin2*r34
1518 13639387 : zout(2, j, nout3) = r + s
1519 14261693 : zout(2, j, nout4) = r - s
1520 : END DO; END DO
1521 : ELSE
1522 296078 : nin1 = ia - after
1523 296078 : nout1 = ia - atn
1524 879100 : DO ib = 1, before
1525 583022 : nin1 = nin1 + after
1526 583022 : nin2 = nin1 + atb
1527 583022 : nin3 = nin2 + atb
1528 583022 : nin4 = nin3 + atb
1529 583022 : nin5 = nin4 + atb
1530 583022 : nout1 = nout1 + atn
1531 583022 : nout2 = nout1 + after
1532 583022 : nout3 = nout2 + after
1533 583022 : nout4 = nout3 + after
1534 583022 : nout5 = nout4 + after
1535 13439580 : DO j = 1, nfft
1536 12560480 : r1 = zin(1, j, nin1)
1537 12560480 : s1 = zin(2, j, nin1)
1538 12560480 : r = zin(1, j, nin2)
1539 12560480 : s = zin(2, j, nin2)
1540 12560480 : r2 = (r + s)*rt2i
1541 12560480 : s2 = (s - r)*rt2i
1542 12560480 : r3 = zin(2, j, nin3)
1543 12560480 : s3 = zin(1, j, nin3)
1544 12560480 : r = zin(1, j, nin4)
1545 12560480 : s = zin(2, j, nin4)
1546 12560480 : r4 = (s - r)*rt2i
1547 12560480 : s4 = (r + s)*rt2i
1548 12560480 : r5 = zin(1, j, nin5)
1549 12560480 : s5 = zin(2, j, nin5)
1550 12560480 : r25 = r2 - r5
1551 12560480 : r34 = r3 + r4
1552 12560480 : s25 = s2 + s5
1553 12560480 : s34 = s4 - s3
1554 12560480 : zout(1, j, nout1) = r1 + r25 + r34
1555 12560480 : r = r1 + cos2*r25 + cos4*r34
1556 12560480 : s = sin2*s25 + sin4*s34
1557 12560480 : zout(1, j, nout2) = r - s
1558 12560480 : zout(1, j, nout5) = r + s
1559 12560480 : r = r1 + cos4*r25 + cos2*r34
1560 12560480 : s = sin4*s25 - sin2*s34
1561 12560480 : zout(1, j, nout3) = r - s
1562 12560480 : zout(1, j, nout4) = r + s
1563 12560480 : r25 = r2 + r5
1564 12560480 : r34 = r3 - r4
1565 12560480 : s25 = s2 - s5
1566 12560480 : s34 = s3 + s4
1567 12560480 : zout(2, j, nout1) = s1 + s25 - s34
1568 12560480 : r = s1 + cos2*s25 - cos4*s34
1569 12560480 : s = sin2*r25 + sin4*r34
1570 12560480 : zout(2, j, nout2) = r + s
1571 12560480 : zout(2, j, nout5) = r - s
1572 12560480 : r = s1 + cos4*s25 - cos2*s34
1573 12560480 : s = sin4*r25 - sin2*r34
1574 12560480 : zout(2, j, nout3) = r + s
1575 13143502 : zout(2, j, nout4) = r - s
1576 : END DO; END DO
1577 : END IF
1578 : ELSE
1579 7475964 : ias = ia - 1
1580 7475964 : itt = ias*before
1581 7475964 : itrig = itt + 1
1582 7475964 : cr2 = trig(1, itrig)
1583 7475964 : ci2 = trig(2, itrig)
1584 7475964 : itrig = itrig + itt
1585 7475964 : cr3 = trig(1, itrig)
1586 7475964 : ci3 = trig(2, itrig)
1587 7475964 : itrig = itrig + itt
1588 7475964 : cr4 = trig(1, itrig)
1589 7475964 : ci4 = trig(2, itrig)
1590 7475964 : itrig = itrig + itt
1591 7475964 : cr5 = trig(1, itrig)
1592 7475964 : ci5 = trig(2, itrig)
1593 7475964 : nin1 = ia - after
1594 7475964 : nout1 = ia - atn
1595 24032472 : DO ib = 1, before
1596 16556508 : nin1 = nin1 + after
1597 16556508 : nin2 = nin1 + atb
1598 16556508 : nin3 = nin2 + atb
1599 16556508 : nin4 = nin3 + atb
1600 16556508 : nin5 = nin4 + atb
1601 16556508 : nout1 = nout1 + atn
1602 16556508 : nout2 = nout1 + after
1603 16556508 : nout3 = nout2 + after
1604 16556508 : nout4 = nout3 + after
1605 16556508 : nout5 = nout4 + after
1606 348427434 : DO j = 1, nfft
1607 324394962 : r1 = zin(1, j, nin1)
1608 324394962 : s1 = zin(2, j, nin1)
1609 324394962 : r = zin(1, j, nin2)
1610 324394962 : s = zin(2, j, nin2)
1611 324394962 : r2 = r*cr2 - s*ci2
1612 324394962 : s2 = r*ci2 + s*cr2
1613 324394962 : r = zin(1, j, nin3)
1614 324394962 : s = zin(2, j, nin3)
1615 324394962 : r3 = r*cr3 - s*ci3
1616 324394962 : s3 = r*ci3 + s*cr3
1617 324394962 : r = zin(1, j, nin4)
1618 324394962 : s = zin(2, j, nin4)
1619 324394962 : r4 = r*cr4 - s*ci4
1620 324394962 : s4 = r*ci4 + s*cr4
1621 324394962 : r = zin(1, j, nin5)
1622 324394962 : s = zin(2, j, nin5)
1623 324394962 : r5 = r*cr5 - s*ci5
1624 324394962 : s5 = r*ci5 + s*cr5
1625 324394962 : r25 = r2 + r5
1626 324394962 : r34 = r3 + r4
1627 324394962 : s25 = s2 - s5
1628 324394962 : s34 = s3 - s4
1629 324394962 : zout(1, j, nout1) = r1 + r25 + r34
1630 324394962 : r = r1 + cos2*r25 + cos4*r34
1631 324394962 : s = sin2*s25 + sin4*s34
1632 324394962 : zout(1, j, nout2) = r - s
1633 324394962 : zout(1, j, nout5) = r + s
1634 324394962 : r = r1 + cos4*r25 + cos2*r34
1635 324394962 : s = sin4*s25 - sin2*s34
1636 324394962 : zout(1, j, nout3) = r - s
1637 324394962 : zout(1, j, nout4) = r + s
1638 324394962 : r25 = r2 - r5
1639 324394962 : r34 = r3 - r4
1640 324394962 : s25 = s2 + s5
1641 324394962 : s34 = s3 + s4
1642 324394962 : zout(2, j, nout1) = s1 + s25 + s34
1643 324394962 : r = s1 + cos2*s25 + cos4*s34
1644 324394962 : s = sin2*r25 + sin4*r34
1645 324394962 : zout(2, j, nout2) = r + s
1646 324394962 : zout(2, j, nout5) = r - s
1647 324394962 : r = s1 + cos4*s25 + cos2*s34
1648 324394962 : s = sin4*r25 - sin2*r34
1649 324394962 : zout(2, j, nout3) = r + s
1650 340951470 : zout(2, j, nout4) = r - s
1651 : END DO; END DO
1652 : END IF
1653 3304846 : 5000 CONTINUE
1654 : ELSE IF (now .EQ. 6) THEN
1655 : ! .5_dp*sqrt(3._dp)
1656 2589960 : bb = isign*0.8660254037844387_dp
1657 :
1658 2589960 : ia = 1
1659 2589960 : nin1 = ia - after
1660 2589960 : nout1 = ia - atn
1661 33266655 : DO ib = 1, before
1662 30676695 : nin1 = nin1 + after
1663 30676695 : nin2 = nin1 + atb
1664 30676695 : nin3 = nin2 + atb
1665 30676695 : nin4 = nin3 + atb
1666 30676695 : nin5 = nin4 + atb
1667 30676695 : nin6 = nin5 + atb
1668 30676695 : nout1 = nout1 + atn
1669 30676695 : nout2 = nout1 + after
1670 30676695 : nout3 = nout2 + after
1671 30676695 : nout4 = nout3 + after
1672 30676695 : nout5 = nout4 + after
1673 30676695 : nout6 = nout5 + after
1674 558668211 : DO j = 1, nfft
1675 525401556 : r2 = zin(1, j, nin3)
1676 525401556 : s2 = zin(2, j, nin3)
1677 525401556 : r3 = zin(1, j, nin5)
1678 525401556 : s3 = zin(2, j, nin5)
1679 525401556 : r = r2 + r3
1680 525401556 : s = s2 + s3
1681 525401556 : r1 = zin(1, j, nin1)
1682 525401556 : s1 = zin(2, j, nin1)
1683 525401556 : ur1 = r + r1
1684 525401556 : ui1 = s + s1
1685 525401556 : r1 = r1 - .5_dp*r
1686 525401556 : s1 = s1 - .5_dp*s
1687 525401556 : r = r2 - r3
1688 525401556 : s = s2 - s3
1689 525401556 : ur2 = r1 - s*bb
1690 525401556 : ui2 = s1 + r*bb
1691 525401556 : ur3 = r1 + s*bb
1692 525401556 : ui3 = s1 - r*bb
1693 :
1694 525401556 : r2 = zin(1, j, nin6)
1695 525401556 : s2 = zin(2, j, nin6)
1696 525401556 : r3 = zin(1, j, nin2)
1697 525401556 : s3 = zin(2, j, nin2)
1698 525401556 : r = r2 + r3
1699 525401556 : s = s2 + s3
1700 525401556 : r1 = zin(1, j, nin4)
1701 525401556 : s1 = zin(2, j, nin4)
1702 525401556 : vr1 = r + r1
1703 525401556 : vi1 = s + s1
1704 525401556 : r1 = r1 - .5_dp*r
1705 525401556 : s1 = s1 - .5_dp*s
1706 525401556 : r = r2 - r3
1707 525401556 : s = s2 - s3
1708 525401556 : vr2 = r1 - s*bb
1709 525401556 : vi2 = s1 + r*bb
1710 525401556 : vr3 = r1 + s*bb
1711 525401556 : vi3 = s1 - r*bb
1712 :
1713 525401556 : zout(1, j, nout1) = ur1 + vr1
1714 525401556 : zout(2, j, nout1) = ui1 + vi1
1715 525401556 : zout(1, j, nout5) = ur2 + vr2
1716 525401556 : zout(2, j, nout5) = ui2 + vi2
1717 525401556 : zout(1, j, nout3) = ur3 + vr3
1718 525401556 : zout(2, j, nout3) = ui3 + vi3
1719 525401556 : zout(1, j, nout4) = ur1 - vr1
1720 525401556 : zout(2, j, nout4) = ui1 - vi1
1721 525401556 : zout(1, j, nout2) = ur2 - vr2
1722 525401556 : zout(2, j, nout2) = ui2 - vi2
1723 525401556 : zout(1, j, nout6) = ur3 - vr3
1724 556078251 : zout(2, j, nout6) = ui3 - vi3
1725 : END DO; END DO
1726 : ELSE
1727 0 : CPABORT("error fftstp")
1728 : END IF
1729 :
1730 21936468 : END SUBROUTINE fftstp
1731 :
1732 : END MODULE ps_wavelet_fft3d
|