1 subroutine fft2 (datar, datai, n, inc)
14 integer(itm_i4),
intent(in) :: n, inc
15 real(r8),
dimension(iabs(inc) * n),
intent(inout) :: datar, datai
17 real(r8) :: tempr, tempi, theta, sinth, wstpr, wstpi, wr, wi
18 integer(itm_i4) :: ktran, ks, ip0, ip1, ip2, ip3, irev, ibit, i
19 integer(itm_i4) :: i1, i3, j0, j1
31 datar(i) = datar(irev)
32 datai(i) = datai(irev)
38 if (irev <= ibit)
exit
47 theta = dble(ktran) * 3.1415926535898_r8
51 sinth = sin(.5_r8 * theta)
52 wstpr = -2._r8 * sinth * sinth
60 tempr = wr * datar(j1) - wi * datai(j1)
61 tempi = wr * datai(j1) + wi * datar(j1)
62 datar(j1) = datar(j0) - tempr
63 datai(j1) = datai(j0) - tempi
64 datar(j0) = datar(j0) + tempr
65 datai(j0) = datai(j0) + tempi
68 wr = wr * wstpr - wi * wstpi + wr
69 wi= wi * wstpr + tempr * wstpi + wi
subroutine fft2(datar, datai, n, inc)