Using and Porting GNU Fortran
13.11 Alternate Returns (SUBROUTINE and RETURN)
Subroutines with alternate returns (e.g. `SUBROUTINE X(*)' and
`CALL X(*50)') are implemented by
g77 as functions returning
The actual alternate-return arguments are omitted from the calling sequence.
Instead, the caller uses
the return value to do a rough equivalent of the Fortran
GOTO statement, as in `GOTO (50), X()' in the
example above (where `X' is quietly declared as an
function), and the callee just returns whatever integer
is specified in the
RETURN statement for the subroutine
For example, `RETURN 1' is implemented as `X = 1' followed
in C, and `RETURN' by itself is `X = 0' and `RETURN').