How to 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}$]')
../../../_images/c82af6d238c00303cf3d45ff0ad9827c4c68683ac9ddfe8dfe97b75808d92166.png
ax = sim.get_output('watertable').plot(ylabel='piezometric level [m]')
../../../_images/df396c7861c907abc0cda0a8896d087ecb0dc9d17d48cdb0707e056d66f10326.png