Skip to contents

Read an AEME object from files

Usage

read_aeme_from_files(path)

Arguments

path

Path to the directory containing the AEME files.

aeme

An empty or template AEME object to populate with data.

Value

An AEME object populated with data from the files.

Examples

aeme_file <- system.file("extdata/aeme.rds", package = "AEME")
aeme <- readRDS(aeme_file)
path <- "test_write"
model_controls <- get_model_controls()
aeme <- build_aeme(path = path, aeme = aeme, model = "glm_aed",
model_controls = model_controls)
#> Building simulation for Wainamu [2025-02-19 07:02:57]
#> Using observed water level
#> Missing values in observed water level
#> Using constant water level
#> Correcting water balance using estimated outflows (method = 2).
#> Calculating lake level using lake depth and a sinisoidal function.
#> Warning: cannot create dir 'test_write\45819_wainamu', reason 'No such file or directory'
#> Building GLM3-AED2 model for lake wainamu
#> Copied in GLM nml file
aeme <- run_aeme(aeme = aeme, model = "glm_aed", path = path)
#> Running models... (Have you tried parallelizing?) [2025-02-19 07:02:59]
#> GLM-AED running... [2025-02-19 07:02:59]
#> GLM-AED run successful! [2025-02-19 07:02:59]
#> Model run complete![2025-02-19 07:02:59]
#> Retrieving and formatting temp for model glm_aed
#> Retrieving and formatting salt for model glm_aed
write_aeme_to_files(aeme, path)
aeme_path <- get_lake_dir(aeme = aeme, path = path)
aeme2 <- read_aeme_from_files(aeme_path)