My biggest problem with ISO_Fortran_binding.h and assumed shape arrays is that it forces me to write more C code than I need. To me that defeats the purpose of the original idea behind the Fortran C-Interop facility. Basically, if you know the C function prototype you can call a C function without writing any additional C code. Conversely, on the C side all you have to do is write a conforming function prototype for the Fortran routine and call it without resorting to convoluted name mangling. However, I’ll admit that 99.99% of my forays into C-Interop has been Fortran calling C so I rarely see a need for writing another C wrapper around my target C routine just so I can use assumed shape arrays.
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Difference between assumed-size and assumed-shape arrays? | 8 | 1756 | December 5, 2023 | |
Explicit-shape and assumed-size arrays, and sequence association
|
12 | 2397 | February 16, 2022 | |
Fortran Arrays in C++ | 30 | 881 | November 28, 2024 | |
Interface definitions for assumed size arrays
|
12 | 264 | April 7, 2025 | |
Iso_c_binding: pass an array from c to fortran (Edit: python interop content)
|
25 | 3687 | June 14, 2024 |