Intel fortran-80 manual INTRI NSIC Statement, Statement Functions, INTRINSIC tunc ,tunc

Models: fortran-80

1 130
Download 130 pages 742 b
Page 50
Image 50
5.1.2 INTRI NSIC Statement

Functions And Subroutines

FORTRAN-SO

If the name of an intrinsic function appears in the dummy argument list of a FUNC- TION or SUBROUTINE subprogram, the name is considered to have no relation to the intrinsic function within the scope of the program unit and the name itself loses its intrinsic quality. The data type associated with the symbolic name is specified as normal (by default or by a type statement).

If the name of an intrinsic function is to be used as an actual argument in an external procedure reference, the name must first be specified in an INTRINSIC statement.

5.1.2 INTRI NSIC Statement

The INTRINSIC statement confirms that a symbolic name represents an intrinsic function and allows that name to be used as an actual argument. Only one ap- pearance of a symbolic name in all of the INTRINSIC statements in a given program unit is allowed. A symbolic name may not appear in an INTRINSIC statement and an EXTERNAL statement in the same program unit.

The format of the INTRINSIC statement is

INTRINSIC tunc [,tunc] ...

where 'func' is an intrinsic function name.

The names of certain intrinsic functions cannot be used as actual arguments and, therefore, cannot appear in INTRINSIC statements. These are the functions for type conversion (lNT, IFIX, FLOAT, REAL, ICHAR) and the functions for choos- ing a largest or smallest value (MAXO, AMAXI, AMAXO, MAXI, MINO, AMINI, AMINO, MINI).

Examples:

INTRINSIC SQRT

INTRINSIC EXP, LOG, LOG10

5.1.3 Statement Functions

Straightforward mathematical functions like

f(x) = ax 2 + bx + c

are defined in FORTRAN using statement functions. These functions have no keyword; the format is

tunc ([dum [,dum] ...]) = exp

where

June is the symbolic name of the statement function

dum is a dummy argument to be replaced by an actual argument when the function is referenced

exp is an expression

As an example, the mathematical function above would be written

F(X) = A*(X**2)+ 8*X + C

Substituting the actual argument '3' for the dummy argument 'X' in this function would result in the value '9A + 3B + C.'

5-2

Page 50
Image 50
Intel fortran-80 manual INTRI NSIC Statement, Statement Functions, INTRINSIC tunc ,tunc, tunc dum ,dum ... = exp