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
109 void
110 set_rooting_depth( input_class_soillayers_t const * m_soillayers,
111 substate_soilchemistry_t const * soilchem,
112 MoBiLE_Plant *,
113 bool consider_texture = false);
114
119 double
120 get_optimum_foliage_biomass_trees( MoBiLE_Plant * /* plant species */);
121
122
130 double
131 get_optimum_foliage_biomass_grass( MoBiLE_Plant * /* plant species */);
132
133
134 int
135 get_foliage_age(
136 int _day_of_year_start,
137 int _doy,
138 int _nd_age_classes);
139
140 double
141 get_dvs_mortality_of_age_class(int /* day of start senescence */,
142 int /* number of days of senescence */,
143 int /* day of year */);
144
145 double
146 get_dvs_mortality_contribution_of_age_class(
147 MoBiLE_Plant *,
148 int /* age class */,
149 double /* mortality of age class */);
150
154 lerr_t
155 initialize_seasonality(
156 MoBiLE_Plant *,
157 unsigned int /* day of year start */,
158 unsigned int /* current day of year */,
159 unsigned int & /* bud state */);
160
164 lerr_t
165 initialize_new_foliage_biomass(
166 MoBiLE_Plant *,
167 double /*initial biomass*/,
168 unsigned int /* day of year start */,
169 unsigned int /* current day of year */,
170 unsigned int /* bud state */);
171
175 lerr_t
176 initialize_new_biomass(
177 MoBiLE_Plant *,
178 double /*initial biomass*/);
179
183 double
184 update_dvs_flush(
185 MoBiLE_Plant * vt,
186 int _days_since_emergence);
187
188 lerr_t
189 initialize_wood_biomass(
190 MoBiLE_Plant *,
191 double /*initial biomass*/,
192 double /*fom*/);
193
194 lerr_t
195 initialize_foliage_dependent_fine_root_biomass(
196 MoBiLE_Plant *,
197 double /*fom*/);
198
199 lerr_t
200 update_foliage_layer_biomass_and_lai(
201 MoBiLE_Plant *,
202 size_t, /*foliage layer count*/
203 double /*minimum allowed lai*/);
204
209 double
210 aboveground_wood_biomass_from_structure(
211 MoBiLE_Plant * /* species */);
212
217 lerr_t
218 update_vertical_biomass_distribution(
219 MoBiLE_Plant *);
220
227 double
228 leaf_temperature_(
229 lvector_t< double > /* canopy air temperature */,
230 MoBiLE_Plant * /* species */);
231
232 double
233 nitrogen_uptake_temperature_dependency(
234 double /* minimum temperature */,
235 double /* optimum temperature */,
236 double /* temperature */);
237
242 double
243 optimum_nitrogen_content_foliage(
244 MoBiLE_Plant * /* plant species */);
245
250 double
251 optimum_nitrogen_content_buds(
252 MoBiLE_Plant * /* plant species */);
253
258 double
259 get_foliage_age_of_senescence(
260 MoBiLE_Plant * /* species */,
261 double /* fraction */);
262
263 double
264 accumulated_n_uptake();
265};
266
267
290void
292 double const _ps,
293 double const _h_bottom,
294 double const _h_top,
295 double _lw,
296 double &_fract,
297 double _h_cum_bottom,
298 double _h_cum_top);
299
300void
302 size_t _sl_cnt_litter,
303 size_t _sl_cnt_soil,
304 double _ps,
305 double _rooting_depth,
306 double *_f_frt_sl,
307 double const *_h_sl);
308
309} /* namespace ldndc */
310
311
312#endif /* !LD_PLANTFUNCTIONS_H_ */
313
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:1731
void fineroots_biomass_distribution(size_t _sl_cnt_litter, size_t _sl_cnt_soil, double _ps, double _rooting_depth, double *_f_frt_sl, double const *_h_sl)
Definition: ld_plantfunctions.cpp:1812