LandscapeDNDC 1.37.0
ld_plantfunctions.h
1
15#ifndef LD_PLANTFUNCTIONS_H_
16#define LD_PLANTFUNCTIONS_H_
17
18#include "ld_modelsconfig.h"
19
20#include "mbe_plant.h"
21#include "state/mbe_state.h"
22
23#include <input/climate/climate.h>
24#include <input/soillayers/soillayers.h>
25#include <input/setup/setup.h>
26#include <input/species/species.h>
27#include "physiology/ld_allometry.h"
28
29#include <containers/lbstack.h>
30
31
32namespace ldndc {
33
34class LDNDC_API LD_PlantFunctions
35{
36public:
37 LD_PlantFunctions(
38 MoBiLE_State *,
39 cbm::io_kcomm_t *);
40 ~LD_PlantFunctions();
41
42 lerr_t initialize_crop( MoBiLE_Plant *, species::crop_properties_t const *);
43 lerr_t initialize_grass( MoBiLE_Plant *, species::grass_properties_t const *);
44 lerr_t initialize_tree( MoBiLE_Plant *, species::wood_properties_t const *,
45 cbm::string_t /* branchfraction */,
46 cbm::string_t /* crownlength */,
47 bool /* competition */);
48
49protected:
50
51 climate::input_class_climate_t const & cl_;
52 setup::input_class_setup_t const & se_;
53 soillayers::input_class_soillayers_t const & sl_;
54
55 substate_microclimate_t & mc_;
56 substate_physiology_t & ph_;
57 substate_soilchemistry_t & sc_;
58
59 LD_Allometry m_alm;
60 MoBiLE_PlantVegetation * m_veg;
61
62 /* ############## WOOD ############## */
63 lerr_t set_wood_defaults_( MoBiLE_Plant *, species::wood_properties_t const *);
64 lerr_t gapfill_wood_defaults_( MoBiLE_Plant *,
65 species::wood_properties_t const *,
66 bool /* competition */);
71 lerr_t initialize_vegetationstructure_wood_( MoBiLE_Plant *,
72 cbm::string_t /* branchfraction */,
73 cbm::string_t /* crownlength */);
74
75 /* ############## GRASS ############## */
76 lerr_t set_grass_defaults_( MoBiLE_Plant *, species::grass_properties_t const *);
77 lerr_t gapfill_grass_defaults_( MoBiLE_Plant *, species::species_properties_t const *);
78 lerr_t reset_grass_properties_( MoBiLE_Plant *);
79
84 lerr_t initialize_vegetationstructure_grass_( MoBiLE_Plant *);
85
86 /* ############## CROP ############## */
87 lerr_t set_crop_defaults_( MoBiLE_Plant *, species::crop_properties_t const *);
88 lerr_t reset_crop_properties_( MoBiLE_Plant *);
89
90
91
92
97 lerr_t initialize_nitrogen_concentrations( MoBiLE_Plant *);
98
104 lerr_t canopy_microclimate();
105
106
107public:
108
113 double
114 get_optimum_foliage_biomass_trees( MoBiLE_Plant * /* plant species */);
115
116
124 double
125 get_optimum_foliage_biomass_grass( MoBiLE_Plant * /* plant species */);
126
127
128 int
129 get_foliage_age(
130 int _day_of_year_start,
131 int _doy,
132 int _nd_age_classes);
133
134 double
135 get_dvs_mortality_of_age_class(int /* day of start senescence */,
136 int /* number of days of senescence */,
137 int /* day of year */);
138
139 double
140 get_dvs_mortality_contribution_of_age_class(
141 MoBiLE_Plant *,
142 int /* age class */,
143 double /* mortality of age class */);
144
148 lerr_t
149 initialize_seasonality(
150 MoBiLE_Plant *,
151 unsigned int /* day of year start */,
152 unsigned int /* current day of year */,
153 unsigned int & /* bud state */);
154
158 lerr_t
159 initialize_new_foliage_biomass(
160 MoBiLE_Plant *,
161 double /*initial biomass*/,
162 unsigned int /* day of year start */,
163 unsigned int /* current day of year */,
164 unsigned int /* bud state */);
165
169 lerr_t
170 initialize_new_biomass(
171 MoBiLE_Plant *,
172 double /*initial biomass*/);
173
177 double
178 update_dvs_flush(
179 MoBiLE_Plant * vt,
180 int _days_since_emergence);
181
182 lerr_t
183 initialize_wood_biomass(
184 MoBiLE_Plant *,
185 double /*initial biomass*/,
186 double /*fom*/);
187
188 lerr_t
189 initialize_foliage_dependent_fine_root_biomass(
190 MoBiLE_Plant *,
191 double /*fom*/);
192
193 lerr_t
194 update_foliage_layer_biomass_and_lai(
195 MoBiLE_Plant *,
196 size_t, /*foliage layer count*/
197 double /*minimum allowed lai*/);
198
203 double
204 aboveground_wood_biomass_from_structure(
205 MoBiLE_Plant * /* species */);
206
211 lerr_t
212 update_vertical_biomass_distribution(
213 MoBiLE_Plant *);
214
221 double
222 leaf_temperature_(
223 lvector_t< double > /* canopy air temperature */,
224 MoBiLE_Plant * /* species */);
225
226 double
227 nitrogen_uptake_temperature_dependency(
228 double /* minimum temperature */,
229 double /* optimum temperature */,
230 double /* temperature */);
231
236 double
237 optimum_nitrogen_content_foliage(
238 MoBiLE_Plant * /* plant species */);
239
244 double
245 optimum_nitrogen_content_buds(
246 MoBiLE_Plant * /* plant species */);
247
252 double
253 get_foliage_age_of_senescence(
254 MoBiLE_Plant * /* species */,
255 double /* fraction */);
256
257 double
258 accumulated_n_uptake();
259};
260
261
284void
286 double const _ps,
287 double const _h_bottom,
288 double const _h_top,
289 double _lw,
290 double &_fract,
291 double _h_cum_bottom,
292 double _h_cum_top);
293
294
295} /* namespace ldndc */
296
297
298#endif /* !LD_PLANTFUNCTIONS_H_ */
299
Spatially explicit groundwater model.
Definition: airchemistryput.h:15
void estimate_single_layer_biomass(double const _ps, double const _h_bottom, double const _h_top, double _lw, double &_fract, double _h_cum_bottom, double _h_cum_top)
Vertical biomass estimation.
Definition: ld_plantfunctions.cpp:1681