首页    期刊浏览 2024年11月24日 星期日
登录注册

文章基本信息

  • 标题:Formula Translation in Blitz++, NumPy and Modern Fortran: A Case Study of the Language Choice Tradeoffs
  • 本地全文:下载
  • 作者:Sylwester Arabas ; Dorota Jarecka ; Anna Jaruga
  • 期刊名称:Scientific Programming
  • 印刷版ISSN:1058-9244
  • 出版年度:2014
  • 卷号:22
  • 期号:3
  • 页码:201-222
  • DOI:10.1155/2014/870146
  • 出版社:Hindawi Publishing Corporation
  • 摘要:

    Three object-oriented implementations of a prototype solver of the advection equation are introduced. The presented programs are based on Blitz++ (C++), NumPy (Python) and Fortran's built-in array containers. The solvers constitute implementations of the Multidimensional Positive-Definite Advective Transport Algorithm (MPDATA). The introduced codes serve as examples for how the application of object-oriented programming (OOP) techniques and new language constructs from C++11 and Fortran 2008 allow to reproduce the mathematical notation used in the literature within the program code. A discussion on the tradeoffs of the programming language choice is presented. The main angles of comparison are code brevity and syntax clarity (and hence maintainability and auditability) as well as performance. All performance tests are carried out using free and open-source compilers. In the case of Python, a significant performance gain is observed when switching from the standard interpreter (CPython) to the PyPy implementation of Python. Entire source code of all three implementations is embedded in the text and is licensed under the terms of the GNU GPL license.

  • 关键词:Object-oriented programming; advection equation; MPDATA; C++; Fortran; Python
国家哲学社会科学文献中心版权所有