skip to main content

SciTech ConnectSciTech Connect

Title: Emulating Multiple Inheritance in Fortran 2003/2008

Although the high-performance computing (HPC) community increasingly embraces object-oriented programming (OOP), most HPC OOP projects employ the C++ programming language. Until recently, Fortran programmers interested in mining the benefits of OOP had to emulate OOP in Fortran 90/95. The advent of widespread compiler support for Fortran 2003 now facilitates explicitly constructing object-oriented class hierarchies via inheritance and leveraging related class behaviors such as dynamic polymorphism. Although C++ allows a class to inherit from multiple parent classes, Fortran and several other OOP languages restrict or prohibit explicit multiple inheritance relationships in order to circumvent several pitfalls associated with them. Nonetheless, what appears as an intrinsic feature in one language can be modeled as a user-constructed design pattern in another language. The present paper demonstrates how to apply the facade structural design pattern to support a multiple inheritance class relationship in Fortran 2003. The design unleashes the power of the associated class relationships for modeling complicated data structures yet avoids the ambiguities that plague some multiple inheritance scenarios.
  1. Sandia National Laboratories, 7011 East Avenue, Livermore, CA 94550-9610, USA
Publication Date:
OSTI Identifier:
Grant/Contract Number:
Published Article
Journal Name:
Scientific Programming
Additional Journal Information:
Journal Volume: 2015; Related Information: CHORUS Timestamp: 2016-07-27 10:59:28; Journal ID: ISSN 1058-9244
Hindawi Publishing Corporation
Sponsoring Org:
Country of Publication: