Keywords
Crop growth model, crop simulation platform, CyML, software reuse, transpiler.
Start Date
16-9-2020 1:40 PM
End Date
16-9-2020 2:00 PM
Abstract
Process-based crop growth models are developed in different programming languages within different modelling platforms using specific design patterns and architectural constraints. Even when modular approaches and reuse techniques are proposed by these platforms, there is little exchange of crop growth model components between them despite theoretical and application interests. To facilitate crop growth model intercomparison and model components exchange, several leading groups in the field have joined to create the Agricultural Model Exchange Initiative (AMEI). Recently, AMEI proposed Crop2ML, a centralized framework of model component exchange and reuse. Crop2ML provides a modular and declarative approach to describe and exchange components independently of the formalism of simulation platforms. It uses CyML, a Cython-derived language with minimum meta-specifications to express algorithms. CyML allows encoding a model behavior through its recurrent equations or mathematical expressions with control structures. We developed a transpiler, i.e. source to source converter, to transform CyML models into either procedural (Fortran), object-oriented (Java, C#, C++), scripting or functional (R, Python) languages. CyML implementation relies on the language specialization pattern: it is a Domain-Specific Embedded Language based on Cython. First, the modeler writes its model into CyML language. Then, an equivalent Abstract Syntax Tree (AST) is produced and transformed into one of the target languages or platforms to take into account platform specificities. We tested our approach with two standalone models of the BioMA platform: a crop energy balance and a wheat phenology component. We implemented these components in CyML and then automatically converted them into different target languages (Java, C++, Python, R, and Fortran). We also exported them into different crop simulation platforms such as BioMA, SimPlace, Record, Stics, DSSAT, and OpenAlea.
Enhancing biophysical processes reuse across multiple crop simulation platforms via CyML language and transformation
Process-based crop growth models are developed in different programming languages within different modelling platforms using specific design patterns and architectural constraints. Even when modular approaches and reuse techniques are proposed by these platforms, there is little exchange of crop growth model components between them despite theoretical and application interests. To facilitate crop growth model intercomparison and model components exchange, several leading groups in the field have joined to create the Agricultural Model Exchange Initiative (AMEI). Recently, AMEI proposed Crop2ML, a centralized framework of model component exchange and reuse. Crop2ML provides a modular and declarative approach to describe and exchange components independently of the formalism of simulation platforms. It uses CyML, a Cython-derived language with minimum meta-specifications to express algorithms. CyML allows encoding a model behavior through its recurrent equations or mathematical expressions with control structures. We developed a transpiler, i.e. source to source converter, to transform CyML models into either procedural (Fortran), object-oriented (Java, C#, C++), scripting or functional (R, Python) languages. CyML implementation relies on the language specialization pattern: it is a Domain-Specific Embedded Language based on Cython. First, the modeler writes its model into CyML language. Then, an equivalent Abstract Syntax Tree (AST) is produced and transformed into one of the target languages or platforms to take into account platform specificities. We tested our approach with two standalone models of the BioMA platform: a crop energy balance and a wheat phenology component. We implemented these components in CyML and then automatically converted them into different target languages (Java, C++, Python, R, and Fortran). We also exported them into different crop simulation platforms such as BioMA, SimPlace, Record, Stics, DSSAT, and OpenAlea.
Stream and Session
false