Older Aeme objects – loaded from .rds files written by a previous
version of AEME – can be missing list elements, use since-renamed slot
names, or carry data frames with an older column layout. Most of the
package tolerates this, but some code paths (and build_aeme() in
particular) assume the current layout.
upgrade_aeme() applies every structural migration AEME knows about, in
order, each one idempotent so the function is safe to run repeatedly. It
does not rebuild model configuration
(configuration$<model>$hydrodynamic) or model output – those only come
from build_aeme() / run_aeme(). Run upgrade_aeme() first, then
rebuild if you need the model files refreshed.
Migrations applied (see also migrate_aeme(), the silent worker):
time$spin_up,inflows$factor,outflows$factor,configuration: backfill entries for models added to AEME after the object was created (e.g.simstrat_aed2,simstrat_aed).outflows: rename the legacylvl/outflow_lvlelement toelevation.output: add aNULLplaceholder per model and coercen_membersto integer.observations$level: coerce a legacy tibble to a plain data frame and ensure avar_aemecolumn.observations$lake: collapse the legacydepth_from/depth_tocolumn pair to a singledepthcolumn (interval midpoint), keepingdepth_toonly where it records a genuine integrated sample.observations$lake/observations$level: convert aDateDatecolumn to noon-anchored UTCPOSIXct(<date> 12:00:00), so daily observations match a sub-daily model axis unambiguously.configuration: backfill scalar build defaults (ext_elev,calc_wbal,wb_method,calc_wlev,hum_type,est_swr_hr,use_bgc) fromconfig_defaults().parameters: reorder columns toparam_colnames()order.
Value
The Aeme object, migrated to the current layout, with
configuration$aeme_upgraded set to the installed AEME version.
