FORTRAN Reference Manual
Mixed-Language Programming
FORTRAN Reference Manual—528615-001
13-13
General Restrictions
General Restrictions
You cannot call a subprogram from FORTRAN if it:
•
Has more than 63 formal parameters
•
Has pass-by-value parameters larger than 64 bits
•
Is a function that returns a value that is not a simple scalar value or is of a data
type that cannot be declared in FORTRAN (for example, pointers and structures
are not allowed)
You cannot call a function subprogram from FORTRAN with a CALL statement.
Using GUARDIAN and CONSULT Directives
To call a procedure declared in a GUARDIAN directive, find the description of the
procedure you want to call in the Guardian Procedure Calls Reference Manual or for
more information, see Section 15, Utility Routines. To call a procedure declared in a
CONSULT directive, find the procedure’s description in the documentation for the file
named in the CONSULT directive.
Use the description to determine:
•
Whether to call the procedure as a subroutine or as a function
•
The order of its parameters
•
Which parameters are required
•
The data type of each parameter that you use
•
Whether each argument that you use is passed by value or by reference
If the procedure returns a value, you must call it as a function from FORTRAN.
Construct the call as a FORTRAN function reference. If you cannot call the procedure
as a function, construct the call as a FORTRAN subroutine call, with a CALL
statement. As in normal FORTRAN calls, arguments and parameters must match in
order and type. Each argument that you supply must be a FORTRAN data type that
corresponds to the dummy argument’s data type. Appendix D describes the
correspondence between data types in C, COBOL85, FORTRAN, Pascal, and TAL.
Unlike normal FORTRAN calls, you can omit optional arguments when calling
procedures declared by GUARDIAN and CONSULT directives. To omit arguments at
the end of the argument list, simply leave them off. To omit an argument from the
middle of the argument list, omit the argument itself, but include the comma that would
normally follow that argument.










