IndividualDisplacements.jl: a Julia package to simulate and study particle displacements within the climate system

IndividualDisplacements.jl (Gaël Forget, 2021) is focused on computation and analysis of individual displacements across the global climate system. Individuals is used here as a generic term to represent points, particles, parcels, materials, etc that tend to be carried around the Earth by geophysical fluids (via oceanic currents or atmospheric flows for example). Their displacements, or trajectories, are computed by deriving pointwise velocities from flow fields provided by the user and integrating over time (e.g., Figure 1 and Figure 2).

IndividualDisplacements.jl is thus readily suited to exploit climate model output and other gridded data sets in research projects that involve, for example, tracking plankton communities, heat storage, or plastic garbage patches within the Ocean; or dust, water, or chemical compounds within the Atmosphere. To achieve generality and interpretability, IndividualDisplacements.jl first defines two data structures (FlowFields and Individuals) that allow for simple, flexible user specifications of flow fields, initial positions, etc. It then adds a high-level API such that integrating trajectories for individuals I amounts to a single function call, ∫ ! ( I ).
Internally, the package currently employs OrdinaryDiffEq.jl to integrate particle motions over time (within the ∫ ! ( I ) function call), NetCDF.jl and CSV.jl for I/O, and DataFr ames.jl for diagnostics computed along particle trajectories (within ∫ ! ( I ) or afterwards). The initial test suite (see Gaël Forget, 2021) is based not only on idealized flow fields and toy-models, but also on data-constrained Ocean simulations from the OCCA/ECCO projects (Gaël Forget, 2018, 2010G. Forget et al., 2015), which are also used in marine ecosystem simulations in CBIOMES (Gaël Forget, 2019). The OCCA/ECCO gridded ocean circulation estimates are retrieved from a permanent dataverse archive (Gaël Forget, 2016a, 2016b automatically via the Julia Artifacts system. IndividualDisplacements.jl is also intended to facilitate research involving model-data comparison, data assimilation, or machine learning by providing basic interfaces to other displacement data sets. To start the package provides some support for ingesting (1) data collected in the field by the Global Ocean Drifter Program and Argo array of drifting buoys, and (2) trajectories simulated internally, online, by the MIT general circulation model. The examples folder, which is unit tested upon building the documentation hosted online for each code revision, already covers several common grid cases, two-dimensional and threedimensional flows, steady-state and time-variable flows. It demonstrates interpolation and diagnostics methods, three plotting libraries, and two notebook systems. Minor parameter changes in these examples should suffice to start applying IndividualDisplacements.jl to any other MITgcm simulation of e.g. atmospheric or oceanic turbulence .  Forget, G., (2021). IndividualDisplacements.jl: a Julia package to simulate and study particle displacements within the climate system. Journal of Open Source Software, 6(60), 2813. https://doi.org/10.21105/joss.02813

Statement of need
Lagrangian simulation and analysis frameworks such as IndividualDisplacements.jl have been widely used across scientific domains involved with geophysical fluids for decades; see Pisso et al. (2019) or Van Sebille et al. (2018) for recent reviews in, respectively, oceanography or atmospheric sciences. IndividualDisplacements.jl is most directly related to the MITgcm/flt Fortran package which the author also recently extended . This new Julia package was in fact partly motivated by a need to provide an easier and simpler alternative to using MITgcm/flt in its offline mode in order to handle global grids not readily supported by other packages (G. Forget et al., 2015;Gaël Forget, 2020;Rousselet et al., 2020).
IndividualDisplacements.jl notably aims to provide a bridge between the vast community of domain experts, who are typically used to older languages like Fortran, C, Matlab, or Python, and the rapidly growing Julia community and package ecosystem. Julia's native parallelism, GPU support, custom array types, differential programming tools, and plotting libraries indeed all offer great new opportunities for exploiting state of the art HPC climate model simulations and the large data sets that they routinely generate.
The development of IndividualDisplacements.jl was motivated not just by our scientific needs and ongoing research projects (see below) but also by the need for more effective tools for climate education, citizen science, and advocacy. In the documentation and examples folder, this is highlighted by the use of unicode in the API, Pluto.jl notebooks, and Makie.jl animations, which showcase Julia's expressivity and reactivity.
IndividualDisplacements.jl readily supports all common MITgcm grids and configurations via MeshArrays.jl and MITgcmTools.jl (incl. Ocean, Atmosphere, sea-ice, bio-geochemistry, and ecology). This, by itself, yields a large pool of potential scientific applications and expected users; including via the various ongoing research projects that rely on adjointoptimized, data-constrained solutions from the OCCA/ECCO projects (Gaël Forget, 2010;G. Forget et al., 2015).
At this stage, IndividualDisplacements.jl is considered production-ready, such that we could immediately start transferring several ongoing research collaborations that use MITgcm and ECCO (Gaël Forget & Ferreira, 2019;Rousselet et al., 2020) from Fortran to Julia. Extension to other models may start with MERRA2 / MITgcm coupled model runs (Strobach et al., 2020) and near-term applications could also include data assimilation to better simulate plastic garbage patches (Peytavin et al., 2021).
The documentation of IndividualDisplacements.jl is also now considered sufficient for welcoming additional contributors. Integration with Julia packages developed in JuliaClima te, JuliaOcean, JuliaGeo, JuliaStats, JuliaDynamics, and other relevant organizations is thus expected to intensify moving forward.