# Proposal: moving fftpack under fortran-lang

**URL:** <https://fortran-lang.discourse.group/t/proposal-moving-fftpack-under-fortran-lang/1711>\
**Category:** Uncategorized\
**Created:** [August 17, 2021, 3:15pm UTC](https://fortran-lang.discourse.group/t/proposal-moving-fftpack-under-fortran-lang/1711 "2021-08-17T15:15:48Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [August 19, 2021, 2:21am UTC](https://fortran-lang.discourse.group/t/proposal-moving-fftpack-under-fortran-lang/1711/22 "2021-08-19T02:21:56Z")

</div>

@Beliavsky thanks for the list. I also wrote a modern Fortran version of fftpack here: [hfsolver/fourier.f90 at master · certik/hfsolver · GitHub](https://github.com/certik/hfsolver/blob/master/src/fourier.f90). One has to be careful with performance, for example allocating memory in the inner loop: [modern\_fftpack/complex\_forward\_1d.f90 at 6909d44988925dcae1ee478c06be31e5605d3974 · jlokimlin/modern\_fftpack · GitHub](https://github.com/jlokimlin/modern_fftpack/blob/6909d44988925dcae1ee478c06be31e5605d3974/src/complex_forward_1d.f90#L303) might slow things down. For that reason, I think the best way forward is to “preserve” the original code as much as possible, for benchmarking and reference purposes, but do the following changes:

- add modern Fortran interfaces
- fpm, CI, … (mostly done)
- possibly move from fixed form to free form; and move the global subroutines to modules
- add single precision version
- add benchmarks

But changes like rewriting the complex passes to use more modern Fortran as I have done here: [hfsolver/fourier.f90 at b4c50c1979fb7e468b1852b144ba756f5a51788d · certik/hfsolver · GitHub](https://github.com/certik/hfsolver/blob/b4c50c1979fb7e468b1852b144ba756f5a51788d/src/fourier.f90#L201) should be done in a separate library.

Such ash `fft.f`. 🙂 / See [Naming convention for Fortran wrappers packages](https://fortran-lang.discourse.group/t/naming-convention-for-fortran-wrappers-packages/1701) /

---

_[View the full topic](https://fortran-lang.discourse.group/t/proposal-moving-fftpack-under-fortran-lang/1711)._
