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/a1dabdcd51408d3f02d939d936bd15aab339b6ff2e0105951aed81018cc8d28d.png
ax = sim.get_output('watertable').plot(ylabel='piezometric level [m]')
../../../_images/a2944b23a95a1585ba1a1c5fe9378a1b76a6387dbfb9813a8b6de6a6dc8d0431.png