It would certainly need to be used for complex(c_float)
and complex(c_double)
. It does seem complicated to have a compiler with multiple layouts potentially requiring conversions back and forth with an associated runtime penalty.
There were some lengthy discussions on the topic of complex storage before:
- Complex type storage (again)
- Allow complex pointers to real arrays and vice-versa
- Implicit real - complex conversion in fortran
Split storage is not that uncommon in other software products:
- MATLAB versions R2017b and earlier use split storage (MATLAB Support for Interleaved Complex API in MEX Functions)
- the FFT routines in the Apple vDSP library expect split storage: Understanding data packing for Fourier transforms | Apple Developer Documentation