FORTRAN-SO

Functions And Subroutines

NOTE

In a given program unit, det~rmining whether a dummy procedure is associated with a function or a subroutine may not be possible. If a pro- cedure name appears only in a dummy argument list, an EXTERNAL statement, and an actual argument list, examining the subprogram is not enough to determine whether the symbolic name should be associated with a subroutine or a function.

A dummy argument associated with an intrinsic function has no automatic type association. Therefore, the type of the dummy argument must agree with the type of the result of all actual arguments associated with it. An intrinsic function name used as a dummy external function name loses its property as an intrinsic function within the subprogram. A dummy argument associated with an intrinsic function and used as a procedure name in a function reference must have arguments that agree in number and type with those specified for the intrinsic function.

5.3.3.5Argument Association Limitations

If dummy arguments in the same subprogram are associated as the result of a reference to that subprogram, neither dummy can be redefined during execution of the subprogram. For example, an external function beginning with

FUNCTION F(A,B,C)

could not be referenced by

F(X, Y, X)

because' A' and 'C' would become associated.

If a subprogram reference causes a dummy argument to become associated with an item in a common block in the same subprogram, neither the dummy nor the com- mon item can be redefined within the subprogram.

5-11

Page 59
Image 59
Intel fortran-80 manual Fx, Y, Function FA,B,C