Fortran 77 Version of Fisher & Mitchell Examples | Fortran 90 Version of Fisher & Mitchell Examples |
View with button1 or down-load with button3 |
The following examples are from the appendices of:
Description of Examples | Source Code |
Appendix A: This example shows how to encapsulate an old, ugly, but fast library FFT to increase program safety and ease of use. | One-Dimensional FFT Module |
Appendix B: Shows how to encapsulate a new type and a particle pushing operation in a Fortran 90 module. This simplifies the interface to the original, complicated, but efficient particle pushing routine. | Species Module |
Appendix C: An example showing how to construct classes using Fortran 90 modules and derived types. Encapsulation and operator overloading are used in defining a complex number class where the data components are private. | Private_Complex Class |
Appendix D: Inheritance using class composition is applied in building private_complex arrays. The derived class was constructed by the definitions and procedures defined in a base class. | Complex_Array Class |
Appendix E: Inheritance using class sub-typing is emulated in building a monitor_complex class. All of the base class procedures have been extended to work in the derived class. | Monitor_Complex Class |
Appendices F & G: This examples introduces improvements and extensions on Appendix B. Information describing a particle species is encapsulated into new class that is "inherited" by a derived species class. | Species Class |
Appendix H: An example of how run-time polymorphism can be supported using a dynamic dispatching approach. (Currently produces incorrect results with the Absoft compiler.) | Complex_Subtype Class |
View with button1 or down-load with button3 |
The following set of examples are for those who are already familiar with the C++ Programming Language. They have been translated from the text:
Document Reference | Source Code |
Lippman, pp. 73-77 | Stack Class |
Lippman, pp. 150-163. | List Class |
Lippman, pp. 277-279 | Word Class |
Lippman, pp. 279-298 | String Class |
View with button1 or down-load with button3 |
Additional examples may be forthcoming.
The original example appears in:
A Comparison of Object-Oriented Programming in Four Modern Languages
R. Henderson and B. Zorn
Software-Practice and Experience, Vol. 24, Num. 11, pp. 1077-1095, Nov. 1994.
The Fortran90 version does not work the DEC, HP, and SGI Compilers. | |
Database Application (Fortran 90 Version) |
Database Application (C++ Version) |
View with button1 or down-load with button3 |
None of these examples work with the SGI Compiler. The "screen class" does not work with HP and the "string class" does not work with SUN's compiler | |
Document Reference | Source Code |
Lippman, pp. 215-238 | Screen Class |
Lippman, pp. 301-319 | String Class |
Lippman, pp. 310-314 | String Iterator Class |
Lippman, pp. 459-468. This example shows how to emulate dynamic dispatching. | Zoo Animal Class |
View with button1 or down-load with button3 |
This section contains an advanced example from the Graham text:
Document Reference | Source Code |
Graham, pp. 299-305. | Expression Tree Example |
Graham, pp. 323-363. | Event-Driven Simulation Example |
View with button1 or down-load with button3 |
Additional examples may be forthcoming.