Read model outputs and format to AEME standard
Usage
read_model_outputs(
nc = NULL,
lake_dir,
model,
vars_sim = NULL,
depths = NULL,
dates = NULL,
date_index = NULL,
incl_fluxes = TRUE,
output_hour = 0,
phyto_pars = NULL,
load_all = TRUE,
use_dat = NULL,
daily_mean = FALSE,
extra_vars = NULL,
sed_layers = NULL,
zone_summary = FALSE
)Arguments
- nc
Open netCDF object. If NULL, will open netCDF from lake_dir. This is useful when reading multiple variables from the same file to avoid reopening the file multiple times. Defaults to NULL.
- lake_dir
Directory of lake model outputs
- model
Model name. One of "gotm_wet", "glm_aed", or "dy_cd".
- vars_sim
Variables to extract in the AEME format e.g. "HYD_temp"
- depths
Depths to extract. If NULL, extract all model layer depths. Defaults to NULL.
- dates
Dates to extract. If NULL, extract all dates. Defaults to NULL.
- date_index
Date index to extract. If NULL, extract all dates. Defaults to NULL.
- incl_fluxes
Logical indicating whether to include flux variables. Defaults to TRUE.
- output_hour
Hour of the day to extract (0-23). Defaults to 0.
- phyto_pars
Dataframe of phytoplankton parameters for GLM-AED model. See
?read_glm_outputfor details. Defaults to NULL.- load_all
logical; for
model = "glm_aed", also load every other variable present in the netCDF output beyond the declaredvars_simset – see?read_glm_output. Ignored for other models. Defaults to TRUE.- use_dat
logical; for the Simstrat models only, read Simstrat's own
<var>_out.dattext output viaread_simstrat_datinstead of the consolidatedoutput.nc. Every other argument means the same thing either way, so this only changes where the numbers are read from.TRUEis the faster path – it skips the netCDF entirely, and withload_all = FALSEreads only the files the requestedvars_simneed, which is what a calibration wants. Defaults toNULL: readoutput.ncwhen there is one, and fall back to the text output when there is not (a run whose output was never converted, or converted withwrite_simstrat_nc(remove_dat = FALSE)and the netCDF since removed). Ignored whenncis supplied.- daily_mean
logical; when
TRUE, return one record per calendar day. If a model's daily-meanoutput_daily.nccompanion is present (GOTM writes one natively; GLM-AED and Simstrat get one fromrun_aeme()whentime(aeme)$output_daily_meanisTRUE) it is read directly; otherwise the raw sub-dailyoutput.ncis read and averaged by calendar day. Defaults toFALSE. Seeset_output_time_step.- extra_vars, sed_layers, zone_summary
for
model = "glm_aed", which sediment/flux/diagnostic variables to read and how to reduce them – see?read_glm_output. Ignored for other models.
