2.3 Python bindings for atmospheric numerical models

Monday, 11 January 2016: 1:45 PM
Room 225 ( New Orleans Ernest N. Morial Convention Center)
Dorota Jarecka, University of Warsaw / NCAR, Boulder, CO; and S. Arabas and D. Del Vento

In the presentation I will introduce the Python bindings for the libcloudph++ library (http://libcloudphxx.igf.fuw.edu.pl/). The libcloudph++ is a C++ library of algorithms for representing atmospheric cloud physics in numerical models and the bindings expose the complete functionality of the library to the Python users. The main goals of writing the Python bindings are to facilitate the use of the C++ library by scientists and students, and to allow to access the library from other languages used in atmospheric science, e.g. Fortran.

The bindings to libcloudph++ allow using the library from Python, without requiring the user to interact with the native C++ interface. They are implemented using the Boost.Python C++ library and NumPy arrays. The Python bindings significantly facilitate the use of the library and add relatively little runtime overhead. Python has simpler syntax than C++, it is known to be an efficient “glue” language for coupling codes written in different programming languages, and it is already widespread across the atmospheric science community. Arguably, the embraced approach makes the best out of salient features of two languages. C++ is used for implementing numerically-intensive concurrency-enabled algorithms for both CPU and GPU. Python is used for equipping the library with rapid-development features and for interfacing with other languages.

In my presentation I will present the main concept of the bindings using Boost.Python, examples of use of selected library components from Python environment. I will also cover an example solution for using the Python bindings to access libcloudph++ from Fortran.

The talk will cover the content described in a technical note http://arxiv.org/abs/1504.01161.

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