By default, the Fortran compiler converts function and subprogram names to lower case. The C compiler never performs case conversion. A C procedure called from a Fortran program must, therefore, be named using the appropriate case. For example, consider the following calls:
CALL PROCNAME() |
The C procedure must be named PROCNAME. |
X=FNNAME() |
The C procedure must be named FNNAME |
In the first call, any value returned by PROCNAME is ignored. In the second call to a function, FNNAME must return a value.
By default, Fortran subprograms pass arguments by reference; that is, they pass a pointer to each actual argument rather than the value of the argument. C programs, however, pass arguments by value. Consider the following:
When a Fortran program calls a C function, the C function's formal arguments must be declared as pointers to the appropriate data type.
When a C program calls a Fortran subprogram, each actual argument must be specified explicitly as a pointer.