Approach: A class is built by combining a derived type definition with the methods which work on that type. Static class members are emulated by adding data to the module. Encapsulation of any of these elements is directly supported. Polymorphism is implemented by ordinary function overloading, since objects are ordinary arguments. Class composition is directly supported, while simple inheritance is implemented as a special case of class composition. Full subtyping is emulated by means of a special subtype class, which contains a structure of pointers and a dispatch table for each class method.
Accomplishments: Object-oriented versions of plasma particle-in-cell (PIC) codes have been written for parallel computers using both Fortran90 and C++. The functionality of the languages and their performance were compared. In general, most object-oriented features useful for PIC codes were easily modeled in Fortran90, and the performance of the Fortran90 codes was always better than the C++ code, often by a factor of two .
Status/Future Plans: The current work has not focused on the performance penalty for using abstractions. The future work will try to determine what constructs in Fortran90 enhance or degrade performance.
Point of contact:
Viktor K. Decyk, JPL