Difference between subroutine rlft3(data,speq,nn1,nn2,nn3) and the FFTW


YueBin
06-15-2007, 12:38 AM
Hi,all,

I write a test code as follow:

real in1(n1,n2,n3)
real in2(n1+2,n2,n3)
complex inny(n2,n3)

do i3=1,n3
do i2=1,n2
do i1=1,n1
in1(i1,i2,i3)= real(i1*i2*i3)
in2(i1,i2,i3)= real(i1*i2*i3)
enddo
enddo
enddo

in2(n1+1:n1+2,:,:)=0.0
inny=0.0

then I do inverse FFT to in1 and in2 ,infact ,they are the same.

call rfftwnd_f77_mpi(iplan,1,in2,work,1,FFTW_NORMAL_ORD ER)
call rlft3(in1,inny,n1,n2,n3,-1)

but the result is different:
in1 is :
-4.500000
13.50000
1.500000
-4.500000
1.500000
-4.500000
-0.5000000
1.500000

and in2(1:n1,1:n3,1:n3) is
9.000000
9.000000
-3.000000
-3.000000
-3.000000
-3.000000
1.000000
1.000000

why the result between NR and FFTW is so different?