Fortran Wiki
Interoperability

Fortran interoperability is possible with many other languages.

C

Fortran 2003 provides standardized support for C interoperability.

See c_interface_module for an example of using type aliases to produce better-defined C interface prototypes.

Code::Blocks IDE plugin FortranProject has a BindTo tool which generates interfacing code to call Fortran from C.

Generating C Interfaces

C++

Chasm generates Fortran-C++ interfacing code.

FortWrap generates code to call Fortran from C++.

ObjexxFCL is a C++ library that supports integration of C++ and Fortran, providing Fortran-compatible array and string support.

C#

See C.

Lua

Lua is a highly portable scripting language, suitable for inclusion in host programs. It is widely used for configuration files, and to this end is also useful for Fortran applications, a wrapper library called Aotus is available for this purpose.

Octave

See OctaveFortran on the Octave wiki.

OpenCL

A language that allows to write parallel code for massively parallel processors like graphical processing units (GPUs), accelerator boards and multi-core CPUs. OpenCL is based on a C library, but you can run OpenCL code directly from Fortran with the FortranCL library.

Python

See Python.

Tcl

See Tcl.

Julia

See Calling C and Fortran code in the Julia documentation

Compilation or translation from Fortran to other languages

Several programs compile or translate Fortran code to other languages:

Fortran to C

f2c This is still widely distributed and multiple versions have been developed.

fwrap wraps Fortran code in C, Cython and Python.

promulaFortran A commercial program.

Fortran to C++

f2cpp

F2C++

Fable

Fortran to Java

f2j

Fortran to Lisp

f2cl

Fortran to Python

f2py: Fortran to Python interface generator.

f90wrap is a tool to automatically generate Python extension modules which interface to Fortran code that makes use of derived types.

Code::Blocks IDE plugin FortranProject has a BindTo tool which generates interfacing code to call Fortran from C, Cython and Python.

fwrap wraps Fortran code in C, Cython and Python.