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.

INTERFACE<br />

Introduces an interface block.<br />

Syntax<br />

INTERFACE [generic-spec]<br />

generic-spec is one of:<br />

generic-name<br />

OPERATOR(defined-operator)<br />

ASSIGNMENT(=)<br />

generic-name isthenameofagenericprocedure.<br />

defined-operator is one of:<br />

Description<br />

An intrinsic operator<br />

.operator., whereoperator is a user-defined name<br />

<strong>HP</strong> <strong>Fortran</strong> statements<br />

INTERFACE<br />

The INTERFACE statement is the first statement of an interface block. Interface blocks<br />

constitute the mechanism by which external procedures may be given explicit interfaces and<br />

also provide additional functionality, as described below.<br />

The INTERFACE generic-name form defines a generic interface for the procedures in the<br />

interface block.<br />

The INTERFACE OPERATOR (defined-operator) form is used to define a new operator or to<br />

extend the meaning of an existing operator.<br />

The INTERFACE ASSIGNMENT(=) form is used to extend the assignment operator so that it can<br />

be used (for example) with derived-type objects.<br />

Examples<br />

The following examples illustrate different forms of the interface block:<br />

! make explicit the interfaces of external function spline<br />

! and external subroutine sp2<br />

INTERFACE<br />

REAL FUNCTION spline(x,y,z)<br />

END FUNCTION spline<br />

Chapter 10 357

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

Saved successfully!

Ooh no, something went wrong!