GR_SIM — Function to simulate discharges with a GR rainfall runoff model
[QC,[S,R,ECH,ER,PR,CR,CRrac,CRlog]]=GR_SIM(X,P,E,TS,GRname,[TSini,Q,Icrit])
Parameters to used by the rainfall-runoff model (matrix [5x1])
Rainfall data (matrix [Nx1] where N is the number of time steps)
Potential evapotranspiration data (matrix [Nx1])
Time step length in hours (default = 24)
Name of the GR model to use (possible = GR4J, GR2M)
Number of time-steps required for model initialisation (default = 365*24/TS)
Discharge data (matrix [Nx1])
Indices of the value to use in the Q vector to calculate criteria. Default = find(Q>=0)
Simulated streamflows (matrix [Nx1]).
Time-series of soil-moisture reservoir levels (matrix [Nx1])
Time-series of routing store levels (matrix [Nx1])
Time-series of Interbasin Groundwater Flows (matrix [Nx1])
Time-series of real evaporation (matrix [Nx1])
Time-series of effective rainfall (matrix [Nx1])
Numerical quality criteria (matrix [5x1], see CRIT)
Numerical quality criteria of log transformed values (matrix [5x1], see CRIT)
Numerical quality criteria of squared root transformed values (matrix [5x1], see CRIT)
The function performs the following actions:
(1) A first simulation is launched with P and E vector and a 50% initial content of the two conceptual reservoirs.
(2) Starting one year after the beginning of simulation (1), an averaged content of both reservoirs is calculated out the values given in simulation (1).
(3) A second simulation is launched with P, E and the initial content calculated in (2).
// Generation of fictious discharge data with the GR4J model (see GR4J help) P = max(0,exp(convol(1/3*ones(1,3),rand(4998,1)+0.2).^5)*10-12)'; // Rainfall T = [0.687;0.498;2.774;6.086;10.565;13.702;16.159;15.585;12.619;8.486;3.300;0.778]; ETP = c_ETP(5000,24,%pi/4,T,198001010000,1); // Potentiel Evapotranspiration xx =[665;1.18;90;3.8;0]; // GR4J parameters e=convol(3/50*ones(1,50),rand(size(P,1),1));e=e(50:$)'-1; Q=c_GR4J(24,xx,P,ETP,[0.6;0.7])+e; // GR4J simulation + autocorrelated random error // GR4J simulation X=[870;3;90;3.5;0]; QC = GR_SIM(X,P,ETP,24,'GR4J',365,Q); // Plot of results in validation mode plot([Q QC]); xtitle('','Days','Discharge (mm/day)');legend(['Obs.' 'Calc.'],%f);