Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

MODULE PROCEDURE

Statement: Identifies module procedures in an interface block that specifies a generic name.

Example

!A program that changes non-default integers and reals
! into default integers and reals
   PROGRAM CHANGE_KIND
   USE Module1
   integer(2) in
   integer indef
   indef = DEFAULT(in)
   END PROGRAM

! procedures sub1 and sub2 defined as follows:
   MODULE Module1
    INTERFACE DEFAULT
      MODULE PROCEDURE Sub1, Sub2
    END INTERFACE
    CONTAINS
      FUNCTION Sub1(y)
        REAL(8) y
        sub1 = REAL(y)
      END FUNCTION
      FUNCTION Sub2(z)
        INTEGER Sub2
        INTEGER(2) z
        sub2 = INT(z)
      END FUNCTION
    END MODULE