Skip to contents

The Aquatic Ecosystem Model Ensemble (AEME) package allows you to setup and run an ensemble of aquatic ecosystem models. The models are DYRESM-CAEDYM, GLM-AED, GOTM-WET and Simstrat-AED2.

Development

This package was developed by LimnoTrack as part of the Lake Ecosystem Research New Zealand Modelling Platform (LERNZmp) project. LimnoTrack website

Installation

You can install AEME from GitHub with:

# install.packages("devtools")
devtools::install_github("limnotrack/AEME")

Model executables are no longer bundled with the AEME package. You will need to install the models after downloading.

Model availability by operating system:

Model Windows MacOS Linux
DYRESM-CAEDYM ✅ ❌ ❌
GLM-AED ✅ ✅ ✅
GOTM-WET ✅ ❌ ❌
Simstrat-AED2 ✅ ✅ ✅

Example

This is a basic example which shows you how to build and run one of the models in the ensemble:

library(AEME)
## basic example code
tmpdir <- tempdir()
aeme_dir <- system.file("extdata/lake/", package = "AEME")
# Copy files from package into tempdir
file.copy(aeme_dir, tmpdir, recursive = TRUE)
path <- file.path(tmpdir, "lake")
aeme <- yaml_to_aeme(path = path, "aeme.yaml")
model_controls <- get_model_controls(use_bgc = TRUE)
model <- c("dy_cd", "glm_aed", "gotm_wet", "simstrat_aed2")
aeme <- build_aeme(path = path, aeme = aeme, model = model,
                            model_controls = model_controls,
                            ext_elev = 5, use_bgc = TRUE)
aeme <- run_aeme(aeme = aeme, model = model, verbose = FALSE, 
                      path = path, parallel = TRUE)

The model input and output is handled as it’s own S4 object of class aeme. This allows for the standardisation and generalisation of functions for this class alongside ensuring integrity and validity to it’s structure.

class(aeme)
#> [1] "Aeme"
#> attr(,"package")
#> [1] "AEME"

This allows for easier handling of the model output data within our structure and allows for condensed output to be printed to the console:

aeme
#> 
#> ── AEME ────────────────────────────────────────────────────────────────────────
#> 
#> ── Lake ──
#> 
#> Wainamu (ID: LID45819)
#> • Lat: -36.89; Lon: 174.47
#> • Elev: 23.64m; Depth: 13.07m; Area: 152343 m2
#> 
#> ── Time ──
#> 
#> • Start: 2020-08-01; Stop: 2021-06-30; Time step: 3600
#> • Spin up (days): GLM: 2; GOTM: 1; DYRESM: 1; Simstrat: 2
#> 
#> ── Configuration ──
#> 
#> • Model: dy_cd, glm_aed, gotm_wet, and simstrat_aed2
#> • Path: 'C:\Users\mooret\AppData\Local\Temp\RtmpCYtUii\lake'
#> • Model controls: Present
#> • Use biogeochemical model: Yes
#> ┌ Model Configuration ─────────────────────────────────────────┐
#> │       Model              Physical         Biogeochemical     │
#> │ ---                                                          │
#> │       DY-CD              Present             Present         │
#> │      GLM-AED             Present             Present         │
#> │      GOTM-WET            Present             Present         │
#> │   SIMSTRAT-AED2          Present             Present         │
#> └──────────────────────────────────────────────────────────────┘
#> 
#> ── Observations ──
#> 
#> • Lake: Present; Level: Present
#> 
#> ── Input ──
#> 
#> • Initial profile: Present; Initial depth: 13.07m
#> • Hypsograph: Present (n=44)
#> • Meteo: Present; Use longwave: TRUE; Kw: 1.31
#> 
#> ── Inflows ──
#> 
#> • Number of inflows: 1; Names: FWMT
#> • Scaling factors: DY-CD: 1; GLM-AED: 1; GOTM-WET: 1; Simstrat-AED2: 1
#> 
#> ── Outflows ──
#> 
#> • Number of outflows: 2; Names: outflow, wbal; Elevations: -1, -1
#> • Scaling factors: DY-CD: 1; GLM-AED: 1; GOTM-WET: 1; Simstrat-AED2: 1
#> 
#> ── Water Balance ──
#> 
#> • Method: 2; Use: obs
#> • Modelled: Absent; Water balance: Present
#> 
#> ── Parameters ──
#> 
#> • Number of parameters: 0
#> 
#> ── Output ──
#> 
#> • DY-CD: 1
#> • GLM-AED: 1
#> • GOTM-WET: 1
#> • SIMSTRAT-AED2: 1
#> • Variables: 44
#> Water temperature, Thermocline depth, Dissolved oxygen, Total chlorophyll a,
#> Total nitrogen, Total phosphorus, Water level, Lake depth, Water density,
#> Stratified, ... and 34 more

Model data can be visualised easily using the plot_output() function:

p1 <- plot_output(aeme = aeme, var_sim = "HYD_temp")
p1

Also, visualising lake level plots.

p2 <- plot_wlev(aeme = aeme)
p2

Documentation

We have a host of vignettes to help you get started with AEME:

Model-specific and use-case articles (GLM-AED, Simstrat-AED2, water balance calibration, and more) are listed under Articles on the package website.

Extension

  • aemetools - For downloading meteorological data, calibration and sensitivity analysis.
  • bathytools - For processing lake bathymetry data.
  • ltapi - For querying LimnoTrack’s lake and water quality API.