c_calls_f77_test


c_calls_f77_test, a C code which illustrates how a C main program can call a Fortran77 subroutine.

For this example, the KRONROD package is used. Note that the KRONROD library is available in C and in Fortran77, so this example is not created out of necessity (the C main program could have simply called the C version of KRONROD). Instead, it is intended as an example of how to do this when you have to (you don't have a C version of the routines you want to use.)

When calling a Fortran77 routine from a C function, there are some simple things that may be enough to guarantee success.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

c_calls_f77_test is available in a C version and a C++ version and a MATLAB version.

Related Data and Programs:

c_calls_f90, a C code which illustrates a C code calling a Fortran90 subroutine.

c++_calls_f77_test, a C++ code which illustrates how a C++ main program can call a Fortran77 subroutine.

c++_calls_f90, C++ programs which illustrate how a C++ main program can call a Fortran90 subroutine.

f77_calls_c, Fortran77 programs which illustrates how a Fortran77 program can call a C function.

f77_calls_c++, Fortran77 programs which illustrates how a Fortran77 program can call a C++ function.

f90_calls_c, Fortran90 programs which illustrates how a Fortran90 program can call a C function.

f90_calls_c++, Fortran90 programs which illustrates how a Fortran90 program can call a C++ function.

kronrod_rule, a C code which can compute a Gauss and Gauss-Kronrod pair of quadrature rules of arbitrary order, by Robert Piessens, Maria Branders.

kronrod_rule, a Fortran77 library which can compute a Gauss and Gauss-Kronrod pair of quadrature rules of arbitrary order, by Robert Piessens, Maria Branders.

matlab_calls_c, MATLAB programs which call a C function, using MATLAB's MEX facility.

mixed, a C codes which calls a function written in another programming language.

Reference:

Source Code:

KRONROD is the Fortran77 source code for the KRONROD library. It should be essentially unchanged from the standard version.

KRONROD_test is the C source code for the main program. Some changes have been made from the standard version in order to adjust for the fact that we are calling a Fortran77 subroutine.


Last revised on 06 December 2010.