-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRootGrowth_1.cpp
168 lines (166 loc) · 5.91 KB
/
RootGrowth_1.cpp
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
// RootGrowth_1.cpp
//
// functions in this file:
// SoilMechanicResistance()
// SoilAirOnRootGrowth()
// SoilNitrateOnRootGrowth()
// SoilWaterOnRootGrowth()
//
#include <math.h>
#include "CottonSimulation.h"
#include "GeneralFunctions.h"
//
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
//////////////////////////
double SoilMechanicResistance(int l, int k)
// This function calculates soil mechanical resistance of cell l,k. It is
// computed
// on the basis of parameters read from the input and calculated in
// RootImpedance().
// It is called from PotentialRootGrowth().
// The function has been adapted, without change, from the code of GOSSYM.
// Soil mechanical
// resistance is computed as an empirical function of bulk density and water
// content. It should be noted, however, that this empirical function is based
// on data for one type of soil only, and its applicability for other soil
// types is questionable. The effect of soil moisture is only indirectly
// reflected in this function. A new module (SoilWaterOnRootGrowth) has
// therefore been added in COTTON2K to simulate an additional direct effect of
// soil moisture on root growth.
//
// The following global variables are referenced here:
// nk, nl, rtimpd
// The following arguments are used:
// k, l - column and layer numbers pf this cell.
//
// The minimum value of rtimpd of this and neighboring soil cells is used to
// compute
// rtpct. The code is based on a segment of RUTGRO in GOSSYM, and the values of
// the p1 to p3 parameters are based on GOSSYM usage:
{
const double p1 = 1.046;
const double p2 = 0.034554;
const double p3 = 0.5;
//
int lp1; // layer below l.
if (l == nl - 1) // last layer
lp1 = l;
else
lp1 = l + 1;
//
int km1, kp1; // columns to the left and to the right of k.
if (k == nk - 1) // last column
kp1 = k;
else
kp1 = k + 1;
//
if (k == 0) // first column
km1 = 0;
else
km1 = k - 1;
//
double rtimpd0 = RootImpede[l][k];
double rtimpdkm1 = RootImpede[l][km1];
double rtimpdkp1 = RootImpede[l][kp1];
double rtimpdlp1 = RootImpede[lp1][k];
//
double rtimpdmin = rtimpd0; // minimum value of rtimpd
if (rtimpdkm1 < rtimpdmin) rtimpdmin = rtimpdkm1;
if (rtimpdkp1 < rtimpdmin) rtimpdmin = rtimpdkp1;
if (rtimpdlp1 < rtimpdmin) rtimpdmin = rtimpdlp1;
//
double rtpct; // effect of soil mechanical resistance on root growth (the
// return value).
rtpct = p1 - p2 * rtimpdmin;
if (rtpct > 1) rtpct = 1;
if (rtpct < p3) rtpct = p3;
//
return rtpct;
}
//////////////////////////
double SoilAirOnRootGrowth(double psislk, double poreSpace, double vh2oclk)
// This function calculates the reduction of potential root growth rate in
// cells with
// low oxygen content (high water content). It is called from
// PotentialRootGrowth().
// It has been adapted from GOSSYM, but the critical value of soil moisture
// potential
// for root growth reduction (i.e., water logging conditions) has been changed.
//
// The following input arguments are used:
// poreSpace - value of PoreSpace (v/v) for this layer.
// psislk - value of SoilPsi for this cell.
// vh2oclk - water content (v/v) of this cell
{
// Constant parameters:
double p1 = 0;
double p2 = 1;
double p3 = 0.1;
// The following is actually disabled by the choice of the calibration
// parameters. It
// may be redefined when more experimental data become available.
double rtrdo; // Effect of oxygen deficiency on root growth (the return
// value).
if (psislk > p1)
rtrdo = p2;
else
rtrdo = 1;
// Reduced root growth when water content is at pore - space saturation
// (below water table).
if (vh2oclk >= poreSpace) rtrdo = p3;
return rtrdo;
}
//////////////////////////
double SoilNitrateOnRootGrowth(double vno3clk) {
// This function calculates the reduction of potential root growth rate
// in cells with
// low nitrate content. It is called from PotentialRootGrowth().
// It has been adapted from GOSSYM. It is assumed that root growth is
// reduced when
// nitrate N content falls below a certain level.
//
// The following argument is used:
// vno3clk - VolNo3NContent value for this cell
//
// The following constant parameters are used:
const double p1 = 0;
const double p2 = 1;
// Note: This function actually does nothing. It is disabled by the
// choice of the constant
// parameters. It may be redefined when more experimental data become
// available.
double rtrdn; // effect of nitrate deficiency on root growth (the return
// value).
if (vno3clk < p1)
rtrdn = p2;
else
rtrdn = 1;
return rtrdn;
}
//////////////////////////
double SoilWaterOnRootGrowth(double psislk)
// This function returns the effect of soil moisture in cell l,k on cotton
// root potential
// growth rate. It is called from PotentialRootGrowth() and uses the matric
// potential of this cell.
//
// The following argument is used:
// psislk - soil water potential (bars) of this cell.
//
{
// The following constants are used:
const double p1 = 20;
const double p2 = 16;
// It is assumed that almost no root growth occurs when the soil is
// dryer than -p1 (-20 bars), and root growth rate is maximum at a matric
// potential of -4 bars (p2 - p1) or wetter.
double smf; // effect of soil moisture on root growth (the return value).
// smf is computed here as an empirical third degree function,
// with values between 0.02 and 1.
smf = pow(((p1 + psislk) / p2), 3);
if (smf < 0.02) smf = 0.02;
if (smf > 1) smf = 1;
return smf;
}