forked from perabrahamsen/daisy-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GP2D.h
101 lines (88 loc) · 3.15 KB
/
GP2D.h
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
// GP2D.h -- Gerwitz and Page model extended for row crops.
//
// Copyright 1996-2001 Per Abrahamsen and Søren Hansen
// Copyright 2000-2001 KVL.
// Copyright 2007 Per Abrahamsen and KVL.
// Copyright 2011 KU.
//
// This file is part of Daisy.
//
// Daisy is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// Daisy is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser Public License for more details.
//
// You should have received a copy of the GNU Lesser Public License
// along with Daisy; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef GP2D_H
#define GP2D_H
class Treelog;
class GP1D
{
// Static parameters.
const double DensRtTip; // Root density at (pot) pen. depth. [cm/cm^3]
const double SpRtLength; // Specific root length [m/g]
// Helper class.
class InvW;
// Calculated parameters.
public:
double a; // Form parameter. [cm^-1]
double L0; // Root density at row at soil surface. [cm/cm^3]
double d_a; // Actual root depth. [cm]
double kstar; // Scale factor due to soil limit. []
// Use.
public:
bool set_dynamic (double SoilDepth /* [cm] */,
double CropDepth /* [cm] */,
double WRoot /* [g DM/m^2] */,
int debug /* Debug level. */,
Treelog&);
public:
double density (double z /* [cm] */) const;
// Create.
public:
GP1D (const double DensRtTip /* [cm/cm^3] */,
const double SpRtLength /* [m/g] */);
};
class GP2D
{
// Static parameters.
public:
const double row_position; // Horizontal position of row crops. [cm]
const double row_distance; // Distance betweeen rows. [cm]
const double DensRtTip; // Root density at (pot) pen. depth. [cm/cm^3]
const double SpRtLength; // Specific root length [m/g]
// Helper class.
private:
class InvQ;
// Calculated parameters.
public:
double a_z; // Form parameter. [cm^-1]
double a_x; // Form parameter. [cm^-1]
double L00; // Root density at row at soil surface. [cm/cm^3]
double d_a; // Actual root depth. [cm]
double kstar; // Scale factor due to soil limit. []
// Use.
public:
bool set_dynamic (double SoilDepth /* [cm] */,
double CropDepth /* [cm] */,
double CropWidth /* [cm] */,
double WRoot /* [g DM/m^2] */,
int debug /* Debug level. */,
Treelog&);
public:
double density (double x /* [cm] */, double z /* [cm] */) const;
// Create.
public:
GP2D (const double row_position /* [cm] */,
const double row_distance /* [cm] */,
const double DensRtTip /* [cm/cm^3] */,
const double SpRtLength /* [m/g] */);
};
#endif // GP2D_H