Coder Social home page Coder Social logo

modern_fftpack's Introduction

modern_fftpack - A modern Fortran (2008+) library of fast Fourier transforms

An object-oriented modernization of NCAR's FFTPACK5.1.

  • The original work, written in fixed-form FORTRAN 77, was extensively refactored to incorporate features of free-form modern Fortran (2008+).
  • The library is fully Fortran 2008 (ISO/IEC 1539-1:2010) compliant;
  • all instances of go to's are replaced with modern control structures.
  • Numerous do loops are replaced with array operations to improve readability.
  • Potentially large automatic arrays are replaced with allocatable arrays for heap access.
  • Test programs are provided for the transforms. Each serves two purposes: as a template to guide you in writing your own codes utilizing the fttpack library, and as a demonstration that you can correctly produce the executables.
  • Ideally, type(FFTpack)'s functionality and usage will evolve into something similar to scipy.fftpack

Usage

    use, intrinsic :: ISO_C_binding, only: &
        wp => C_DOUBLE
        
    use fftpack_library, only: &
        FFTpack

    ! Explicit typing only
    implicit none
    
    type (FFTpack)  	      :: foo
    complex (wp), allocatable :: my_data(:)
    
    
    !.... generate some data
    
    ! Forward transform
    foo%fft(my_data)
    
    ! Backward transform
    foo%ifft(my_data)
    

Requirements


To build the project

Type the following command line arguments

	git clone https://github.com/jlokimlin/modern_fftpack.git
	
	cd modern_fftpack; make all

Contributing

This project is still a work in progress and anyone is free to contribute under the proviso that they abstain from using the dreaded go to.

For bug reports or feature requests please open an issue on github.


Bibliography

[1] Swarztrauber, Paul N. "Symmetric FFTs." Mathematics of Computation 47.175 (1986): 323-346.

[2] Swarztrauber, Paul N. "FFT algorithms for vector computers." Parallel Computing 1.1 (1984): 45-63.


Result

```

program tcfft1 and related messages:
cfft1 backward-forward max error = 0.794798730345622E-015
program tcfft1 and related messages:
cfft1 forward-backward max error = 0.867111901826273E-015
end program tcfft1 and related messages

program trfft1 and related messages:
rfft1 forward-backward max error = 0.555111512312578E-015
rfft1 backward-forward max error = 0.777156117237610E-015
end program trfft1 and related messages

program tcosq1 and related messages:
cosq1 forward-backward max error = 0.777156117237610E-015
cosq1 backward-forward max error = 0.666133814775094E-015
end program tcosq1 and related messages

program tcost1 and related messages:
cost1 forward-backward max error = 0.233146835171283E-013
cost1 backward-forward max error = 0.224265050974282E-013
end program tcost1 and related messages

program tsinq1 and related messages:
sinq1 forward-backward max error = 0.777156117237610E-015
sinq1 backward-forward max error = 0.777156117237610E-015
end program tsinq1 and related messages


program tsint1 and related messages:
sint1 forward-backward max error = 0.455191440096314E-013
sint1 backward-forward max error = 0.395239396766556E-013
end program tsint1 and related messages


program tcfft2 and related messages:
cfft2 forward-backward max error = 0.948574968053509E-015
cfft2 backward-forward max error = 0.915513359704447E-015
end program tcfft2 and related messages

program trfft2 and related messages:
rfft2 forward-backward max error = 0.777156117237610E-015
rfft2 backward-forward max error = 0.832667268468867E-015
end program trfft2 and related messages

 
This result was compiled by GCC version 5.3.1 20160409 using the options -I ../lib -mtune=generic -march=x86-64 -O3 -Wall -J ../lib

```

modern_fftpack's People

Contributors

jlokimlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

modern_fftpack's Issues

some problems in using modern_fftpack via Intel Fortran 2017

Hello, jlokimlin!
I am trying to apply the modern_fftpack to my code by Intel Fortran 2017 with Visual Studio 2015 community version on Windows 7 64bit, and I encountered some problems:

  1. Multiple PUBLIC statement/attribute declarations in type_FFTpack.f90 is not allowed in Intel Fortran 2017;
  2. The FFT forward transform result differs from the result obtained by the fftpack library in netlib, and the result by netlib fftpack is N scaled of the result data by modern_fftpack;
  3. Access violation error happened in subroutine complex_pass_n_backward about array assignment operation of array ch1 and cc1 while I am trying to use openmp.

Excuse me for my poor English.

Comments in `type_FFTpack.f90` about Multidimensional Complex FFT Routines. Why?

Comments in type_FFTpack.f90 about Multidimensional Complex FFT Routines?
comments

Some comments (line 55, 56, 66, 67 and etc.) appear in the source file type_FFTpack.f90 to comment the multi-dimensional complex FFT subroutine.
Does the comments here indicate any error or risk?
Is it possible to uncomment and use the ifftn polymorphic subroutine of complex FFT?
Thank you!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.