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

Generic Bindings

User-defined I/O procedures can be type-bound procedures that use a defined-io-generic-spec (see Defined IO Procedures).

Consider the following:

TYPE LIST
TYPE(NODE), POINTER :: FIRST
CONTAINS
PROCEDURE :: FMTREAD => LIST_FMTREAD
PROCEDURE :: FMTWRITE => LIST_FMTWRITE
GENERIC,PUBLIC :: READ(FORMATTED) => FMTREAD 
GENERIC,PUBLIC :: WRITE(FORMATTED) => FMTWRITE
END TYPE LIST

In the above example, LIST_FMTREAD and LIST_FMTWRITE are the type-bound defined I/O procedures. If an object of type LIST is an effective item in a formatted READ statement, LIST_FMTREAD will be called to perform the read operation.