Skip to content

Commit

Permalink
Merge pull request #30 from ltrotter/master
Browse files Browse the repository at this point in the history
v2.1
  • Loading branch information
ltrotter authored Apr 25, 2022
2 parents ee6524c + e8b6807 commit f71aec4
Show file tree
Hide file tree
Showing 74 changed files with 9,759 additions and 6,252 deletions.
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

3 changes: 2 additions & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"affiliation": "University of Saskatchewan",
"name": "Knoben, Wouter"
}
]
],
"title": "MARRMoT"
}
Binary file modified BMI/Config/BMI_testcase_m01_BuffaloRiver_TN_USA.mat
Binary file not shown.
2 changes: 1 addition & 1 deletion BMI/Runners/marrmotRunner_testCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
forcing.precip = data_MARRMoT_examples.precipitation;
forcing.temp = data_MARRMoT_examples.temperature;
forcing.pet = data_MARRMoT_examples.potential_evapotranspiration;
forcing.delta_t_days = 1; % 1 [d]
forcing.delta_t = 1; % 1 [d]
forcing.time_unit = 'day';

% 'time_start' & 'time_end' are a vector with starting/end date
Expand Down
15 changes: 7 additions & 8 deletions BMI/lib/marrmotBMI.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef m01BMI < BMI
classdef marrmotBMI < BMI
% MARRMoT m01 implemented as a BMI model


Expand All @@ -18,8 +18,7 @@
'pet',0,... % time series of potential evapotranspiration
'delta_t',0,... % time step size in [days]
'time_unit','str'); % string with time units
solver = struct('name','str',... % string with solver function name
'resnorm_tolerance',0,... % approximation accuracy
solver = struct('resnorm_tolerance',0,... % approximation accuracy
'resnorm_maxiter',0); % max number of re-runs

% Output storage for a single time-step
Expand Down Expand Up @@ -64,7 +63,7 @@ function initialize(obj,path)
obj.model_name = model_name;
obj.startTime = time_start;
obj.endTime = time_end;
obj.dt = forcing.delta_t_days;
obj.dt = forcing.delta_t;
obj.time_unit = forcing.time_unit;
obj.forcing = forcing;
obj.solver = solver;
Expand All @@ -83,15 +82,15 @@ function update(obj)
input_forcing.precip = obj.forcing.precip(obj.time);
input_forcing.temp = obj.forcing.temp(obj.time);
input_forcing.pet = obj.forcing.pet(obj.time);
input_forcing.delta_t_days = obj.forcing.delta_t;
input_forcing.delta_t = obj.forcing.delta_t;

% Run model for 1 time step
m = feval(obj.model_name);
[output_ex,... % Fluxes leaving the model: simulated flow (Q) and evaporation (Ea)
output_in,... % Internal model fluxes
output_ss,... % Internal storages
output_wb] = ... % Water balance check
feval(obj.model_name,... % Model function name
input_forcing,... % Time series of climatic fluxes in simulation period
m.get_output(input_forcing,... % Time series of climatic fluxes in simulation period
obj.store_cur,... % Initial storages
obj.parameters,... % Parameter values
obj.solver); % Solver settings
Expand Down
10 changes: 6 additions & 4 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
This file highlights the most important changes made during version updates. The changes listed here are limited to those changes that directly impact model code. Changes to comments or workflow example files are not included.

=== v2.1 ===
Updated from v2.0 to v2.1 to incorporate changes in the root-finding method.

- Inclusion of NewtonRaphson solver before fsolve to speeed up the framework

=== v2.0 ===
Updated from v1 to v2 to incorporate the new object-oriented structure
Updated from v1.- to v2.- to incorporate the new object-oriented structure

=== v1.4 ===
Updated from v1.3 to v1.4 to incorporate bug fixes in a few models and to publish m_47. Main changes:
Updated from v1.2 to v1.3 to incorporate bug fixes in a few models and to publish m_47. Main changes:

- Added m_47 and necessary additional flux files.

Expand All @@ -17,8 +21,6 @@ Updated from v1.3 to v1.4 to incorporate bug fixes in a few models and to publis

- Fixed error in m_37: added costraint that Smax>0, this otherwise causes numerical instability to the logistic smoother.

- Fixed a typo in the sign of the exponent of 'percolation_3', affecting m_07

=== v1.3 ===
Updated from v1.2 to v1.3 to incorporate a bug fix in 'interflow_9'. Main changes:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
end

% Calculate multiplier
Smax = max(Smax,0); % this avoids numerical instabilities when Smax<0
if r*Smax == 0
out = 1 ./ (1+exp((S-Smax+r*e*Smax)/(r)));
else
Expand Down
Loading

0 comments on commit f71aec4

Please sign in to comment.