02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Procedure interface<br />

Program units and procedures<br />

Procedure interface<br />

A procedure interface is the information specified in a procedure reference, including the<br />

name of the procedure, the arguments, and (if the procedure is a function) the result. If the<br />

interface is explicit, all of the characteristics of the arguments and the result—type, kind,<br />

attributes, and number—are defined within the scope of the reference. If the interface is<br />

implicit, the compiler may be able to make sufficient assumptions about the interface to<br />

permit the procedure reference.<br />

All procedure interfaces are implicit except for the following:<br />

Intrinsic procedure<br />

Internal procedure<br />

Module procedure<br />

Recursive function that specifies a result clause<br />

External procedure whose interface is declared in an interface block<br />

An explicit interface is required when:<br />

The procedure reference uses the keyword form of an actual argument.<br />

The procedure has OPTIONAL arguments.<br />

Any dummy argument is an assumed-shape array or a pointer.<br />

The result of a function is array-valued or a pointer.<br />

The procedure is a character function, the length of which is determined dynamically.<br />

The procedure reference is to a generic name.<br />

The procedure reference implements a user-defined operator or assignment.<br />

The procedure has the same name as an intrinsic procedure, but you want it to have<br />

precedence over the intrinsic; see “Availability of intrinsics” on page 469.<br />

You want the compiler to perform argument-checking at compile-time.<br />

The following sections describe the interface block and its use for creating:<br />

Generic procedures<br />

Defined operators<br />

Defined assignment<br />

Chapter 7 149

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

Saved successfully!

Ooh no, something went wrong!