n-d FFT's and f90
Author Message
n-d FFT's and f90

--
OK I am setting myself up to be shot down but here goes:-
(I am new to fortran 90 and parallel computing so please be tolerant).

My aim is to write an 3-dimensional FFT routine to run on a MIMD computer
where the parallelism is exploited by performing 1-d FFT's on individual
processors. With much reference to various books I have written the
following code skeleton in FORTRAN 90 to perform this task. I am posting
it to see what comments arise. Please mail me with any comments about
style, accuracy or efficiency of the code.

Is the way I have referenced the array sections the most efficient or would
I be better using RESHAPE to reorder the array so that the lines to be
transformed are in the first array index. Also am I correct in my use of
HPF to perform the 1-d FFT's in parallel.

Also I would appreciate any solutions for 3-d FFT's written with MPI.
Thanks in advance

++++++++++++++++++++++++++++++++++++++++++++++++
+

+     Imperial College
+     London.                   0171 594 7538
+
++++++++++++++++++++++++++++++++++++++++++++++++

MODULE FFT
!----------------------------------------------------------------------!
!  Define the generic name FFTN for input arrays of different rank
INTERFACE FFTN
SUBROUTINE FFT1 ( X, Y )
REAL, DIMENSION( : ), INTENT( INOUT ) :: X, Y
END SUBROUTINE FFT1
SUBROUTINE FFT3 ( X, Y )
REAL, DIMENSION( :, :, : ), INTENT( INOUT ) :: X, Y
END SUBROUTINE FFT3
END INTERFACE FFTN
!----------------------------------------------------------------------!
CONTAINS
!----------------------------------------------------------------------!
SUBROUTINE FFT1 ( X, Y )
REAL, DIMENSION( : ), INTENT( INOUT ) :: X, Y
!
!  Subroutine to calculate the 1-d FFT of real and imaginary input
!  data held in the arrays x and y respectively.
.
.
.
END SUBROUTINE FFT1
!----------------------------------------------------------------------!
SUBROUTINE FFT3 ( X, Y )
REAL, DIMENSION( :, :, : ), INTENT( INOUT ) :: X, Y
!
!  Subroutine to calculate the 3-d FFT of real and imaginary input
!  data held in the arrays x and y respectively.
!  The multi-dimensional FFT is calculated using 1-d FFT's along each
!  of the axes of the input arrays in turn.
!
!  Local variables
INTEGER :: I

!   Take the FFT of the first rank
!HPF\$ INDEPENDENT
DO I = 1, SIZE( X, 1 )
CALL FFT1( X( I, :, : ), Y( I, :, : ) )
ENDDO

!   Take the FFT of the second rank
!HPF\$ INDEPENDENT
DO I = 1, SIZE( X, 2 )
CALL FFT1( X( :, I, : ), Y( :, I, : ) )
ENDDO

!   Take the FFT of the third rank
!HPF\$ INDEPENDENT
DO I = 1, SIZE( X, 3 )
CALL FFT1( X( :, :, I ), Y( :, :, I ) )
ENDDO

END SUBROUTINE FFT3
!----------------------------------------------------------------------!
END MODULE FFT

Sun, 14 Dec 1997 03:00:00 GMT

 Page 1 of 1 [ 1 post ]

Relevant Pages
 11. FFT for F90

Powered by phpBB® Forum Software