MARRMOT_27

Implementation

MARRMoT v2.1.1 rev eeb7e15 m_27_tank_12p_4s; standardized continuous structure, not original model

  • Time step: daily

  • Backend: octave-cli + Octave optim

  • Calibrated parameters: 12

  • Temperature required: no

Inspect the exact implementation.

Parameters and initial configuration

Parameter

Supported calibration range

Default

p01

0 to 1

0.5

p02

0 to 1

0.5

p03

0 to 1

0.5

p04

0 to 1

0.5

p05

0 to 1

0.5

p06

0 to 1

0.5

p07

0 to 1

0.5

p08

0 to 1

0.5

p09

1 to 2000

1000.5

p10

0.01 to 0.99

0.5

p11

0.01 to 0.99

0.5

p12

0.01 to 0.99

0.5

s01

Fixed initial/configuration value

0.0

s02

Fixed initial/configuration value

0.0

s03

Fixed initial/configuration value

0.0

s04

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;
            a0 = theta(1);      % Time parameter for drainage 1>2 [d-1]
            b0 = theta(2);      % Time parameter for drainage 2>3 [d-1]
            c0 = theta(3);      % Time parameter for drainage 3>4 [d-1]
            a1 = theta(4);      % Time parameter for surface runoff 1 [d-1]
            
            % auxiliary parameters
            aux_theta   = obj.aux_theta;
            t2 = aux_theta(1);  % Threshold before surface runoff 2 starts [mm]
            t1 = aux_theta(2);  % Threshold before surface runoff 1 starts [mm]
            t3 = aux_theta(3);  % Threshold before intermediate runoff starts [mm]
            t4 = aux_theta(4);  % Threshold before sub-base runoff starts [mm]
            a2 = aux_theta(5);  % Time parameter for surface runoff 2 [d-1]
            b1 = aux_theta(6);  % Time parameter for intermediate runoff 1 [d-1]
            c1 = aux_theta(7);  % Time parameter for sub-base runoff 1 [d-1]
            d1 = aux_theta(8);  % Time parameter for base runoff 1 [d-1]
            
            % delta_t
            delta_t = obj.delta_t;
            
            % stores
            S1 = S(1);
            S2 = S(2);
            S3 = S(3);
            S4 = S(4);
            
            % 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_y1  = interflow_8(S1,a1,t1);
            flux_y2  = interflow_8(S1,a2,t2);
            flux_y3  = interflow_8(S2,b1,t3);
            flux_y4  = interflow_8(S3,c1,t4);
            flux_y5  = baseflow_1(d1,S4);
            flux_e1  = evap_1(S1,Ep,delta_t);
            flux_e2  = evap_1(S2,max(0,Ep-flux_e1),delta_t);
            flux_e3  = evap_1(S3,max(0,Ep-flux_e1-flux_e2),delta_t);
            flux_e4  = evap_1(S4,max(0,Ep-flux_e1-flux_e2-flux_e3),delta_t);
            flux_f12 = recharge_3(a0,S1);
            flux_f23 = recharge_3(b0,S2);
            flux_f34 = recharge_3(c0,S3);
            
            % stores ODEs
            dS1 = P        - flux_e1 - flux_f12 - flux_y1 - flux_y2;
            dS2 = flux_f12 - flux_e2 - flux_f23 - flux_y3;    
            dS3 = flux_f23 - flux_e3 - flux_f34 - flux_y4;
            dS4 = flux_f34 - flux_e4            - flux_y5;
 

            % outputs
            dS = [dS1 dS2 dS3 dS4];
            fluxes = [flux_y1,  flux_y2,  flux_y3,  flux_y4, flux_y5,...
                      flux_e1,  flux_e2,  flux_e3,  flux_e4,... 
                      flux_f12, flux_f23, flux_f34];
        end
        
        % STEP runs at the end of every timestep.
function [out] = interflow_8(S,p1,p2)
%interflow_8 

% 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:  Linear interflow if storage exceeds a threshold
% Constraints:  f = 0 for S < p2
% @(Inputs):    S    - current storage [mm]
%               p1   - time coefficient [d-1]
%               p2   - storage threshold before flow occurs [mm]

out =  max(0,p1*(S-p2));

end
function [out] = baseflow_1(p1,S)
% baseflow_1 

% 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:  Outflow from a linear reservoir
% Constraints:  -
% @(Inputs):    p1   - time scale parameter [d-1]
%               S    - current storage [mm]

out = p1.*S;

end
function [out] = evap_1(S,Ep,dt)
%evap_1 

% 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 at the potential rate
% Constraints:  f <= S/dt
% @(Inputs):    S    - current storage [mm]
%               Ep   - potential evaporation rate [mm/d]
%               dt   - time step size

out = min(S/dt,Ep);

end
function [out] = recharge_3(p1,S)
%recharge_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:  Linear recharge
% Constraints:  -
% @(Inputs):    p1   - time coefficient [d-1]
%               S    - current storage [mm]

out = p1.*S;

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_27").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.