arXiv:2611.08060cs.DCNov 2026

Manuscript Offprint

arXiv:2611.08060

xDSL-CCPP: An alternative code generator for atmospheric modelling

Nick Brown, John Dennis

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Nick Brown¹[0000-0003-2925-7275] and John Dennis²[0000-0002-2119-8242]

¹ EPCC at the University of Edinburgh, Edinburgh, UK ² National Center for Atmospheric Research (NCAR), Boulder, USA

Abstract. The Common Community Physics Package (CCPP) is a framework designed to simplify the exchange of physics packages between state-of-the-art atmospheric models. A core software component of CCPP is a code generator: a bespoke Python-based application that uses regular expressions to transform an input specification into Fortran source code. While the code generator initially provided a simple transformation capability, the demands of state-of-the-art atmospheric models have resulted in significant increases in its complexity. Furthermore, ongoing code modernisation efforts to enable GPU-based computing have placed additional demands on the code generator for which it was never designed. Domain Specific Languages (DSLs) have proven to be highly effective in High Performance Computing (HPC), offering the ability to simplify code modernisation efforts. However, traditionally the effort and specialist skills required in the development of a DSL have been a blocker to adoption. In recent years, however, there have been great advances in compiler technologies, and frameworks such as MLIR and xDSL have the potential to greatly lower this barrier to entry.

In this paper, we present xDSL-CCPP, a new application-specific code generator based upon the latest MLIR and xDSL compiler technologies, for CCPP. Demonstrating a reduction in bespoke tooling code of around three times, from approximately 15,000 LoC to 5,000 LoC, we highlight the opportunities provided by these compiler frameworks and demonstrate how they significantly lower the barrier to development of HPC application-specific DSLs whilst maintaining application performance and promoting flexibility.

Keywords: MLIR, xDSL, Common Community Physics Package, Domain Specific Language (DSL)

1 Introduction

The scientific computing community supports many large scientific code bases that must efficiently utilize modern High Performance Computing (HPC) computers. Frequently, these large scientific code bases contain the contributions of a large number of domain scientists and represent 10 to 100 years of development effort. The rapid advancement of HPC computing architectures typically means that these large scientific code bases are constantly being modernised. In addition

N. Brown and J. Dennis

to the need to evolve for every change computer architecture, these codes are frequently focused on adapting how the end-user will interact with the reworked code. The Common Community Physics Package (CCPP) is one example of this, where the code has recently been modernised to simplify the exchange of physics packages between different climate and weather models. Once a particular physics package has adopted the CCPP interface, it can be easily used by different CCPP-enabled models. However, flexibility of use comes at a cost. Specifically, it is based on a bespoke code generator (capgen) that automatically generates the Fortran interface code. Furthermore, additional files that describe the transformation process and the source code must be maintained.

Effectively, the CCPP is a Domain Specific Language (DSL) in all but name. DSLs have proven to be highly effective; however, arguably, there are two major disadvantages to them that put people off. The first is the word language, which implies that users must learn a new way of expressing their computation and/or configuration which is specific to the application in question. The second is the overhead in developing and maintaining bespoke compiler infrastructure to translate from the DSL to source code. Indeed, CCPP suffers from both of these issues, where configuration is undertaken by XML and metadata files that have grown unwieldy and the underlying Python-based tooling has become complex and difficult to maintain.

In this paper, we describe the development of xDSL-CCPP, which is a DSL for configuring the CCPP framework. Leveraging xDSL, a Python-based compiler framework that follows MLIR-based industry standard abstractions and concepts, we demonstrate that this not only significantly simplifies code generation tooling, but furthermore provides a range of additional opportunities, including embedding the DSL within an existing language that users are already familiar with.

This paper is structured as follows: In Section 2 we explore the background to this work, highlighting the role of CCPP and current code generation approaches along with the MLIR and xDSL compiler technologies. Section 3 then describes our xDSL-CCPP tool, which provides a compiler flow for CCPP code generation, along with exploring how this addresses limitations with the current bespoke approach. Section 4 then compares the code complexity, compile time, and resulting runtime of our approach against the existing approach. Lastly, Section 5 draws conclusions and discusses further work.