MARRMOT_28

Implementation

MARRMoT v2.1.1 rev eeb7e15 m_28_xinanjiang_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.49 to 0.49

0.0

p03

0 to 10

5.0

p04

1 to 2000

1000.5

p05

0.01 to 0.99

0.5

p06

0.01 to 0.99

0.5

p07

0.01 to 0.99

0.5

p08

0 to 10

5.0

p09

0 to 1

0.5

p10

0 to 1

0.5

p11

0 to 1

0.5

p12

0 to 1

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;
            aim  = theta(1);     % Fraction impervious area [-]
            a    = theta(2);     % Tension water distribution inflection parameter [-]
            b    = theta(3);     % Tension water distribution shape parameter [-]
            c    = theta(7);     % Fraction of LM for second evaporation change [-]
            ex   = theta(8);     % Free water distribution shape parameter [-]
            ki   = theta(9);     % Free water interflow parameter [d-1]
            kg   = theta(10);    % Free water baseflow parameter [d-1]
            ci   = theta(11);    % Interflow time coefficient [d-1]
            cg   = theta(12);    % Baseflow time coefficient [d-1]
            
            % auxiliary parameters
            aux_theta = obj.aux_theta;
            wmax = aux_theta(1); % Maximum tension water depth [mm]
            smax = aux_theta(2); % Maximum free water depth [mm]
            lm   = aux_theta(3); % Tension water threshold for evaporation change [mm]
            
            % 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_rb = split_1(aim,P);
            flux_pi = split_1(1-aim,P);
            flux_e  = evap_21(lm,c,S1,Ep,delta_t);
            flux_r  = saturation_14(a,b,S1,wmax,flux_pi);
            flux_rs = saturation_2(S2,smax,ex,flux_r);
            flux_ri = saturation_2(S2,smax,ex,S2*ki);
            flux_rg = saturation_2(S2,smax,ex,S2*kg);
            flux_qs = flux_rb + flux_rs;
            flux_qi = interflow_5(ci,S3);
            flux_qg = baseflow_1(cg,S4);
            
            % stores ODEs
            dS1 = flux_pi - flux_e  - flux_r;
            dS2 = flux_r  - flux_rs - flux_ri - flux_rg;
            dS3 = flux_ri - flux_qi;
            dS4 = flux_rg - flux_qg;
            
            % outputs
            dS = [dS1 dS2 dS3 dS4];
            fluxes = [flux_rb flux_pi flux_e  flux_r  flux_rs ...
                      flux_ri flux_rg flux_qs flux_qi flux_qg];
        end
        
        % STEP runs at the end of every timestep
function [out] = split_1(p1,In)
%split_1 flow splitting

% 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:  Split flow (returns flux [mm/d])
% Constraints:  -
% @(Inputs):    p1   - fraction of flux to be diverted [-]
%               In   - incoming flux [mm/d]

out = p1.*In;

end
function [out] = evap_21(p1,p2,S,Ep,dt)
%evap_21 

% 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:  Threshold-based evaporation with constant minimum rate
% Constraints:  f <= S/dt
% @(Inputs):    p1   - wilting point (1st threshold) [mm]
%               p2   - 2nd threshold as fraction of wilting point [-]
%               S    - current storage [mm]
%               Ep   - potential evapotranspiration rate [mm/d]
%               dt   - time step size [d]

out = min(max(p2,min(S./p1,1)).*Ep,S./dt);

end
function [out] = saturation_14(p1,p2,S,Smax,In)
%saturation_14 

% 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 flow from a store with different degrees 
%               of saturation (two-part exponential variant)
% Constraints:  -
% @(Inputs):    p1   - fraction of area where inflection point is [-]
%               p2   - exponential scaling parameter [-]
%               S    - current storage [mm]
%               Smax - maximum contributing storage [mm]
%               In   - incoming flux [mm/d]

out = ((  (0.5-p1)^(1-p2).*max(0,  S./Smax).^p2).*(S./Smax <= 0.5-p1) + ...
         (1-(0.5+p1)^(1-p2).*max(0,1-S./Smax).^p2).*(S./Smax >  0.5-p1)).*In;

end
function [out] = saturation_2(S,Smax,p1,In)
%saturation_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:  Saturation excess from a store with different degrees of saturation
% Constraints:  1-S/Smax >= 0       prevents numerical issues with complex
%                                   numbers
% @(Inputs):    S    - current storage [mm]
%               Smax - maximum contributing storage [mm]
%               p1   - non-linear scaling parameter [-]
%               In   - incoming flux [mm/d]

% NOTE: When stores are very slightly below or over their maximum, the
% exponent can push this function into regions where no feasible solutions
% exist. The min(max()) combination prevents this from happening. 

out = (1- min(1,max(0,(1-S./Smax))).^p1) .*In;

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

% 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
% Constraints:  -
% @(Inputs):    p1   - time coefficient [d-1]
%               S    - current storage [mm]

out = p1.*S;

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

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