24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Language</strong> <strong>Reference</strong><br />

Example:<br />

* Illegal order of statement functions.<br />

.<br />

.<br />

.<br />

F(X) = X + G(X)<br />

G(X) = X + 2<br />

.<br />

.<br />

.<br />

3. The statement function name must not be the same name of any other entity in the program unit<br />

except possibly the name of a common block.<br />

4. If a dummy argument of a statement function is of type CHARACTER, then its length<br />

specification must be an integer constant expression. The following is illegal.<br />

Example:<br />

SUBROUTINE SAM( X )<br />

CHARACTER*(*) X<br />

* Illegal - CHARACTER*(*) dummy argument not<br />

* allowed in statement function.<br />

F(X) = X<br />

PRINT *, F(’ABC’)<br />

END<br />

5. An actual argument to a statement function can be any expression, except character expressions<br />

involving the concatenation of an operand whose length specification is (*) unless the operand<br />

is a symbolic constant.<br />

12.3 Intrinsic Functions<br />

An intrinsic function is a function that is provided by <strong>Open</strong> <strong>Watcom</strong> <strong>FORTRAN</strong> <strong>77</strong>.<br />

12.3.1 Specific Names and Generic Names of Intrinsic Functions<br />

All intrinsic functions can be referenced by using the generic name or the specific name of the intrinsic<br />

function. The specific name uniquely identifies the function to be performed. The type of the result is<br />

predefined thus its name need not appear in a type statement. For example, CLOG is a specific name of the<br />

generic LOG function and computes the natural logarithm of a complex number. The type of the result is<br />

also COMPLEX.<br />

When the generic name is used, a specific name is selected based on the data type of the actual argument.<br />

For example, the generic name of the natural logarithm intrinsic function is LOG. To compute the natural<br />

logarithm of REAL, DOUBLE PRECISION, COMPLEX or DOUBLE PRECISION COMPLEX data, the<br />

generic name LOG can be used. Generic names simplify the use of intrinsic functions because the same<br />

name can be used with more than one type of argument.<br />

246 Intrinsic Functions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!