Reuse legacy RGA/GAR configuration files
Create model from RGA/GAR files
Unlike rameau that relies on a TOML configuration file, previous
(legacy) versions of the Gardenia model relied on configuration files
with custom extensions *.rga and *.gar.
In order to guarantee backward compatibility with older versions of GARDENIA,
there is a utility that allows to create a Model from those files.
import rameau.utils as rmu
model = rmu.create_model_from_rga_gar(
'model.rga', 'model.gar', gardenia_version='8.8.1'
)
Run a simulation
Once the Model instance is created, it will behave exactly as if it
was created from a TOML configuration file. For example, we can run a
simulation and plot the outputs.
sim = model.run_simulation()
ax = sim.get_output('riverflow').plot(ylabel='streamflow [m$^3$.s$^{-1}$]')
Matplotlib is building the font cache; this may take a moment.
ax = sim.get_output('watertable').plot(ylabel='piezometric level [m]')