Guide to Interfacing C and FORTRAN 77
There are—if one permits the understatement—a lot of
libraries written in FORTRAN 77 (and FORTRAN 90 as well). And whilst
Fortran 2003 readily provides easy ways of interfacing Fortran with C (the
ISO_C_BINDING module, to be clear), FORTRAN 77 (and also
FORTRAN 90) do not and require more “work” (or if one wish to
be more accurate: “hacky nonsense”). This guide will endeavour to
be a useful—hopefully, the author makes no promises—resource on the
esoteric “art” of interfacing the two languages.
Table of Contents
- Introduction
- The Programming
Environment
- Example Makefile
- Data Types and Passing Data
- Data Types
- A Note on Complex
Types
- A Note on
Floating Point Formats
- Single
(32-bit) and Double (64-bit) Precision Types
- VAX F-Float, D-Float, and
G-Float
- IBM HFP Short and Long
- Extended
(80-bit) Precision Types
- Quadruple
(128-bit) Precision Types
- VAX H-FLoat
- IBM 128-bit Float
- Half
(16-bit) Precision Types
- C's
char and Other C Primitives
- Compound Data
Structures
- The
COMMON Block and C structs
- The VAX FORTRAN
STRUCTURE Extension and C structs
- The VAX FORTRAN
UNION Extensions and C unions
- Arrays
- Function/Subroutine Calls
- C Function Prototypes
for FORTRAN Callable Functions/Subroutines
- C Functions Calling
FORTRAN Functions
- FORTRAN Functions
Calling C Functions
- License Details
Fave icon Database CMYK © 2008 – Barry Mieny
Syntax highlighting using highlight.js by © 2006 – Ivan Sagalaev