
Set outflow data for a GLM-AED simulation directory
Source:R/set_glm_outflows.R
set_glm_outflows.RdThin, aeme-free wrapper around the internal outflow writer used by
build_aeme(). Writes one boundary-condition csv per outflow into
path_glm/bcs and updates the &outflow block of the GLM nml file.
Basin geometry (bathy, dims_lake) needed to size the outlets is read
from the existing &morphometry block by default, so an existing
GLM-AED configuration can have its outflows edited without a lake
shapefile.
Usage
set_glm_outflows(
path_glm,
outf,
heights_wdr,
outlet_type = NULL,
flt_off_sw = NULL,
bathy = NULL,
dims_lake = NULL,
wdr_factor = 1,
glm_file = find_glm_nml(path_glm)
)Arguments
- path_glm
filepath; to GLM-AED directory (containing the nml file and a
bcs/subdirectory)- outf
named list of data.frames, one per outflow, each with a
Datecolumn and a flow column (HYD_flow, oroutflowfor a"wbal"water-balance outflow) – seeadd_outflows()for the expected schema.- heights_wdr
named numeric vector; outlet elevation (m) for each name in
outf.- outlet_type
named numeric vector; GLM outlet type per outflow (see the GLM manual). Defaults to
1(fixed height) for every outflow.- flt_off_sw
named logical vector; floating offtake switch per outflow. Defaults to
FALSEfor every outflow.- bathy
data.frame with
elev/areacolumns describing the lake hypsograph, used to size the outlet. Defaults to theH/Aarrays already in the GLM nml's&morphometryblock.- dims_lake
numeric vector of length 2,
c(basin_length, basin_width)at the crest. Defaults to thebsn_len/bsn_widvalues already in the GLM nml's&morphometryblock.- wdr_factor
numeric; scaling factor applied to all outflow flow rates. Default is
1.- glm_file
filepath; path to the GLM hydrodynamic nml file to update. Defaults to the file found in
path_glmviafind_glm_nml().