Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Fortran 90 Programmer's Reference: HP Fortran 90 Programmer's Reference > Chapter 10 HP Fortran 90 statements

INTERFACE

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

Introduces an interface block.

Syntax

INTERFACE [generic-spec]
generic-spec

is one of:

  • generic-name

  • OPERATOR(defined-operator)

  • ASSIGNMENT(=)

generic-name

is the name of a generic procedure.

defined-operator

is one of:

  • An intrinsic operator

  • .operator., where operator is a user-defined name

Description

The INTERFACE statement is the first statement of an interface block. Interface blocks constitute the mechanism by which external procedures may be given explicit interfaces and also provide additional functionality, as described below.

The INTERFACE generic-name form defines a generic interface for the procedures in the interface block.

The INTERFACE OPERATOR (defined-operator) form is used to define a new operator or to extend the meaning of an existing operator.

The INTERFACE ASSIGNMENT(=) form is used to extend the assignment operator so that it can be used (for example) with derived-type objects.

Examples

The following examples illustrate different forms of the interface block:

! make explicit the interfaces of external function spline
! and external subroutine sp2
INTERFACE
REAL FUNCTION spline(x,y,z)
END FUNCTION spline
SUBROUTINE sp2(x,z)
END SUBROUTINE sp2
END INTERFACE

! Make the interface of function r_ave explicit and give
! it the generic name g_ave
INTERFACE g_ave
FUNCTION r_ave(x)
! Get the size of x from the module ave_stuff
USE ave_stuff, ONLY: n
REAL r_ave, x(n)
END FUNCTION r_ave
END INTERFACE

! Make the interface of external function b_or explicit, and use! it to extend the + operator
INTERFACE OPERATOR ( + )
FUNCTION b_or(p, q)
LOGICAL b_or, p, q
INTENT (IN) p, q
END FUNCTION b_or
END INTERFACE

Related statements

END INTERFACE, FUNCTION, and SUBROUTINE

Related concepts

For related information, see the following:

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.