Technical data
Interlanguage Communication [9]
SUBROUTINE FCTN
COMMON // STA,STB(10)
PRINT *, "IN FORTRAN"
PRINT *, " STA = ",STA
PRINT *, " STB = ",STB
STOP
END
FUNCTION MYCOMMON()
COMMON // A
MYCOMMON = LOC(A)
RETURN
END
The output of the previous C or C++ source code is as follows:
In C
a = 1.0
b = 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0
The output of the previous Fortran source code is as follows:
IN FORTRAN
STA = 1.
STB = 2., 3., 4., 5., 6., 7., 8., 9., 10., 11.
9.3.7 Cray Standard C and Fortran Example
The following example illustrates a Cray Standard C function that calls a Fortran
subprogram. The Fortran subprogram follows the Cray Standard C function, and
the input and output from this sequence follows the Fortran subprogram.
S–2179–36 133










