-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathSimplyP_development_log.txt
108 lines (71 loc) · 9.39 KB
/
SimplyP_development_log.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
SimplyP summary of development history
###############################################################################################
Version 0.4.1, 0.4.2
- Important bug fixes relating to soil water TDP concentration: In version 0.4.0, if you opted for a constant EPC0, this was not being computed correctly.
###############################################################################################
Version 0.4
Updates:
- Landscape units are dynamic and user-specified instead of hardcoded. It is now possible, for example, for the semi-natural (or low soil P) land class to have >0 soil water TDP concentration, and >0 labile P. However, unless this is really required, we strongly recommend that the user keeps just two land use classes, and if appropriate sets the labile soil P and initial EPC0 for the semi-natural class to 0.
- Initial soil total P and inactive P must now be specified for all land clases
- The newly-converted land class no longer exists as a hard-coded default. Instead, if the user wants to explore land use change, they must set this up themselves. However, we strongly urge that you do so whilst taking careful care of legacy soil P (see the model documentation how the newly converted land class used to operate for guidance)
- Groundwater TDP concentration can now vary between subcatchments, so that the model can be applied in larger river systems
- The hydrology and sediment equations have been factored out into separate modules (SimplyQ, SimplySed)
- Soil P is computed 1/km2, so the units in the parametrization (and state variables in the soil) have changed somewhat
###############################################################################################
08/05/2019 Release of version 0.3 (alpha)
This version is only available in the mobius version. Further development of the Python version is not planned.
Main updates compared to version 0.2 (see simply.h for details; https://github.com/NIVANorge/Mobius/blob/master/Modules/SimplyP.h):
- Reformulated the reach flow equation:
- Replaced the stream velocity equation, which previously was only a function of two parameters a_Q and b_Q (the gradient and exponent of the reach velocity-discharge relationship (v=aQ^b), with a version of Manning's equation. See SimplyP.h for more details. Reach slope is now taken into account when calculating the reach flow velocity.
- As a result, the parameter file no longer includes a_Q and b_Q, and instead has Manning's coefficient.
- Replaced the reach flow ODE with an explicit equation
- Converted the instream hydrology units from being based on mm (volume) or mm/day (for flows) to m3 and m3/day. This is conceptually simpler.
- Redid the initial groundwater volume calculation so that it produces sensible results in branched river systems (see simplyp.h for details)
- Changed the reach sediment input equation (ReachSedimentInput) so that it is a power law with the flow to the reach from land, rather than the total reach flow (i.e. doesn't take into account upstream flow). This is to prevent a steady increase down the catchment as discharge increases (given the decision to use global variables to define the rating curve between flow and suspended sediment concentration). Will likely need revisiting in the future, but for now performs as well as the previous formulation. Needs testing in a catchment with good sub-catchment suspended sediment data.
- NOTE: because of the change in this equation, and the change in the reach flow units, the Reach sediment input scaling factor needs recalibrating.
#############################################################################
Release v0.2 (alpha), 02/2019
Model now also available in C++, coded using Mobius (https://github.com/NIVANorge/Mobius/tree/master/Applications/SimplyP)
The main changes compared to v0.1A are summarised below.
Changes to parameters:
- New parameter to specify relation between SRP and TDP
- change in definition of the parameters describing the land use in sub-catchment. See individual parameter descriptions. Will only affect setups which have newly-converted land
- Option to sum inputs from specified reaches to calculate the overall sum delivered to a receiving waterbody (e.g. lake, estuary)
- Option to set soil water TDP constant throughout the model run. Soil labile P phosphorus is then also constant, and a number of parameters are not required (see parameter descriptions in the mobius version)
Python version only:
- Ability to simulate branched river networks, with associated parameters in a new sheet Reach_structure
- New parameter SC_Qr0 to ‘Constant’ sheet, a setup parameter which describes which reach the initial discharge value is provided for
Changes to input and output files:
- Input file: PET is no longer a required input. If it is not specified, it is calculated by the model from air temperature
- Python version: rename column ‘Pptn’ to ‘Precipitation’
General changes:
Python:
- Repackaged as a module with sub-modules, to split functions into different groups for ease of further development & debugging
- Added a text file describing input and output data
- Small changes in syntax throughout so runs in Python 3.6. Note, there are now a couple of issues with the plotting functions if you try to run with Python 2.7
Python & mobius versions:
- Created a log to keep track of model changes
Changes to functions:
- Added Thornthwaite PET calculation, using functions copied from the pyET0 Python package. If PET is not present in the input meteorology data file, then it is calculated. N.B. Thornthwaite requires whole years, so if calculating PET the model can only be run for whole calendar years.
- Added in-stream SRP calculation as a simple function of simulated in-stream TDP: SRP = m * TDP, where m is a user-supplied parameter.
- Define new function to sum inputs from selected reaches. Takes input reach structure from the parameter file, and sums discharge and masses from desired reaches to produce inputs to a receiving waterbody (e.g. lake, estuary). # Needs testing in mobius version
- Added ability to keep the soil water TDP concentration constant. The TDP soil water mass is then constant but the concentration wouldn't be due to change in soil water volume, so replace mass/volume with a concentration parameter in the in-stream TDP equation. Concentration parameter is equal to initial soil water TDP concentration and EPC0 if user wants soil water TDP concentration to stay constant. Soil P content also then remains constant.
- Soil labile P and soil water TDP were stiff equations, and made run times slow if dynamic soil processes were turned on. Remove them from the ODE solver and discretize the change with time (function ‘discretized_soilP’, called at the end of each time step). Use a Poincare map to estimate the gradient over the time step. Comparison with ode results shows insignificant changes over a 30 year test period (always less than 0.04% difference).
- Define a control function (f_x) for limiting soil water flow below field capacity. This is a piecewise polynomial and replaces the sigmoid control function used previously. Removes issue of negative flows when soil water volume was close to field capacity.
- Groundwater flow, Qg, also limited to the minimum user-specified parameter through use of a (differentiable) control function f_x.
- Soil water and groundwater flow ODEs replaced with explicit calculations of Q: Qs = (Vs - fc) * f_x(Vs, fc, 0.01) / T_s. Produces exactly the same results as before, with similar run times, but is simpler.
- Newly-converted land parameters re-defined so that f_Ar, f_IG and f_S are now the total areas of arable, improved grassland and semi-natural land in the catchment (including newly-converted land). And f_NC_Ar, f_NC_IG, f_NC_S is the proportion of Ar, IG or S land that is newly-converted.
Python version:
- Bug fix: initial conditions VsA0, VsS0, QsA0, QsS0, Qg0, Vg0 were only being set correctly for the first sub-catchment
- Initial reach flow (Qr0) used to be calculated only for SC1, the topmost reach, and initial reach discharges for other reaches were set to the output for the previous day for up-stream reaches. Changed to: user specifies the reach an initial value is provided for (e.g. most data-rich). Then convert the units to mm/day and it then is applied to all reaches (area-scaling involved in converting units means this is ok if hydrology is similar). Qr0 definition has therefore been moved up to after QsS0.
- Bug fix in the goodness-of-fit function, it wasn't correctly accounting for variables/reaches without data
- No plotting of soil P results if dynamic EPC0 is turned off
- Added PET to terrestrial compartment plot
- plot_in_stream function: fixed bug in plotting multiple reaches
- Added new function plot_instream_summed to plot the results from summing reach inputs to look at simulated total discharge and averaged concentrations to receiving waterbody.
- goodness_of_fit_stats: don’t try to calculate if don’t have any observations (len(obs_dict)<=0).
###############################################################################################
Initial model developed autumn-winter 2015. Released as v0.1 (alpha)
Subsequent changes to v0.1A (also implemented in v0.2):
- Bug fix: Flow into the current reach from upstream reaches had incorrect area scaling.
- Bug fix: Fraction of newly converted land was missing from a number of ODEs, now added in. This bug would only have affected model setups with newly-converted land.