LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
ld_plantfunctions.h
1
14
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
126 double
127 relative_crown_cover_area( MoBiLE_Plant * /* plant species */);
128
129
137 double
138 get_optimum_foliage_biomass_grass( MoBiLE_Plant * /* plant species */);
139
140
141 int
142 get_foliage_age(
143 int _day_of_year_start,
144 int _doy,
145 int _nd_age_classes);
146
147 double
148 get_dvs_mortality_of_age_class(int /* day of start senescence */,
149 int /* number of days of senescence */,
150 int /* day of year */);
151
152 double
153 get_dvs_mortality_contribution_of_age_class(
154 MoBiLE_Plant *,
155 int /* age class */,
156 double /* mortality of age class */);
157
161 lerr_t
162 initialize_seasonality(
163 MoBiLE_Plant *,
164 unsigned int /* day of year start */,
165 unsigned int /* current day of year */,
166 unsigned int & /* bud state */);
167
171 lerr_t
172 initialize_new_foliage_biomass(
173 MoBiLE_Plant *,
174 double /*initial biomass*/,
175 unsigned int /* day of year start */,
176 unsigned int /* current day of year */,
177 unsigned int /* bud state */);
178
182 lerr_t
183 initialize_new_biomass(
184 MoBiLE_Plant *,
185 double /*initial biomass*/);
186
190 double
191 update_dvs_flush(
192 MoBiLE_Plant * vt,
193 int _days_since_emergence);
194
195 lerr_t
196 initialize_wood_biomass(
197 MoBiLE_Plant *,
198 double /*initial biomass*/);
199
200 lerr_t
201 initialize_foliage_dependent_fine_root_biomass(
202 MoBiLE_Plant *,
203 double /*fom*/);
204
205 lerr_t
206 update_foliage_layer_biomass_and_lai(
207 MoBiLE_Plant *,
208 size_t, /*foliage layer count*/
209 double /*minimum allowed lai*/);
210
215 double
216 aboveground_wood_biomass_from_structure(
217 MoBiLE_Plant * /* species */);
218
223 lerr_t
224 update_vertical_biomass_distribution(
225 MoBiLE_Plant *);
226
233 double
234 leaf_temperature_(
235 lvector_t< double > /* canopy air temperature */,
236 MoBiLE_Plant * /* species */);
237
238 double
239 nitrogen_uptake_temperature_dependency(
240 double /* minimum temperature */,
241 double /* optimum temperature */,
242 double /* temperature */);
243
248 double
249 optimum_nitrogen_content_foliage(
250 MoBiLE_Plant * /* plant species */);
251
256 double
257 optimum_nitrogen_content_buds(
258 MoBiLE_Plant * /* plant species */);
259
264 double
265 get_foliage_age_of_senescence(
266 MoBiLE_Plant * /* species */,
267 double /* fraction */);
268
269 double
270 accumulated_n_uptake();
271};
272
273
296void
298 double const _ps,
299 double const _h_bottom,
300 double const _h_top,
301 double _lw,
302 double &_fract,
303 double _h_cum_bottom,
304 double _h_cum_top);
305
306void
308 size_t _sl_cnt_litter,
309 size_t _sl_cnt_soil,
310 double _ps,
311 double _rooting_depth,
312 double *_f_frt_sl,
313 double const *_h_sl);
314
315} /* namespace ldndc */
316
317
318#endif /* !LD_PLANTFUNCTIONS_H_ */
319
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:1840
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:1921