LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
mbe_plant.h
1
10
11#ifndef MoBiLE_PLANT_H_
12#define MoBiLE_PLANT_H_
13
14#include "ld_legacy.h"
15
16#include <ld_plants.h>
17#include <string/cbm_string.h>
18
19namespace ldndc {
20
21typedef speciesparameters::speciesparameters_set_t MoBiLE_PlantParameters;
22class LDNDC_API MoBiLE_PlantSettings : public LD_PlantSettings< MoBiLE_PlantParameters >
23{
24public:
25 MoBiLE_PlantSettings( size_t /* canopy layers */,
26 char const * /*name*/,
27 char const * /*type*/,
28 char const * /*group*/,
29 MoBiLE_PlantParameters const * = NULL /*parameters*/);
30
31 size_t nb_ageclasses;
32 size_t nb_foliagelayers;
33 size_t nb_soillayers;
34};
35
36
37class MoBiLE_State;
38class MoBiLE_PlantVegetation;
39class LDNDC_API MoBiLE_Plant : public LD_Plant< MoBiLE_PlantSettings >
40{
41public:
42 typedef MoBiLE_PlantParameters Parameters;
43 typedef MoBiLE_PlantSettings Settings;
44public:
45 MoBiLE_Plant( MoBiLE_PlantSettings const *);
46 ~MoBiLE_Plant();
47
48 void switchparameters( Parameters _params){ m_parameters = _params; };
49
50 char const * cname() const
51 { return this->name().c_str(); }
52 char const * ctype() const
53 { return this->type().c_str(); }
54 char const * cgroup() const
55 { return this->group().c_str(); }
56 species::species_group_e groupId() const
57 { return this->parameters()->GROUP(); }
58
59 bool is_family( char const * /*family*/) const;
60
61 size_t nb_ageclasses() const;
62 size_t NB_AGECLASSES() const
63 { return this->m_plantsettings.nb_ageclasses; }
64 size_t nb_foliagelayers() const;
65 size_t NB_FOLIAGELAYERS() const
66 { return this->m_plantsettings.nb_foliagelayers; }
67 size_t nb_soillayers() const;
68 size_t NB_SOILLAYERS() const
69 { return this->m_plantsettings.nb_soillayers; }
70
71 size_t slot;
72
73 lerr_t clear();
74 lerr_t initialize();
75
76public: /*plant attributes*/
77
81
82 /* day of foliage budburst [-] */
83 int dEmerg;
84 /* yearly nitrogen fixation [g:10^3:m^-2:a^-1] */
85 double a_fix_n;
86 /* crown diameter relation to breast height diameter [%] */
87 double cdr;
88 /* average individual diameter at ground height [m] */
89 double dbas;
90 /* average individual diameter at 1.3 m height [m] */
91 double dbh;
92 /* upper height of vegetation (i.e., average height of highest vegetation cohort) [m] */
93 double height_max;
94 /* height of canopy start (from the ground) [m] */
95 double height_at_canopy_start;
96 /* root depth [m] */
97 double rooting_depth;
98 /* potential (supported by tree dimension and stand density) leaf area index [m2 m-2] */
99 double lai_pot;
100 /* maximum (supported by foliage and bud biomass) leaf area index [m2 m-2] */
101 double lai_max;
102
103 /* carbon increase of reproductive tissue per time step. [g:10^3:m^-2] */
104 double dcBud, d_dcBud;
105 /* carbon allocated to pool of free available substrat per time step. [g:10^3:m^-2] */
106 double dcFac, d_dcFac;
107 /* carbon increase of foliage per time step. [g:10^3:m^-2] */
108 double dcFol, d_dcFol;
109 /* carbon increase of fine roots per time step. [g:10^3:m^-2] */
110 double dcFrt, d_dcFrt;
111 /* carbon increase of sapwood per time step. [g:10^3:m^-2] */
112 double dcSap, d_dcSap;
113
114 /* oxidized nitrogen uptake per time step. [g:10^3:m^-2] */
115 double nox_uptake, d_nox_uptake;
116 /* reduced nitrogen uptake per time step. [g:10^3:m^-2] */
117 double nhy_uptake, d_nhy_uptake;
118 /* N2 uptake per time step. [g:10^3:m^-2] */
119 double n2_fixation, d_n2_fixation;
120
121 /* relative state of foliage flushing. [%] */
122 double dvsFlush, dvsFlushOld;
123 /* relative state of foliage senescence. [%] */
124 double dvsMort;
125 /* development stage of wood growth. [%] */
126 double dvsWood;
127
128 /* carbon loss from exudation [kgC m-2] */
129 double exsuLoss, d_exsuLoss;
130 /* area fraction of species relative to total ground coverage [%] */
131 double f_area;
132 /* fraction of vegetation group potential transpiration to total potential transpiration [-] */
133 double f_ptransp;
134 /* branch fraction of total (sap)wood [%] */
135 double f_branch;
136 /* reduction factor for initialization of the nitrogen and basic cation concentration relative to the maximum [%] */
137 double f_ncc;
138 /* relative state of free available carbon [-] */
139 double f_fac;
140 /* drought stress factor [%] */
141 double f_h2o, d_f_h2o;
142 /* heat stress factor [-] */
143 double f_heat;
144 /* heat stress grainfilling factor - daily minimum [-] */
145 double f_heat_daily;
146 /* heat stress grainfilling factor [-] */
147 double f_heat_gf;
148 /* dry weight of reproductive tissue [kgDW m-2] */
149 double mBud;
150 /* dry weight of reproduction mass at the end of the last year [kgDW m-2] */
151 double mBudStart;
152 /* dry weight of species specific core (dead) wood [kgDW m-2] */
153 double mCor;
154 /* dry weight of dead structural matter [kgDW m-2] */
155 double dw_dst;
156 /* living foliage biomass [kgDW m-2] */
157 double mFol;
158 /* dry weight of dead foliage biomass [kgDW m-2] */
159 double dw_dfol;
160 /* maximum foliage mass aimed at [kgDW m-2] */
161 double mFolMax;
162 /* minimum foliage mass aimed at [kgDW m-2] */
163 double mFolMin;
164 /* living fine root biomass [kgDW m-2] */
165 double mFrt;
166 /* sapwood biomass [kgDW m-2] */
167 double mSap;
168 /* dry weight of living structural matter [kgDW m-2] */
169 double dw_lst;
170
171 /* nitrogen concentration in reproductive tissue [kgN kgDW-1] */
172 double ncBud;
173 /* nitrogen concentration in heartwood [kgN kgDW-1] */
174 double ncCor;
175 /* nitrogen concentration in living foliage [kgN kgDW-1] */
176 double ncFol;
177 /* nitrogen concentration in fine roots [kgN kgDW-1] */
178 double ncFrt;
179 /* nitrogen concentration in sapwood [kgN kgDW-1] */
180 double ncSap;
181
182 /* nitrogen in dead foliage [kgN m-2] */
183 double n_dfol;
184 /* nitrogen in dead structural tissue [kgN m-2] */
185 double n_dst;
186 /* nitrogen in living structural tissue [kgN m-2] */
187 double n_lst;
188
189 /* nitrogen litter input from buds or reproductive tissue [kgN m-2] */
190 double nLitBud, d_nLitBud;
191 /* nitrogen litter input from foliage [kgN m-2] */
192 double nLitFol, d_nLitFol;
193 /* aboveground sapwood nitrogen from events [kgN m-2] */
194 double nLitWoodAbove, d_nLitWoodAbove;
195
196 /* nitrogen retention from senescence per day [kgN] */
197 double n_retention, d_n_retention;
198
199 /* sapwood area (at 1.3 m height) to foliage area ratio [-] */
200 double qsfa;
201 /* sapwood to foliage biomass ratio [-] */
202 double qsfm;
203
204 /* mean plant water potential [MPa] */
205 double psi_mean;
206 /* canopy water potential [MPa] */
207 double psi_cr;
208 /* soil to root plant water potential [MPa] */
209 double psi_sr;
210 /* plant water potential at air entry point (for embolism) [MPa] */
211 double psi_thresh;
212 /* predawn plant water potential [MPa] */
213 double psi_pd;
214
215 /* residual respiration from reproductive tissue [kgC m-1] */
216 double rBud, d_rBud;
217 /* residual respiration from foliage [kgC m-1] */
218 double rFol, d_rFol;
219 /* residual respiration from fine roots [kgC m-1] */
220 double rFrt, d_rFrt;
221 /* total growth respiration [kgC m-1] */
222 double rGro, d_rGro;
223 /* total growth respiration within the soil [kgC m-1] */
224 double rGroBelow, d_rGroBelow;
225 /* total residual respiration [kgC m-1] */
226 double rRes, d_rRes;
227 /* residual respiration from sapwood [kgC m-1] */
228 double rSap, d_rSap;
229 /* residual respiration from sapwood [kgC m-1] */
230 double rSapBelow, d_rSapBelow;
231 /* total transport and uptake respiration [kgC m-1] */
232 double rTra, d_rTra;
233
234 /* senescence of reproductive tissue [kgDW m-2] */
235 double sBud, d_sBud;
236 /* foliage senescence per time step [kgDW m-2] */
237 double sFol, d_sFol;
238 /* fine root senescence per time step [kgDW m-2] */
239 double sFrt, d_sFrt;
240 /* aboveground sapwood lost to the litter [kgDW m-2] */
241 double sWoodAbove, d_sWoodAbove;
242
243 /* weighted growing degree days [oC] */
244 double growing_degree_days;
245
246 /* previous day water supply modifier */
247 double fwatOld;
248
249 /* number of trees per ha [-] */
250 double tree_number;
251
252 /* root aerenchyme transport coefficient */
253 double root_tc;
254
255 /* resistance of water transport through the xylem (roots + stem) [MPa s m2 mol-1] */
256 double xylem_resistance;
257
258 /* estimated stem radius reduction (shrinkage) due to partial water loss [um tree-1] */
259 double wc_rel;
260
261 /* relative water content (RWC) of sapwood+bark (1 = fully hydrated, 0 = free available water fully depleted) */
262 double stem_shrinkage;
263 /* predawn (minimum) tree water deficit = maximum diurnal radius deviation from water saturated xylem state [um] */
264 double twd_pd_vt;
265 /* maximum (minimum) tree water deficit = minimum diurnal radius deviation from water saturated xylem state [um] */
266 double twd_max_vt;
267
268 /* foliage biomass per age class [kgDW] */
269 double * mFol_na;
270 /* foliage senescence per age class per time step [kgDW m-2] */
271 double * sFol_na, * d_sFol_na;
272
273 /* layer specific carbon uptake (photosynthesis) [kgC m-2] */
274 double * carbonuptake_fl, * d_carbonuptake_fl;
275 /* layer specific intercellular concentration of CO2 and under standard conditions [umol mol-1] */
276 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
277 /* layer specific leaf internal O2 concentration [umol m-2] */
278 double * o2i_fl, * o2i_std_fl;
279 /* layer specific CO2 compensation point at 25oC per canopy layer and under standard conditions [umol m-2] */
280 double * co2comp25_fl, * co2comp25_std_fl;
281 /* layer specific MEP [umol l-1] */
282 double * mep_fl;
283 /* layer specific DMADP [umol l-1] */
284 double * dmadp_fl;
285 /* layer specific DXP [umol l-1] */
286 double * dxp_fl;
287 /* layer specific GDP [umol l-1] */
288 double * gdp_fl;
289 /* layer specific IDP [umol l-1] */
290 double * idp_fl;
291 /* layer specific isoprene emission [umol m-2] */
292 double * isoprene_emission_fl, * d_isoprene_emission_fl;
293 /* layer specific monoterpene emission [umol m-2] */
294 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
295 /* layer specific monoterpene emission from storages [umol m-2] */
296 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
297 /* layer specific ovoc emission from storages [umol m-2] */
298 double * ovoc_emission_fl, * d_ovoc_emission_fl;
299 /* Michaelis-Menten constant for CO2 reaction of rubisco per canopy layer and under standard conditions [umol mol-1 ubar-1] */
300 double * kco2_fl, * kco2_std_fl;
301 /* Michaelis-Menten constant for O2 reaction of rubisco per canopy layer and under standard conditions [umol mol-1 ubar-1] */
302 double * ko2_fl, * ko2_std_fl;
303 /* layer specific nitrogen concentration [gN gDW-2] */
304 double* nc_fl;
305 /* leaf area index [m2 m-2] */
306 double * lai_fl;
307 /* relative amount of foliage per layer [%] */
308 double * fFol_fl;
309 /* deposited nh3 in the canopy [kg m-2] */
310 double * nh3_fl;
311 /* deposited nh4 in the canopy [kg m-2] */
312 double * nh4_fl;
313 /* deposited no3 in the canopy [kg m-2] */
314 double * no3_fl;
315 /* layer specific relative conductance [%] */
316 double * relativeconductance_fl, * d_relativeconductance_fl;
317 /* specific foliage area [m2 kgDW-1] */
318 double * sla_fl;
319 /* layer specific ATP production [umol m-2LA s-1] */
320 double * atp_fl;
321 /* layer specific ATP pool [umol kgDW-1] */
322 double * atp_pool_fl;
323 /* layer specific triose phosphate production [umol m-2LA s-1] */
324 double * tp_fl;
325 /* layer specific triose phosphate pool [umol kgDW-1] */
326 double * tp_pool_fl;
327 /* layer specific NADPH production [umol m-2 s-1] */
328 double * nadph_fl;
329 /* layer specific NADPH pool [umol kgDW-1] */
330 double * nadph_pool_fl;
331 /* layer specific activity state of isoprene synthase [nmol m-2 s-1] */
332 double * isoAct_fl;
333 /* layer specific activity state of monoterpene synthase [nmol m-2 s-1] */
334 double * monoAct_fl;
335 /* layer specific standard emission factor of isoprene (can be calculated from isoAct_fl) [ug gDW-1 h-1] */
336 double * ef_iso_fl;
337 /* layer specific standard emission factor of monoterpenes (can be calculated from monoAct_fl) [ug gDW-1 h-1] */
338 double * ef_mono_fl;
339 /* layer specific electron transport capacity at 25oC for full light adjusted leaves [umol m-2 s-1] */
340 double * jAct25_fl;
341 /* layer specific potential electron transport capacity per canopy layer under current light and temperature conditions [umol m-2 s-1] */
342 double * jPot_fl, * d_jPot_fl;
343 /* layer specific electron transport capacity at 25oC per canopy layer [umol m-2 s-1] */
344 double * jMax25_fl;
345 /* layer specific actual electron transport capacity per canopy layer and under standard conditions [umol m-2 s-1] */
346 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
347 /* layer specific dark respiration at 25oC per canopy layer [umol m-2 s-1] */
348 double * rdAct25_fl;
349 /* layer specific actual dark respiration per canopy layer [umol m-2 s-1] */
350 double * rd_fl;
351 /* layer specific activity state of rubisco at 25oC for full light adjusted leaves [umol m-2 s-1] */
352 double * vcAct25_fl;
353 /* layer specific activity state of rubisco with light and CO2 but not temperature restrictions [umol m-2 s-1] */
354 double * vcAct_fl;
355 /* layer specific activity state of rubisco at 25oC per canopy layer [umol m-2 s-1] */
356 double * vcMax25_fl;
357 /* layer specific actual activity state of rubisco per canopy layer and under standard conditions [umol m-2 s-1] */
358 double * vcMax_fl, * vcMax_std_fl;
359
360 /* fine root length per layer [m] */
361 double * rootlength_sl;
362 /* relative amount of fine roots per layer per species. [%] */
363 double * fFrt_sl;
364 /* fine root nitrogen litter input from events [kgN m-2] */
365 double * nLitFrt_sl, * d_nLitFrt_sl;
366 /* fine root senescence from events [kgDW m-2] */
367 double * sFrt_sl, * d_sFrt_sl;
368 /* belowground sapwood senescence from mortality events [kgDW m-2] */
369 double * sWoodBelow_sl, * d_sWoodBelow_sl;
370 /* belowground sapwood nitrogen from events [kgN m-2] */
371 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
372 /* absolut hypoxia per layer per species (not scaled by fFrt). [%] */
373 double * hypoxia_sl;
374
375 /* method for dimensional growth calculation (cone-based or taper-based) */
376 bool is_tapergrowth;
377public:
378
380 void reset();
381
383 double lai() const
384 { return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
385
393 double interception_capacity() const
394 { return this->aboveground_wood() * this->parameters()->MWWM()
395 + this->lai() * this->parameters()->MWFM(); };
396
404 double stand_volume() const
405 { return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
406
407 double dead_structural_matter() const
408 { return ( this->mCor + this->dw_dst); };
409
410 double living_structural_matter() const
411 { return ( this->mSap + this->dw_lst); };
412
413 double foliage_matter() const
414 { return ( this->mFol + this->dw_dfol); };
415
417 double aboveground_biomass() const
418 { return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud)); };
419
421 double aboveground_structural_matter() const
422 { return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * ( 1.0 - this->parameters()->UGWDF()); };
423
425 double aboveground_wood() const
426 { return ( this->mSap + this->mCor) * ( 1.0 - this->parameters()->UGWDF()); };
427
429 double belowground_biomass() const
430 { return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0)); };
431
433 double belowground_structural_matter() const
434 { return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * this->parameters()->UGWDF(); };
435
437 double belowground_wood() const
438 { return ( this->mSap + this->mCor) * this->parameters()->UGWDF(); };
439
441 double stem_wood() const
442 { return this->aboveground_wood() * ( 1.0 - this->f_branch); };
443
445 double branch_wood() const
446 { return this->aboveground_wood() * this->f_branch; };
447
449 double total_biomass() const
450 { return this->mSap + this->dw_lst +
451 this->mCor + this->dw_dst +
452 this->mFol + this->dw_dfol +
453 this->mBud + this->mFrt; };
454
456 double n_cor() const
457 { return this->mCor * this->ncCor; }
458 double nc_cor() const
459 { return this->ncCor; }
460
462 double n_sap() const
463 { return this->mSap * this->ncSap; }
464 double nc_sap() const
465 { return this->ncSap; }
466
468 double n_frt() const
469 { return this->mFrt * this->ncFrt; }
470 double nc_frt() const
471 { return this->ncFrt; }
472
474 double n_fol() const
475 { return this->mFol * this->ncFol; }
476 double nc_fol() const
477 { return this->ncFol; }
478
480 double n_bud() const
481 { return this->mBud * this->ncBud; }
482 double nc_bud() const
483 { return this->ncBud; }
484
486 double nc_lst() const
487 { return cbm::flt_greater_zero( this->mSap + this->dw_lst) ? (this->n_sap() + this->n_lst) / (this->mSap + this->dw_lst): 0.0; }
488
490 double nc_dst() const
491 { return cbm::flt_greater_zero( this->mCor + this->dw_dst) ? (this->n_cor() + this->n_dst) / (this->mCor + this->dw_dst): 0.0; }
492
494 double aboveground_nitrogen() const
495 { return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * ( 1.0 - this->parameters()->UGWDF())
496 + this->n_fol() + this->n_dfol
497 + (this->parameters()->TUBER() ? 0.0 : this->n_bud())); };
498
500 double belowground_nitrogen() const
501 { return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * this->parameters()->UGWDF()
502 + this->n_frt() + (this->parameters()->TUBER() ? this->n_bud() : 0.0)); };
503
505 double total_nitrogen() const
506 { return this->n_sap() + this->n_lst + this->n_cor() + this->n_dst + this->n_fol() + this->n_dfol + this->n_bud() + this->n_frt(); };
507
509 double cn_ratio() const
510 { return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
511
512 /* Carbon of reproductive tissue [kgC m-2] */
513 double c_fru() const
514 { return this->mBud * cbm::CCDM; };
515
516 /* Carbon of dead structural matter [kgC m-2] */
517 double c_dst() const
518 { return (this->mCor + this->dw_dst) * cbm::CCDM; };
519
520 /* Carbon of living foliage biomass [kgC m-2] */
521 double c_fol() const
522 { return this->mFol * cbm::CCDM; };
523
524 /* Carbon of dead foliage biomass [kgC m-2] */
525 double c_dfol() const
526 { return this->dw_dfol * cbm::CCDM; };
527
528 /* Carbon of living fine root biomass [kgC m-2] */
529 double c_frt() const
530 { return this->mFrt * cbm::CCDM; };
531
532 /* Carbon of living structural matter [kgC m-2] */
533 double c_lst() const
534 { return (this->mSap + this->dw_lst) * cbm::CCDM; };
535
537 double f_fol_maximum() const
538 {
539 double f_fol_max( 0.0);
540 for ( size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
541 {
542 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
543 {
544 f_fol_max = this->fFol_fl[fl];
545 }
546 }
547 return f_fol_max;
548 };
549
551 double m_fol_fl( size_t _fl) const
552 { return this->mFol * this->fFol_fl[_fl]; }
553
563 double belowground_respiration()
564 { return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
565
566 double d_belowground_respiration()
567 { return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
568
569
570public:
571 /* properties */
572 ldate_t seeding_date;
573 double initial_biomass;
574 bool is_covercrop;
575
576private:
577 MoBiLE_PlantSettings m_plantsettings;
578 friend class MoBiLE_PlantVegetation;
579 MoBiLE_PlantVegetation const * m_plantvegetation;
580};
581
582class LDNDC_API MoBiLE_PlantVegetation : public LD_PlantVegetation< MoBiLE_Plant >
583{
584public:
585 MoBiLE_PlantVegetation( LD_PlantsParametersDB const * = NULL);
586 ~MoBiLE_PlantVegetation();
587
588 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings const *);
589 lerr_t delete_plant( char const * /*plant name*/);
590
591 bool is_family( MoBiLE_Plant const *, char const * /*family*/) const;
592 bool is_family( char const * /*plant type*/, char const * /*family*/) const;
593
594 void set_input( speciesparameters::input_class_speciesparameters_t const * _speciesparameters)
595 { this->m_speciesparameters = _speciesparameters; }
596 MoBiLE_PlantParameters get_parameters( char const * /*plant type*/);
597
598 size_t slot_cnt();
599
600 double canopy_height();
601 size_t canopy_layers_used();
602
603 double lai();
604 double lai_fl( size_t /* foliage layer */);
605 double dw_frt();
606 double mfrt_sl( size_t /* soil layer */);
607 double rootlength_sl( size_t /* soil layer */);
608 double root_density_sl( size_t /* soil layer */, double , bool );
609 double area_cover();
610
611private:
612 speciesparameters::input_class_speciesparameters_t const * m_speciesparameters;
613};
614
615typedef MoBiLE_PlantVegetation::Iterator PlantIterator;
616typedef MoBiLE_PlantVegetation::GroupIterator< species::crop > CropIterator;
617typedef MoBiLE_PlantVegetation::GroupIterator< species::grass > GrassIterator;
618typedef MoBiLE_PlantVegetation::GroupIterator< species::wood > TreeIterator;
619
620} /* namespace ldndc */
621
622
623#endif /* !PLANT_H_ */
Spatially explicit groundwater model.
Definition airchemistryput.h:15