← Table of contents
The Oak Ridge ALGOL Compiler for the Control Data Corporation 1604

APPENDIX G Fortran Subprograms in an Algol Program

Reading edition

The standard procedures FORTRAN, FORTRANF, FTN, and FTNF are used to call compiled Fortran subroutines and functions from within an Algol program. Each procedure has one parameter which is a call of the desired Fortran subprogram. The Fortran subprogram must be declared external as described in Section V.

The use of these procedures simply causes a Fortran calling sequence to be generated by the compiler. Of course the subprogram could be written in CODAP as well as Fortran, provided it is designed to link through a Fortran-type calling sequence.

The procedures are used as follows:

FORTRAN—generates a Fortran 62 calling sequence for a subroutine

FORTRANF—generates a Fortran 62 calling sequence for a function

FTN—generates a Fortran 63 calling sequence for a subroutine

FTNF—generates a Fortran 63 calling sequence for a function

Each of these procedures is standard, i.e., available without declaration. FORTRANF and FTNF are used in expressions.

Examples:

x := FTNF (ALPHA(T,A[0,0]))

FORTRAN (SUB(I + J)) .

The following restrictions must be observed: labels, procedures with no parameters, standard procedure names, and array names cannot be used as arguments of a call of a Fortran subprogram. However, in the case of an array, the subscripted variable which is the first element of 42 the array will satisfy a Fortran subroutine which has an array name as a formal parameter. The name of the Fortran subprogram cannot be a formal parameter. Literals must be enclosed in string quotes.

Explore with AITake your curiosity a little further.

Reading settings