LandscapeDNDC 1.37.0
mbe_plant.h
1
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
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 /* nitrous oxide uptake per time step. [g:10^3:m^-2] */
115 double nox_uptake, d_nox_uptake;
116 /* N2 uptake per time step. [g:10^3:m^-2] */
117 double n2_fixation, d_n2_fixation;
118
119 /* relative state of foliage flushing. [%] */
120 double dvsFlush, dvsFlushOld;
121 /* relative state of foliage senescence. [%] */
122 double dvsMort;
123 /* development stage of wood growth. [%] */
124 double dvsWood;
125
126 /* carbon loss from exudation [kgC m-2] */
127 double exsuLoss, d_exsuLoss;
128 /* area fraction of species relative to total ground coverage [%] */
129 double f_area;
130 /* fraction of vegetation group potential transpiration to total potential transpiration [-] */
131 double f_ptransp;
132 /* branch fraction of total (sap)wood [%] */
133 double f_branch;
134 /* reduction factor for initialization of the nitrogen and basic cation concentration relative to the maximum [%] */
135 double f_ncc;
136 /* relative state of free available carbon [-] */
137 double f_fac;
138 /* drought stress factor [%] */
139 double f_h2o, d_f_h2o;
140 /* heat stress factor [-] */
141 double f_heat;
142 /* heat stress grainfilling factor - daily minimum [-] */
143 double f_heat_daily;
144 /* heat stress grainfilling factor [-] */
145 double f_heat_gf;
146 /* dry weight of reproductive tissue [kgDW m-2] */
147 double mBud;
148 /* dry weight of reproduction mass at the end of the last year [kgDW m-2] */
149 double mBudStart;
150 /* dry weight of species specific core (dead) wood [kgDW m-2] */
151 double mCor;
152 /* dry weight of dead structural matter [kgDW m-2] */
153 double dw_dst;
154 /* living foliage biomass [kgDW m-2] */
155 double mFol;
156 /* dry weight of dead foliage biomass [kgDW m-2] */
157 double dw_dfol;
158 /* maximum foliage mass aimed at [kgDW m-2] */
159 double mFolMax;
160 /* minimum foliage mass aimed at [kgDW m-2] */
161 double mFolMin;
162 /* living fine root biomass [kgDW m-2] */
163 double mFrt;
164 /* sapwood biomass [kgDW m-2] */
165 double mSap;
166 /* dry weight of living structural matter [kgDW m-2] */
167 double dw_lst;
168
169 /* nitrogen concentration in reproductive tissue [kgN kgDW-1] */
170 double ncBud;
171 /* nitrogen concentration in heartwood [kgN kgDW-1] */
172 double ncCor;
173 /* nitrogen concentration in living foliage [kgN kgDW-1] */
174 double ncFol;
175 /* nitrogen concentration in fine roots [kgN kgDW-1] */
176 double ncFrt;
177 /* nitrogen concentration in sapwood [kgN kgDW-1] */
178 double ncSap;
179
180 /* nitrogen in dead foliage [kgN m-2] */
181 double n_dfol;
182 /* nitrogen in dead structural tissue [kgN m-2] */
183 double n_dst;
184 /* nitrogen in living structural tissue [kgN m-2] */
185 double n_lst;
186
187 /* nitrogen litter input from buds or reproductive tissue [kgN m-2] */
188 double nLitBud, d_nLitBud;
189 /* nitrogen litter input from foliage [kgN m-2] */
190 double nLitFol, d_nLitFol;
191 /* aboveground sapwood nitrogen from events [kgN m-2] */
192 double nLitWoodAbove, d_nLitWoodAbove;
193
194 /* nitrogen retention from senescence per day [kgN] */
195 double n_retention, d_n_retention;
197 /* sapwood area (at 1.3 m height) to foliage area ratio [-] */
198 double qsfa;
199 /* sapwood to foliage biomass ratio [-] */
200 double qsfm;
201
202 /* mean plant water potential [MPa] */
203 double psi_mean;
204 /* canopy water potential [MPa] */
205 double psi_cr;
206 /* soil to root plant water potential [MPa] */
207 double psi_sr;
208 /* plant water potential at air entry point (for embolism) [MPa] */
209 double psi_thresh;
210 /* predawn plant water potential [MPa] */
211 double psi_pd;
212
213 /* residual respiration from reproductive tissue [kgC m-1] */
214 double rBud, d_rBud;
215 /* residual respiration from foliage [kgC m-1] */
216 double rFol, d_rFol;
217 /* residual respiration from fine roots [kgC m-1] */
218 double rFrt, d_rFrt;
219 /* total growth respiration [kgC m-1] */
220 double rGro, d_rGro;
221 /* total growth respiration within the soil [kgC m-1] */
222 double rGroBelow, d_rGroBelow;
223 /* total residual respiration [kgC m-1] */
224 double rRes, d_rRes;
225 /* residual respiration from sapwood [kgC m-1] */
226 double rSap, d_rSap;
227 /* residual respiration from sapwood [kgC m-1] */
228 double rSapBelow, d_rSapBelow;
229 /* total transport and uptake respiration [kgC m-1] */
230 double rTra, d_rTra;
231
232 /* senescence of reproductive tissue [kgDW m-2] */
233 double sBud, d_sBud;
234 /* foliage senescence per time step [kgDW m-2] */
235 double sFol, d_sFol;
236 /* fine root senescence per time step [kgDW m-2] */
237 double sFrt, d_sFrt;
238 /* aboveground sapwood lost to the litter [kgDW m-2] */
239 double sWoodAbove, d_sWoodAbove;
240
241 /* weighted growing degree days [oC] */
242 double growing_degree_days;
243
244 /* previous day water supply modifier */
245 double fwatOld;
246
247 /* number of trees per ha [-] */
248 double tree_number;
249
250 /* root aerenchyme transport coefficient */
251 double root_tc;
252
253 /* resistance of water transport through the xylem (roots + stem) [MPa s m2 mol-1] */
254 double xylem_resistance;
255
256 /* estimated stem radius reduction (shrinkage) due to partial water loss [um tree-1] */
257 double wc_rel;
258
259 /* relative water content (RWC) of sapwood+bark (1 = fully hydrated, 0 = free available water fully depleted) */
260 double stem_shrinkage;
261 /* predawn (minimum) tree water deficit = maximum diurnal radius deviation from water saturated xylem state [um] */
262 double twd_pd_vt;
263 /* maximum (minimum) tree water deficit = minimum diurnal radius deviation from water saturated xylem state [um] */
264 double twd_max_vt;
265
266 /* foliage biomass per age class [kgDW] */
267 double * mFol_na;
268 /* foliage senescence per age class per time step [kgDW m-2] */
269 double * sFol_na, * d_sFol_na;
270
271 /* layer specific carbon uptake (photosynthesis) [kgC m-2] */
272 double * carbonuptake_fl, * d_carbonuptake_fl;
273 /* layer specific intercellular concentration of CO2 and under standard conditions [umol mol-1] */
274 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
275 /* layer specific leaf internal O2 concentration [umol m-2] */
276 double * o2i_fl, * o2i_std_fl;
277 /* layer specific CO2 compensation point at 25oC per canopy layer and under standard conditions [umol m-2] */
278 double * co2comp25_fl, * co2comp25_std_fl;
279 /* layer specific MEP [umol l-1] */
280 double * mep_fl;
281 /* layer specific DMADP [umol l-1] */
282 double * dmadp_fl;
283 /* layer specific DXP [umol l-1] */
284 double * dxp_fl;
285 /* layer specific GDP [umol l-1] */
286 double * gdp_fl;
287 /* layer specific IDP [umol l-1] */
288 double * idp_fl;
289 /* layer specific isoprene emission [umol m-2] */
290 double * isoprene_emission_fl, * d_isoprene_emission_fl;
291 /* layer specific monoterpene emission [umol m-2] */
292 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
293 /* layer specific monoterpene emission from storages [umol m-2] */
294 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
295 /* layer specific ovoc emission from storages [umol m-2] */
296 double * ovoc_emission_fl, * d_ovoc_emission_fl;
297 /* Michaelis-Menten constant for CO2 reaction of rubisco per canopy layer and under standard conditions [umol mol-1 ubar-1] */
298 double * kco2_fl, * kco2_std_fl;
299 /* Michaelis-Menten constant for O2 reaction of rubisco per canopy layer and under standard conditions [umol mol-1 ubar-1] */
300 double * ko2_fl, * ko2_std_fl;
301 /* layer specific nitrogen concentration [gN gDW-2] */
302 double* nc_fl;
303 /* leaf area index [m2 m-2] */
304 double * lai_fl;
305 /* relative amount of foliage per layer [%] */
306 double * fFol_fl;
307 /* deposited nh3 in the canopy [kg m-2] */
308 double * nh3_fl;
309 /* deposited nh4 in the canopy [kg m-2] */
310 double * nh4_fl;
311 /* deposited no3 in the canopy [kg m-2] */
312 double * no3_fl;
313 /* layer specific relative conductance [%] */
314 double * relativeconductance_fl, * d_relativeconductance_fl;
315 /* specific foliage area [m2 kgDW-1] */
316 double * sla_fl;
317 /* layer specific ATP production [umol m-2LA s-1] */
318 double * atp_fl;
319 /* layer specific ATP pool [umol kgDW-1] */
320 double * atp_pool_fl;
321 /* layer specific triose phosphate production [umol m-2LA s-1] */
322 double * tp_fl;
323 /* layer specific triose phosphate pool [umol kgDW-1] */
324 double * tp_pool_fl;
325 /* layer specific NADPH production [umol m-2 s-1] */
326 double * nadph_fl;
327 /* layer specific NADPH pool [umol kgDW-1] */
328 double * nadph_pool_fl;
329 /* layer specific activity state of isoprene synthase [nmol m-2 s-1] */
330 double * isoAct_fl;
331 /* layer specific activity state of monoterpene synthase [nmol m-2 s-1] */
332 double * monoAct_fl;
333 /* layer specific standard emission factor of isoprene (can be calculated from isoAct_fl) [ug gDW-1 h-1] */
334 double * ef_iso_fl;
335 /* layer specific standard emission factor of monoterpenes (can be calculated from monoAct_fl) [ug gDW-1 h-1] */
336 double * ef_mono_fl;
337 /* layer specific electron transport capacity at 25oC for full light adjusted leaves [umol m-2 s-1] */
338 double * jAct25_fl;
339 /* layer specific potential electron transport capacity per canopy layer under current light and temperature conditions [umol m-2 s-1] */
340 double * jPot_fl, * d_jPot_fl;
341 /* layer specific electron transport capacity at 25oC per canopy layer [umol m-2 s-1] */
342 double * jMax25_fl;
343 /* layer specific actual electron transport capacity per canopy layer and under standard conditions [umol m-2 s-1] */
344 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
345 /* layer specific dark respiration at 25oC per canopy layer [umol m-2 s-1] */
346 double * rdAct25_fl;
347 /* layer specific actual dark respiration per canopy layer [umol m-2 s-1] */
348 double * rd_fl;
349 /* layer specific activity state of rubisco at 25oC for full light adjusted leaves [umol m-2 s-1] */
350 double * vcAct25_fl;
351 /* layer specific activity state of rubisco with light and CO2 but not temperature restrictions [umol m-2 s-1] */
352 double * vcAct_fl;
353 /* layer specific activity state of rubisco at 25oC per canopy layer [umol m-2 s-1] */
354 double * vcMax25_fl;
355 /* layer specific actual activity state of rubisco per canopy layer and under standard conditions [umol m-2 s-1] */
356 double * vcMax_fl, * vcMax_std_fl;
357
358 /* fine root length per layer [m] */
359 double * rootlength_sl;
360 /* relative amount of fine roots per layer per species. [%] */
361 double * fFrt_sl;
362 /* fine root nitrogen litter input from events [kgN m-2] */
363 double * nLitFrt_sl, * d_nLitFrt_sl;
364 /* fine root senescence from events [kgDW m-2] */
365 double * sFrt_sl, * d_sFrt_sl;
366 /* belowground sapwood senescence from mortality events [kgDW m-2] */
367 double * sWoodBelow_sl, * d_sWoodBelow_sl;
368 /* belowground sapwood nitrogen from events [kgN m-2] */
369 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
370 /* absolut hypoxia per layer per species (not scaled by fFrt). [%] */
371 double * hypoxia_sl;
372
373 /* method for dimensional growth calculation (cone-based or taper-based) */
374 bool is_tapergrowth;
375public:
376
378 void reset();
379
381 double lai() const
382 { return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
383
391 double interception_capacity() const
392 { return this->aboveground_wood() * this->parameters()->MWWM()
393 + this->lai() * this->parameters()->MWFM(); };
394
402 double stand_volume() const
403 { return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
404
405 double dead_structural_matter() const
406 { return ( this->mCor + this->dw_dst); };
407
408 double living_structural_matter() const
409 { return ( this->mSap + this->dw_lst); };
410
411 double foliage_matter() const
412 { return ( this->mFol + this->dw_dfol); };
413
415 double aboveground_biomass() const
416 { return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud)); };
417
419 double aboveground_structural_matter() const
420 { return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * ( 1.0 - this->parameters()->UGWDF()); };
421
423 double aboveground_wood() const
424 { return ( this->mSap + this->mCor) * ( 1.0 - this->parameters()->UGWDF()); };
425
427 double belowground_biomass() const
428 { return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0)); };
429
431 double belowground_structural_matter() const
432 { return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * this->parameters()->UGWDF(); };
433
435 double belowground_wood() const
436 { return ( this->mSap + this->mCor) * this->parameters()->UGWDF(); };
437
439 double stem_wood() const
440 { return this->aboveground_wood() * ( 1.0 - this->f_branch); };
441
443 double branch_wood() const
444 { return this->aboveground_wood() * this->f_branch; };
445
447 double total_biomass() const
448 { return this->mSap + this->dw_lst +
449 this->mCor + this->dw_dst +
450 this->mFol + this->dw_dfol +
451 this->mBud + this->mFrt; };
452
454 double n_cor() const
455 { return this->mCor * this->ncCor; }
456 double nc_cor() const
457 { return this->ncCor; }
458
460 double n_sap() const
461 { return this->mSap * this->ncSap; }
462 double nc_sap() const
463 { return this->ncSap; }
464
466 double n_frt() const
467 { return this->mFrt * this->ncFrt; }
468 double nc_frt() const
469 { return this->ncFrt; }
470
472 double n_fol() const
473 { return this->mFol * this->ncFol; }
474 double nc_fol() const
475 { return this->ncFol; }
476
478 double n_bud() const
479 { return this->mBud * this->ncBud; }
480 double nc_bud() const
481 { return this->ncBud; }
482
484 double nc_lst() const
485 { return cbm::flt_greater_zero( this->mSap + this->dw_lst) ? (this->n_sap() + this->n_lst) / (this->mSap + this->dw_lst): 0.0; }
486
488 double nc_dst() const
489 { return cbm::flt_greater_zero( this->mCor + this->dw_dst) ? (this->n_cor() + this->n_dst) / (this->mCor + this->dw_dst): 0.0; }
490
492 double aboveground_nitrogen() const
493 { return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * ( 1.0 - this->parameters()->UGWDF())
494 + this->n_fol() + this->n_dfol
495 + (this->parameters()->TUBER() ? 0.0 : this->n_bud())); };
496
498 double belowground_nitrogen() const
499 { return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * this->parameters()->UGWDF()
500 + this->n_frt() + (this->parameters()->TUBER() ? this->n_bud() : 0.0)); };
501
503 double total_nitrogen() const
504 { 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(); };
505
507 double cn_ratio() const
508 { return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
509
510 /* Carbon of reproductive tissue [kgC m-2] */
511 double c_fru() const
512 { return this->mBud * cbm::CCDM; };
513
514 /* Carbon of dead structural matter [kgC m-2] */
515 double c_dst() const
516 { return (this->mCor + this->dw_dst) * cbm::CCDM; };
517
518 /* Carbon of living foliage biomass [kgC m-2] */
519 double c_fol() const
520 { return this->mFol * cbm::CCDM; };
521
522 /* Carbon of dead foliage biomass [kgC m-2] */
523 double c_dfol() const
524 { return this->dw_dfol * cbm::CCDM; };
525
526 /* Carbon of living fine root biomass [kgC m-2] */
527 double c_frt() const
528 { return this->mFrt * cbm::CCDM; };
529
530 /* Carbon of living structural matter [kgC m-2] */
531 double c_lst() const
532 { return (this->mSap + this->dw_lst) * cbm::CCDM; };
533
535 double f_fol_maximum() const
536 {
537 double f_fol_max( 0.0);
538 for ( size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
539 {
540 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
541 {
542 f_fol_max = this->fFol_fl[fl];
543 }
544 }
545 return f_fol_max;
546 };
547
549 double m_fol_fl( size_t _fl) const
550 { return this->mFol * this->fFol_fl[_fl]; }
551
561 double belowground_respiration()
562 { return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
563
564 double d_belowground_respiration()
565 { return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
566
567
568public:
569 /* properties */
570 ldate_t seeding_date;
571 double initial_biomass;
572 bool is_covercrop;
573
574private:
575 MoBiLE_PlantSettings m_plantsettings;
576 friend class MoBiLE_PlantVegetation;
577 MoBiLE_PlantVegetation const * m_plantvegetation;
578};
579
580class LDNDC_API MoBiLE_PlantVegetation : public LD_PlantVegetation< MoBiLE_Plant >
581{
582public:
583 MoBiLE_PlantVegetation( LD_PlantsParametersDB const * = NULL);
584 ~MoBiLE_PlantVegetation();
585
586 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings const *);
587 lerr_t delete_plant( char const * /*plant name*/);
588
589 bool is_family( MoBiLE_Plant const *, char const * /*family*/) const;
590 bool is_family( char const * /*plant type*/, char const * /*family*/) const;
591
592 void set_input( speciesparameters::input_class_speciesparameters_t const * _speciesparameters)
593 { this->m_speciesparameters = _speciesparameters; }
594 MoBiLE_PlantParameters get_parameters( char const * /*plant type*/);
595
596 size_t slot_cnt();
597
598 double canopy_height();
599 size_t canopy_layers_used();
600
601 double lai();
602 double lai_fl( size_t /* foliage layer */);
603 double dw_frt();
604 double mfrt_sl( size_t /* soil layer */);
605 double rootlength_sl( size_t /* soil layer */);
606 double root_density_sl( size_t /* soil layer */, double , bool );
607 double area_cover();
608
609private:
610 speciesparameters::input_class_speciesparameters_t const * m_speciesparameters;
611};
612
613typedef MoBiLE_PlantVegetation::Iterator PlantIterator;
614typedef MoBiLE_PlantVegetation::GroupIterator< species::crop > CropIterator;
615typedef MoBiLE_PlantVegetation::GroupIterator< species::grass > GrassIterator;
616typedef MoBiLE_PlantVegetation::GroupIterator< species::wood > TreeIterator;
617
618} /* namespace ldndc */
619
620
621#endif /* !PLANT_H_ */
Spatially explicit groundwater model.
Definition: airchemistryput.h:15