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

MODULE PROCEDURE

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

Specifies module procedures in a generic interface.

Syntax

MODULE PROCEDURE module-procedure-name-list
module-procedure-name-list

is a comma-separated list of module-procedure-names.

Description

A MODULE PROCEDURE statement appears within an interface block. It is used when the specification is generic and a specific procedure is defined within the module rather than as an external procedure. The MODULE PROCEDURE statement only names the subprograms; it does not contain the definition of the interface. The named subprograms must be defined within the current module or within another module that is accessible by use association.

Examples

MODULE path
! module data environment; module procedures contained in this
! module have access to this data environment
REAL x, y, z
! Generic name substance for procedures air and water
INTERFACE substance
MODULE PROCEDURE air, water
END INTERFACE
INTERFACE OPERATOR (*)
MODULE PROCEDURE rational_multiply
END INTERFACE
...
! Module procedures are preceded by CONTAINS
CONTAINS
SUBROUTINE air (contents)
...
END SUBROUTINE air
SUBROUTINE water (x, a, z)
! x is a dummy argument, y is from the module data
! environment
a = x + y
...
END SUBROUTINE water
FUNCTION rational_multiply (x, y)
TYPE (rational) :: rational_multiply
TYPE (rational), INTENT (IN) :: x, y
rational_multiply = ...
...
END FUNCTION rational_multiply
END MODULE path

Related statements

FUNCTION, SUBROUTINE, and INTERFACE

Related concepts

For information about module procedures, see “Module program unit”.

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