6.7 FORmula TRANslation redefined - a case study implementing the MPDATA advection scheme using OOP techniques

Tuesday, 8 January 2013: 4:45 PM
Room 12B (Austin Convention Center)
Dorota Jarecka, University of Warsaw, Warsaw, Poland; and S. Arabas, M. Fijalkowski, and A. Jaruga

In the paper we compare object-oriented implementations of the Multidimensional Positive-Definite Advective Transport Algorithm (MPDATA) written in Python, C++ and modern FORTRAN. We compare how the choice of a particular language influences the performance, syntax clarity, and code length.

Application of object-oriented programming (OOP) techniques in the development of numerical modeling software may help to (i) maintain modularity and separation of program logic layers, and (ii) shorten and simplify the source code and improve its readability by reproducing within the program logic the mathematical abstractions and notation used in the literature. The first application is attainable, yet arguably cumbersome, with procedural programming. The latter of the two applications, virtually impossible to obtain with procedural programming, is the focus of this paper. Application of OOP techniques to match the mathematical notation in the code has the potential to significantly improve code auditability and maintainability.

The presented Python implementation of MPDATA is based on NumPy. Its performance is compared with C++/Blitz++ and FORTRAN implementations. A notable performance gain when switching from the standard CPython to PyPy (which is gradually gaining compatibility with NumPy) will be exemplified, and the reasons for it will be briefly explained.

- Indicates paper has been withdrawn from meeting
- Indicates an Award Winner