Tips and Pitfalls

Calling Fortran

Since SPP is preprocessed into Fortran, in most cases, it is quite straightforward to call an existing Fortran subroutine from an SPP procedure. The most important caution is the case of character strings. SPP strings are not the same as Fortran strings. SPP strings are implemented as arrays of integers. However, there are procedures available to transform between the two: f77pak() converts an SPP string to a Fortran string, and f77upk() converts a Fortran string to an SPP string. Note that you must declare the Fortran string in the SPP procedure with a Fortan statement. This is possible with the % escape character as the first character on a line. This indicates to the xc compiler that the following statement should not be processed but copied directly to the Fortran code. See Example C.9, below.

Generated with CERN WebMaker