Geoscientific Model Development (Aug 2018)

Veros v0.1 – a fast and versatile ocean simulator in pure Python

  • D. Häfner,
  • R. L. Jacobsen,
  • C. Eden,
  • M. R. B. Kristensen,
  • M. Jochum,
  • R. Nuterman,
  • B. Vinter

DOI
https://doi.org/10.5194/gmd-11-3299-2018
Journal volume & issue
Vol. 11
pp. 3299 – 3312

Abstract

Read online

A general circulation ocean model is translated from Fortran to Python. Its code structure is optimized to exploit available Python utilities, remove simulation bottlenecks, and comply with modern best practices. Furthermore, support for Bohrium is added, a framework that provides a just-in-time compiler for array operations and that supports parallel execution on both CPU and GPU targets.For applications containing more than a million grid elements, such as a typical 1° × 1° horizontal resolution global ocean model, Veros is approximately half as fast as the MPI-parallelized Fortran base code on 24 CPUs and as fast as the Fortran reference when running on a high-end GPU. By replacing the original conjugate gradient stream function solver with a solver from the pyAMG Python package, this particular subroutine outperforms the corresponding Fortran version by up to 1 order of magnitude.The study is concluded with a simple application in which the North Atlantic wave response to a Southern Ocean wind perturbation is investigated. It is found that even in a realistic setting the phase speeds of boundary waves matched the expectations based on theory and idealized models.