MARRMOT_07
Implementation
MARRMoT v2.1.1 rev eeb7e15 m_07_gr4j_4p_2s; standardized continuous structure, not original model
Time step: daily
Backend: octave-cli + Octave optim
Calibrated parameters: 4
Temperature required: no
Parameters and initial configuration
Parameter |
Supported calibration range |
Default |
|---|---|---|
|
1 to 2000 |
1000.5 |
|
-20 to 20 |
0.0 |
|
1 to 300 |
150.5 |
|
0.5 to 15 |
7.75 |
|
Fixed initial/configuration value |
0.0 |
|
Fixed initial/configuration value |
0.0 |
Ranges/defaults are implementation contracts, not universal priors or a recommended basin calibration. Consult source comments for parameter units and coupling.
Governing equations
The following source is the exact model kernel used by this adapter. For MARRMoT it includes the state derivative and each referenced flux function; the solver and routing are described above. Original notices and source citations are retained in the files.
function [dS, fluxes] = model_fun(obj, S)
% parameters
theta = obj.theta;
x1 = theta(1); % Maximum soil moisture storage [mm]
x2 = theta(2); % Water exchange coefficient [mm/d]
x3 = theta(3); % Maximum routing store storage [mm]
x4 = theta(4); % Flow delay [d]
% delta_t
delta_t = obj.delta_t;
% unit hydrographs and still-to-flow vectors
uhs = obj.uhs;
uh_q9 = uhs{1};
uh_q1 = uhs{2};
% stores
S1 = S(1);
S2 = S(2);
% climate input
t = obj.t; % this time step
climate_in = obj.input_climate(t,:); % climate at this step
P = climate_in(1);
Ep = climate_in(2);
T = climate_in(3);
% fluxes functions
flux_pn = max(P-Ep,0);
flux_en = max(Ep-P,0);
flux_ef = P - flux_pn;
flux_ps = saturation_4(S1,x1,flux_pn);
flux_es = evap_11(S1,x1,flux_en);
flux_perc = percolation_3(S1,x1);
flux_q9 = route(.9.*(flux_pn - flux_ps + flux_perc), uh_q9);
flux_q1 = route(.1.*(flux_pn - flux_ps + flux_perc), uh_q1);
flux_fr = recharge_2(3.5,S2,x3,x2);
flux_fq = flux_fr;
flux_qr = baseflow_3(S2,x3);
flux_qt = flux_qr + max(flux_q1 + flux_fq,0);
% this flux is not included in original MARRMoT,
% but it is useful to calculate the water balance
flux_ex = flux_fr + max(flux_q1 + flux_fq,0) - flux_q1;
% stores ODEs
dS1 = flux_ps - flux_es - flux_perc;
dS2 = flux_q9 + flux_fr - flux_qr;
% outputs
dS = [dS1 dS2];
fluxes = [flux_pn, flux_en, flux_ef, flux_ps, flux_es,...
flux_perc, flux_q9, flux_q1, flux_fr, flux_fq,...
flux_qr, flux_qt, flux_ex];
end
% STEP runs at the end of every timestep.
function [out] = saturation_4(S,Smax,In)
%saturation_4
% Copyright (C) 2019, 2021 Wouter J.M. Knoben, Luca Trotter
% This file is part of the Modular Assessment of Rainfall-Runoff Models
% Toolbox (MARRMoT).
% MARRMoT is a free software (GNU GPL v3) and distributed WITHOUT ANY
% WARRANTY. See <https://www.gnu.org/licenses/> for details.
% Flux function
% ------------------
% Description: Saturation excess from a store with different degrees of
% saturation (quadratic variant)
% Constraints: f >= 0
% @(Inputs): S - current storage [mm]
% Smax - maximum storage [mm]
% In - incoming flux [mm/d]
out = max(0,(1-(S/Smax).^2).*In);
end
function [out] = evap_11(S,Smax,Ep)
%evap_11
% Copyright (C) 2019, 2021 Wouter J.M. Knoben, Luca Trotter
% This file is part of the Modular Assessment of Rainfall-Runoff Models
% Toolbox (MARRMoT).
% MARRMoT is a free software (GNU GPL v3) and distributed WITHOUT ANY
% WARRANTY. See <https://www.gnu.org/licenses/> for details.
% Flux function
% ------------------
% Description: Evaporation quadratically related to current soil moisture
% Constraints: f >= 0
% @(Inputs): S - current storage [mm]
% Smax - maximum storage [mm]
% Ep - potential evapotranspiration rate [mm/d]
out = max(0,(2*S/Smax-(S/Smax)^2)*Ep);
end
function [out] = percolation_3(S,Smax)
%percolation_3
% Copyright (C) 2019, 2021 Wouter J.M. Knoben, Luca Trotter
% This file is part of the Modular Assessment of Rainfall-Runoff Models
% Toolbox (MARRMoT).
% MARRMoT is a free software (GNU GPL v3) and distributed WITHOUT ANY
% WARRANTY. See <https://www.gnu.org/licenses/> for details.
% Flux function
% ------------------
% Description: Non-linear percolation (empirical)
% Constraints: -
% @(Inputs): S - current storage [mm]
% Smax - maximum contributing storage [mm]
out = Smax^(-4)./(4)*(4/9)^(4)*S^5;
end
function [ flux_out ] = route(flux_in, uh)
% ROUTE calculates the output of a unit hydrograph at the current timestep
% after routing a flux through it.
% Copyright (C) 2019, 2021 Wouter J.M. Knoben, Luca Trotter
% This file is part of the Modular Assessment of Rainfall-Runoff Models
% Toolbox (MARRMoT).
% MARRMoT is a free software (GNU GPL v3) and distributed WITHOUT ANY
% WARRANTY. See <https://www.gnu.org/licenses/> for details.
% In:
% flux_in - input flux [1x1]
% uh - unit hydrograph [nx2]
% uh's first row contains coeficients to splut flow at each
% of n timesteps forward, the second row contains
% still-to-flow values.
%
% Out:
% flux_out - flux routed through the uh at this step [1x1]
%
flux_out = uh(1,1) * flux_in + uh(2,1);
end
function [out] = recharge_2(p1,S,Smax,flux)
%recharge_2
% Copyright (C) 2019, 2021 Wouter J.M. Knoben, Luca Trotter
% This file is part of the Modular Assessment of Rainfall-Runoff Models
% Toolbox (MARRMoT).
% MARRMoT is a free software (GNU GPL v3) and distributed WITHOUT ANY
% WARRANTY. See <https://www.gnu.org/licenses/> for details.
% Flux function
% ------------------
% Description: Recharge as non-linear scaling of incoming flux
% Constraints: S >= 0
% @(Inputs): p1 - recharge scaling non-linearity [-]
% S - current storage [mm]
% Smax - maximum contributing storage [mm]
% flux - incoming flux [mm/d]
out = flux*((max(S,0)/Smax)^p1);
end
function [out] = baseflow_3(S,Smax)
%baseflow_3
% Copyright (C) 2019, 2021 Wouter J.M. Knoben, Luca Trotter
% This file is part of the Modular Assessment of Rainfall-Runoff Models
% Toolbox (MARRMoT).
% MARRMoT is a free software (GNU GPL v3) and distributed WITHOUT ANY
% WARRANTY. See <https://www.gnu.org/licenses/> for details.
% Flux function
% ------------------
% Description: Empirical non-linear outflow from a reservoir
% Constraints: None specified
% @(Inputs): S - current storage [mm]
% Smax - maximum contributing storage [mm]
out = Smax^(-4)/(4)*(S^5);
end
Note
This standardized MARRMoT structure is not identical to the original named model. p01... follow exact source order; s01... are fixed initial stores, defaulting to zero. Octave + optim are required. Solver behavior can differ across runtime versions.
Simulation
from basinforge import Basin, get_model
basin = Basin.from_csv("basin.csv", basin_id="A", area_km2=1200,
q_unit="m3/s", timestep="daily")
q_mm = get_model("MARRMOT_07").simulate(basin)
q_m3s = basin.to_m3s(q_mm)
Supply your actual data and catchment area; temperature-dependent models require a temperature column. For non-daily models, choose an appropriate warmup in model steps.
See calibration, input requirements, sources and verification limitations.