A working guide to spatial mechanistic modelling in Julia. Issue 5 (4th February 2022) - Schouten, Rafael; Baudrot, Virgile; Umina, Paul; Maino, James
Abstract: Models that can predict the dynamics of larger scale ecological processes are increasingly important in a rapidly changing world. The Julia language gives a unique opportunity to produce new, generic tools to develop spatial mechanistic models, and to simultaneously increase their performance, resolution and predictive power. Here, we describe two new Julia software packages, DynamicGrids.jl and Dispersal.jl, that facilitate the development of spatial mechanistic models that are concise, extensible and performant, with several key attributes. First, they allow arbitrary spatially and temporally heterogeneous inputs (e.g. regional climatic data to drive population dynamics). Second, they apply rules to discrete spatial grids, including: (a) single grid cells (e.g. population growth, Allee effects, land‐use change), (b) neighborhoods (e.g. local dispersal); and (c) arbitrary locations (e.g. long‐distance wind dispersal, human‐mediated dispersal). Finally, they allow interactions between multiple grids (e.g. predator–prey models, management/environmental feedbacks). Through in‐line examples, we explore how these properties can be used to develop simple and complex grid‐based mechanistic models that run on both CPUs and GPUs. We demonstrate models of population growth, wind and self‐directed dispersal and host–parasitoid dynamics. We also demonstrate the ease by which custom rules can be combined with rules provided by packages, and the potential for use in other fields and interdisciplinary research. These Julia packages provide concise, extensible and performant tools for a wide range of grid‐based spatial models in ecology and beyond. More broadly, they highlight new opportunities for ecological modelling using the Julia language, with its combination of clear syntax, extensibility from its solution to the expression problem and its performance on CPUs and GPUs.