# How long would it take to incorporate the iso\_c\_binding module into a program?

**URL:** <https://fortran-lang.discourse.group/t/how-long-would-it-take-to-incorporate-the-iso-c-binding-module-into-a-program/10438>\
**Category:** Help\
**Created:** [October 11, 2025, 11:55pm UTC](https://fortran-lang.discourse.group/t/how-long-would-it-take-to-incorporate-the-iso-c-binding-module-into-a-program/10438 "2025-10-11T23:55:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![giraffe2](https://avatars.discourse-cdn.com/v4/letter/g/7bcc69/32.png) [@giraffe2](https://fortran-lang.discourse.group/u/giraffe2)\
**Post date:** [October 11, 2025, 11:55pm UTC](https://fortran-lang.discourse.group/t/how-long-would-it-take-to-incorporate-the-iso-c-binding-module-into-a-program/10438/1 "2025-10-11T23:55:28Z")

</div>

Hello,

In the past, I had a problem. Basically, I was unsuccessful at converting my large Fortran program with many C calls to use the iso\_c\_binding standard because I ran out of time. (I was repeatedly forced to redo the new iso\_c\_binding interface that I was trying to develop.)

I don’t remember the exact compilers or details of the code. I just know that my employer cancel the project.

Question: In the future if this situation occurs, how can I prevent this problem from happening?

Thank you,

---

<div class="post-metadata">

**Author:** ![urbanjost](https://avatars.discourse-cdn.com/v4/letter/u/0ea827/32.png) [@urbanjost](https://fortran-lang.discourse.group/u/urbanjost)\
**Post date:** [October 12, 2025, 5:22pm UTC](https://fortran-lang.discourse.group/t/how-long-would-it-take-to-incorporate-the-iso-c-binding-module-into-a-program/10438/2 "2025-10-12T17:22:56Z")

</div>

Isolate all the routines to a module. The calls from the program should use intrinsic Fortran types as much as possible and be converted to appropriate C types in the module. Using the module as an abstraction layer you are free to create modules specific to particular programming environments. If the function is available as a compiler extension or requires specific coding because the ISO\_C\_BINDING interface is not available or can simply be implemented with a simple C binding is then all isolated to the module. Modern AI products may be able to give much more accurate assistance than was the case just a few months ago. Look for libraries on the WWW that already provide ISO\_C\_BINDING interfaces to many of the most common system calls via C. We had C interfaces before ISO\_C\_BINDING where that basic tactic worked successfully, and continued to be useful while the ability for Fortran to call C became defined in the standard. Recently, particularly with some clarifications and enhancements to passing character data the bindings have become simpler to implement reliably but an approach using wrappers is still useful in my opinion.

I would practice making calls to and from C with simple interfaces, gradually experimenting with more challenging calls. Try to solve some calls available in the public libraries without looking at the public code first; and then study the differences between your solution and the readily available ones.

---

<div class="post-metadata">

**Author:** ![giraffe2](https://avatars.discourse-cdn.com/v4/letter/g/7bcc69/32.png) [@giraffe2](https://fortran-lang.discourse.group/u/giraffe2)\
**Post date:** [November 23, 2025, 2:57pm UTC](https://fortran-lang.discourse.group/t/how-long-would-it-take-to-incorporate-the-iso-c-binding-module-into-a-program/10438/3 "2025-11-23T14:57:36Z")

</div>

**Polling** Questions: _Does everyone agree with this process? Is more clarification required to implement this process? Does anyone have something to add to add to this process? What would make this process difficult to implement and in simple words what would you do in these situations?_

Thank you, 🎁

giraff2

---

<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:** [November 23, 2025, 6:09pm UTC](https://fortran-lang.discourse.group/t/how-long-would-it-take-to-incorporate-the-iso-c-binding-module-into-a-program/10438/4 "2025-11-23T18:09:36Z")

</div>

Yes, @urbanjost’s answer is spot on. @giraffe2 if you have any specific questions, share what work you did and what you tried to do, and the outcome and what you want to achieve.

---

<div class="post-metadata">

**Author:** ![giraffe2](https://avatars.discourse-cdn.com/v4/letter/g/7bcc69/32.png) [@giraffe2](https://fortran-lang.discourse.group/u/giraffe2)\
**Post date:** [November 24, 2025, 11:47pm UTC](https://fortran-lang.discourse.group/t/how-long-would-it-take-to-incorporate-the-iso-c-binding-module-into-a-program/10438/5 "2025-11-24T23:47:09Z")

</div>

I did the work two years ago, so the line by line details of my work have been forgotten. I do not have access to that code.

But overall, what I remember trying to do is create a specific iso\_c\_binding interface one-by-one for each C routine call from Fortran. Because each time, there were “similar” C calls, the new interface led to errors that required adjustments to the code to remove the errors.

Each new iso\_c\_binding interface would require adjustments to previous iso\_c\_binding interfaces added, etc., etc., etc., etc., etc.

Ultimately after months working on the fixes, and because I was never given a completion date. I ran out of time and had to submit what I had. What I submitted did not compile. (I just wasn’t finished doing the work.)

A few months later, I left that employer for other reasons.

I guess. What I should be asking is for a more simpler description of urbanjost’s answer to my original question, something such as a process that I should follow next time, maybe practical examples for each step.

Thank you,

giraffe2
