Numerical weather prediction and climate models like COSMO and ICON solve a large set of Partial Differential Equations using stencil computations on structured grids. Over the past years the dynamical core of COSMO has been ported to NVIDIA GPUs using a domain specific language (DSL), STELLA, which provides optimal performance for multiple computing architectures while retaining a single source code. The DSL allows to describe PDE operators with a concise syntax, closed to its discretized mathematical description, increasing readability by hiding the complexity of loops and hardware dependent optimizations. A significant performance speedup was obtained for dynamical core of COSMO, ported to GPU, as reported in doi>10.1145/2807591.2807676.
The DSL is currently used in preproduction at Meteoswiss in a GPU based supercomputer for a 1 km resolution and ensemble weather forecasts using COSMO. The GridTools (C++) library emerges as an effort to generalize the DSL to other models in the weather and climate community as well as geophysical applications, and other grids. A special focus of the library is put on next generation global weather models, like the ICON model. Among other generalizations, GridTools supports any number of field dimensions, and was extended to cover a wider range of numerical methods, like Finite Elements or Discontinuous Galerkin methods (in addition to Finite Differences employed in COSMO).
The DSL language is also used to obtain performance portable code for dynamical cores on non curvilinear grids. Normally these codes make use of indirect indexing of fields, which increases the complexity of loop implementation of the PDE operators, and at the same time that decreases readability. GridTools hides the complexity of the grid, and at the same time is capable of exploiting the structure of grids like the icosahedral grid in order to improve the performance. The library makes use of modern C++11 designs and is highly modular in order to reuse code components for multiple grids and type of stencil applications
Here we present the language designed in GridTools for icosahedral/octahedral grids and we evaluate it with some characteristic operators of the ICON model. Performance is evaluated for NVIDIA GPUs and compared to current ICON kernels parallelized for x86 platforms with OpenMP.