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