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 | 1369 | December 5, 2023 | |
Explicit-shape and assumed-size arrays, and sequence association
|
12 | 2287 | February 16, 2022 | |
Fortran Arrays in C++ | 30 | 784 | November 28, 2024 | |
Iso_c_binding: pass an array from c to fortran (Edit: python interop content)
|
25 | 3465 | June 14, 2024 | |
Using a Fortran derived type with allocatable components from C
|
1 | 1338 | May 15, 2022 |