FORTRAN Reference Manual

Mixed-Language Programming
FORTRAN Reference Manual528615-001
13-25
Calling FORTRAN Subprograms From C
doubleword parameter addresses in either case, after examining the compiled
procedure in its object file.
For information about sharing files in programs that consist of COBOL85 and
FORTRAN routines, see Calling COBOL85 Subprograms From FORTRAN on
page 13-19.
Calling FORTRAN Subprograms From C
If you write a C program that calls a FORTRAN subprogram, you must write C
language text to declare (import) the FORTRAN subprogram as a C external function.
Its C type is “void” if it is a FORTRAN subroutine.
If the FORTRAN subprogram is compiled with the EXTENDEDREF, LARGECOMMON,
or LARGEDATA directive, declare all the C formal parameters as extended reference
parameters (with XMEM). Otherwise, declare all of its formal parameters as standard
reference parameters (with NOXMEM).
You cannot call a FORTRAN subprogram that has dummy arguments declared as
CHARACTER * (*) , because C does not stack the required length words.
If you specify ENV OLD in your FORTRAN modules, you must use a C-series C
compiler and you cannot do I/O in FORTRAN if the main routine is written in C.
Calling FORTRAN Subprograms From Pascal
If you write a Pascal program that calls a FORTRAN subprogram, you must write
Pascal language text to declare the FORTRAN subprogram as a Pascal external
function or procedure.
If the FORTRAN subprogram is compiled with the EXTENDEDREF, LARGECOMMON,
or LARGEDATA directive, declare all of its formal parameters as extended reference
parameters (with XMEM). Otherwise, declare all of its formal parameters as standard
reference parameters (with NOXMEM).
You cannot call a FORTRAN subprogram that has any formal parameters declared as
CHARACTER * (*) in FORTRAN, because Pascal does not stack the required length
words.
If you specify ENV OLD in your FORTRAN modules, you must use a C-series Pascal
compiler and you cannot do I/O in FORTRAN if the main routine is written in Pascal.
Intrinsic Function Declarations
NonStop systems on which the FORTRAN compiler is installed also include files
named FORTDECS and FORTLIB, in the same subvolume as the FORTRAN compiler
itself (usually this is the $SYSTEM.SYSTEM.* subvolume).
FORTDECS is an EDIT format file that contains TAL external procedure declarations
for all the procedures that implement the intrinsic functions of the FORTRAN language,
and FORTLIB is an object file that contains those procedures.