LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
mbe_plant.h
1/*
2 * SPDX-FileCopyrightText: Karlsruhe Institute of Technology (KIT)
3 * SPDX-License-Identifier: LicenseRef-LandscapeDNDC
4 * This file is part of LandscapeDNDC. See LICENSE.
5 */
15
16#ifndef MoBiLE_PLANT_H_
17#define MoBiLE_PLANT_H_
18
19#include "ld_legacy.h"
20
21#include <ld_plants.h>
22#include <string/cbm_string.h>
23
24namespace ldndc {
25
26typedef speciesparameters::speciesparameters_set_t MoBiLE_PlantParameters;
27class LDNDC_API MoBiLE_PlantSettings : public LD_PlantSettings< MoBiLE_PlantParameters >
28{
29public:
30 MoBiLE_PlantSettings( size_t /* canopy layers */,
31 char const * /*name*/,
32 char const * /*type*/,
33 char const * /*group*/,
34 MoBiLE_PlantParameters const * = NULL /*parameters*/);
35
36 size_t nb_ageclasses;
37 size_t nb_foliagelayers;
38 size_t nb_soillayers;
39};
40
41
42class MoBiLE_State;
43class MoBiLE_PlantVegetation;
44class LDNDC_API MoBiLE_Plant : public LD_Plant< MoBiLE_PlantSettings >
45{
46public:
47 typedef MoBiLE_PlantParameters Parameters;
48 typedef MoBiLE_PlantSettings Settings;
49public:
50 MoBiLE_Plant( MoBiLE_PlantSettings const *);
51 ~MoBiLE_Plant();
52
53 void switchparameters( Parameters _params){ m_parameters = _params; };
54
55 char const * cname() const
56 { return this->name().c_str(); }
57 char const * ctype() const
58 { return this->type().c_str(); }
59 char const * cgroup() const
60 { return this->group().c_str(); }
61 species::species_group_e groupId() const
62 { return this->parameters()->GROUP(); }
63
64 bool is_family( char const * /*family*/) const;
65
66 size_t nb_ageclasses() const;
67 size_t NB_AGECLASSES() const
68 { return this->m_plantsettings.nb_ageclasses; }
69 size_t nb_foliagelayers() const;
70 size_t NB_FOLIAGELAYERS() const
71 { return this->m_plantsettings.nb_foliagelayers; }
72 size_t nb_soillayers() const;
73 size_t NB_SOILLAYERS() const
74 { return this->m_plantsettings.nb_soillayers; }
75
76 size_t slot;
77
78 lerr_t clear();
79 lerr_t initialize();
80
81public: /*plant attributes*/
82
86
87 /* day of foliage budburst [-] */
88 int dEmerg;
89 /* yearly nitrogen fixation [g:10^3:m^-2:a^-1] */
90 double a_fix_n;
91 /* crown diameter relation to breast height diameter [%] */
92 double cdr;
93 /* average individual diameter at ground height [m] */
94 double dbas;
95 /* average individual diameter at 1.3 m height [m] */
96 double dbh;
97
98 /* distance from Ground Level to top height [m] (= h_trunk + h_crown) (i.e., height average basal area stem of each vegetation cohort) [m] */
99 double height_max; // better: h_top
100 /* distance from Ground Level to top height [m] (= h_trunk + h_crown) (i.e., height average basal area stem of each vegetation cohort) [m] */
101 double h_top;
102 /* distance from ground level to crown start [m] */
103 double height_at_canopy_start; // better: h_trunk
104 /* distance from ground level to crown start [m] */
105 double h_trunk;
106 /* distance from ground level to deepest root extension [m] */
107 double rooting_depth; // better: h_depth
108 /* distance from ground level to deepest root extension [m] */
109 double h_depth;
110 /* distance from crown start to top height [m] */
111 double h_crown;
112
113 /* sapwood volume of the stem within the crown [m3] */
114 double vsap_crown;
115 /* sapwood volume of the tap root[m3] */
116 double vsap_croot;
117 /* sapwood volume of the trunk [m3] */
118 double vsap_trunk;
119 /* sapwood volume of branches [m3] */
120 double vsap_bra;
121 /* sapwood volume of coarse roots other than the tap root [m3] */
122 double vsap_crt;
123
124 /* sapwood area in the trunk [m2] */
125 double sap_area;
126
127 /* potential (supported by tree dimension and stand density) leaf area index [m2 m-2] */
128 double lai_pot;
129 /* maximum (supported by foliage and bud biomass) leaf area index [m2 m-2] */
130 double lai_max;
131
132 /* carbon increase of reproductive tissue per time step. [g:10^3:m^-2] */
133 double dcBud, d_dcBud;
134 /* carbon allocated to pool of free available substrat per time step. [g:10^3:m^-2] */
135 double dcFac, d_dcFac;
136 /* carbon increase of foliage per time step. [g:10^3:m^-2] */
137 double dcFol, d_dcFol;
138 /* carbon increase of fine roots per time step. [g:10^3:m^-2] */
139 double dcFrt, d_dcFrt;
140 /* carbon increase of sapwood per time step. [g:10^3:m^-2] */
141 double dcSap, d_dcSap;
142
143 /* oxidized nitrogen uptake per time step. [g:10^3:m^-2] */
144 double nox_uptake, d_nox_uptake;
145 /* reduced nitrogen uptake per time step. [g:10^3:m^-2] */
146 double nhy_uptake, d_nhy_uptake;
147 /* uptake of soil ammonium, nitrate and dissolved organic nitrogen of this plant, accumulated
148 over the day; filled by the physiology module that performs the uptake (psim, plamox), zero
149 in modules that do not resolve it by species. [g:10^3:m^-2] */
150 double d_nh4_uptake, d_no3_uptake, d_don_uptake;
151 /* N2 uptake per time step. [g:10^3:m^-2] */
152 double n2_fixation, d_n2_fixation;
153
154 /* relative state of foliage flushing. [%] */
155 double dvsFlush, dvsFlushOld;
156 /* relative state of foliage senescence. [%] */
157 double dvsMort;
158 /* development stage of wood growth. [%] */
159 double dvsWood;
160
161 /* carbon loss from exudation [kgC m-2] */
162 double exsuLoss, d_exsuLoss;
163 /* area fraction of species relative to total ground coverage [%] */
164 double f_area;
165 /* fraction of vegetation group potential transpiration to total potential transpiration [-] */
166 double f_ptransp;
167 /* branch fraction of total (sap)wood [%] */
168 double f_branch;
169 /* reduction factor for initialization of the nitrogen and basic cation concentration relative to the maximum [%] */
170 double f_ncc;
171 /* relative state of free available carbon [-] */
172 double f_fac;
173 /* drought stress factor [%] */
174 double f_h2o, d_f_h2o;
175 /* heat stress factor [-] */
176 double f_heat;
177 /* heat stress grainfilling factor - daily minimum [-] */
178 double f_heat_daily;
179 /* heat stress grainfilling factor [-] */
180 double f_heat_gf;
181 /* vernalization factor */
182 double chill_factor;
183 /* dry weight of reproductive tissue [kgDW m-2] */
184 double mBud;
185 /* dry weight of reproduction mass at the end of the last year [kgDW m-2] */
186 double mBudStart;
187 /* dry weight of species specific core (dead) wood [kgDW m-2] */
188 double mCor;
189 /* dry weight of dead structural matter [kgDW m-2] */
190 double dw_dst;
191 /* living foliage biomass [kgDW m-2] */
192 double mFol;
193 /* dry weight of dead foliage biomass [kgDW m-2] */
194 double dw_dfol;
195 /* maximum foliage mass aimed at [kgDW m-2] */
196 double mFolMax;
197 /* minimum foliage mass aimed at [kgDW m-2] */
198 double mFolMin;
199 /* living fine root biomass [kgDW m-2] */
200 double mFrt;
201 /* sapwood biomass [kgDW m-2] */
202 double mSap;
203 /* dry weight of living structural matter [kgDW m-2] */
204 double dw_lst;
205 /* belowground sap- and corewood kept as stool (root stock) after
206 * coppicing (regrow event); not subject to UGWDF [kgDW m-2] */
207 double mStoolSap;
208 double mStoolCor;
209
210 /* nitrogen concentration in reproductive tissue [kgN kgDW-1] */
211 double ncBud;
212 /* nitrogen concentration in heartwood [kgN kgDW-1] */
213 double ncCor;
214 /* nitrogen concentration in living foliage [kgN kgDW-1] */
215 double ncFol;
216 /* nitrogen concentration in fine roots [kgN kgDW-1] */
217 double ncFrt;
218 /* nitrogen concentration in sapwood [kgN kgDW-1] */
219 double ncSap;
220
221 /* nitrogen in dead foliage [kgN m-2] */
222 double n_dfol;
223 /* nitrogen in dead structural tissue [kgN m-2] */
224 double n_dst;
225 /* nitrogen in living structural tissue [kgN m-2] */
226 double n_lst;
227 /* nitrogen in stool sap- and corewood [kgN m-2] */
228 double nStoolSap;
229 double nStoolCor;
230
231 /* nitrogen litter input from buds or reproductive tissue [kgN m-2] */
232 double nLitBud, d_nLitBud;
233 /* nitrogen litter input from foliage [kgN m-2] */
234 double nLitFol, d_nLitFol;
235 /* aboveground sapwood nitrogen from events [kgN m-2] */
236 double nLitWoodAbove, d_nLitWoodAbove;
237
238 /* nitrogen retention from senescence per day [kgN] */
239 double n_retention, d_n_retention;
240
241 /* sapwood area (at 1.3 m height) to foliage area ratio [-] */
242 double qsfa;
243 /* sapwood to foliage biomass ratio [-] */
244 double qsfm;
245
246 /* mean plant water potential [MPa] */
247 double psi_mean;
248 /* canopy water potential [MPa] */
249 double psi_cr;
250 /* soil to root plant water potential [MPa] */
251 double psi_sr;
252 /* plant water potential at air entry point (for embolism) [MPa] */
253 double psi_thresh;
254 /* predawn plant water potential [MPa] */
255 double psi_pd;
256
257 /* residual respiration from reproductive tissue [kgC m-1] */
258 double rBud, d_rBud;
259 /* residual respiration from foliage [kgC m-1] */
260 double rFol, d_rFol;
261 /* residual respiration from fine roots [kgC m-1] */
262 double rFrt, d_rFrt;
263 /* total growth respiration [kgC m-1] */
264 double rGro, d_rGro;
265 /* total growth respiration within the soil [kgC m-1] */
266 double rGroBelow, d_rGroBelow;
267 /* total residual respiration [kgC m-1] */
268 double rRes, d_rRes;
269 /* residual respiration from sapwood [kgC m-1] */
270 double rSap, d_rSap;
271 /* residual respiration from sapwood [kgC m-1] */
272 double rSapBelow, d_rSapBelow;
273 /* total transport and uptake respiration [kgC m-1] */
274 double rTra, d_rTra;
275
276 /* foliage senescence per time step [kgDW m-2] */
277 double sFol, d_sFol;
278 /* senescence of reproductive tissue [kgDW m-2] */
279 double sBud, d_sBud;
280 /* fine root senescence per time step [kgDW m-2] */
281 double sFrt, d_sFrt;
282 /* senescence of woody tissue [kgDW m-2] */
283 double sSap, d_sSap;
284 /* aboveground sapwood lost to the litter [kgDW m-2] */
285 double sWoodAbove, d_sWoodAbove;
286 /* belowground sapwood lost to the litter [kgDW m-2] */
287 double sWoodBelow, d_sWoodBelow;
288
289 /* weighted growing degree days [oC] */
290 double growing_degree_days;
291
292 /* previous day water supply modifier */
293 double fwatOld;
294
295 /* number of trees per ha [-] */
296 double tree_number;
297
298 /* root aerenchyme transport coefficient */
299 double root_tc;
300
301 /* resistance of water transport through the xylem (roots + stem) [MPa s m2 mol-1] */
302 double xylem_resistance;
303
304 /* estimated stem radius reduction (shrinkage) due to partial water loss [um tree-1] */
305 double wc_rel;
306
307 /* relative water content (RWC) of sapwood+bark (1 = fully hydrated, 0 = free available water fully depleted) */
308 double stem_shrinkage;
309 /* predawn (minimum) tree water deficit = maximum diurnal radius deviation from water saturated xylem state [um] */
310 double twd_pd_vt;
311 /* maximum (minimum) tree water deficit = minimum diurnal radius deviation from water saturated xylem state [um] */
312 double twd_max_vt;
313
314 /* foliage biomass per age class [kgDW] */
315 double * mFol_na;
316 /* foliage senescence per age class per time step [kgDW m-2] */
317 double * sFol_na, * d_sFol_na;
318
319 /* layer specific carbon uptake (photosynthesis) [kgC m-2] */
320 double * carbonuptake_fl, * d_carbonuptake_fl;
321 /* layer specific intercellular concentration of CO2 and under standard conditions [umol mol-1] */
322 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
323 /* layer specific leaf internal O2 concentration [umol m-2] */
324 double * o2i_fl, * o2i_std_fl;
325 /* layer specific CO2 compensation point at 25oC per canopy layer and under standard conditions [umol m-2] */
326 double * co2comp25_fl, * co2comp25_std_fl;
327 /* layer specific MEP [umol l-1] */
328 double * mep_fl;
329 /* layer specific DMADP [umol l-1] */
330 double * dmadp_fl;
331 /* layer specific DXP [umol l-1] */
332 double * dxp_fl;
333 /* layer specific GDP [umol l-1] */
334 double * gdp_fl;
335 /* layer specific IDP [umol l-1] */
336 double * idp_fl;
337 /* layer specific isoprene emission [umol m-2] */
338 double * isoprene_emission_fl, * d_isoprene_emission_fl;
339 /* layer specific monoterpene emission [umol m-2] */
340 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
341 /* layer specific monoterpene emission from storages [umol m-2] */
342 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
343 /* layer specific ovoc emission from storages [umol m-2] */
344 double * ovoc_emission_fl, * d_ovoc_emission_fl;
345 /* Michaelis-Menten constant for CO2 reaction of rubisco per canopy layer and under standard conditions [umol mol-1 ubar-1] */
346 double * kco2_fl, * kco2_std_fl;
347 /* Michaelis-Menten constant for O2 reaction of rubisco per canopy layer and under standard conditions [umol mol-1 ubar-1] */
348 double * ko2_fl, * ko2_std_fl;
349 /* layer specific nitrogen concentration [gN gDW-2] */
350 double* nc_fl;
351 /* leaf area index [m2 m-2] */
352 double * lai_fl;
353 /* relative amount of foliage per layer [%] */
354 double * fFol_fl;
355 /* deposited nh3 in the canopy [kg m-2] */
356 double * nh3_fl;
357 /* deposited nh4 in the canopy [kg m-2] */
358 double * nh4_fl;
359 /* deposited no3 in the canopy [kg m-2] */
360 double * no3_fl;
361 /* layer specific relative conductance [%] */
362 double * relativeconductance_fl, * d_relativeconductance_fl;
363 /* specific foliage area [m2 kgDW-1] */
364 double * sla_fl;
365 /* layer specific ATP production [umol m-2LA s-1] */
366 double * atp_fl;
367 /* layer specific ATP pool [umol kgDW-1] */
368 double * atp_pool_fl;
369 /* layer specific triose phosphate production [umol m-2LA s-1] */
370 double * tp_fl;
371 /* layer specific triose phosphate pool [umol kgDW-1] */
372 double * tp_pool_fl;
373 /* layer specific NADPH production [umol m-2 s-1] */
374 double * nadph_fl;
375 /* layer specific NADPH pool [umol kgDW-1] */
376 double * nadph_pool_fl;
377 /* layer specific activity state of isoprene synthase [nmol m-2 s-1] */
378 double * isoAct_fl;
379 /* layer specific activity state of monoterpene synthase [nmol m-2 s-1] */
380 double * monoAct_fl;
381 /* layer specific standard emission factor of isoprene (can be calculated from isoAct_fl) [ug gDW-1 h-1] */
382 double * ef_iso_fl;
383 /* layer specific standard emission factor of monoterpenes (can be calculated from monoAct_fl) [ug gDW-1 h-1] */
384 double * ef_mono_fl;
385 /* layer specific electron transport capacity at 25oC for full light adjusted leaves [umol m-2 s-1] */
386 double * jAct25_fl;
387 /* layer specific potential electron transport capacity per canopy layer under current light and temperature conditions [umol m-2 s-1] */
388 double * jPot_fl, * d_jPot_fl;
389 /* layer specific electron transport capacity at 25oC per canopy layer [umol m-2 s-1] */
390 double * jMax25_fl;
391 /* layer specific actual electron transport capacity per canopy layer and under standard conditions [umol m-2 s-1] */
392 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
393 /* layer specific dark respiration at 25oC per canopy layer [umol m-2 s-1] */
394 double * rdAct25_fl;
395 /* layer specific actual dark respiration per canopy layer [umol m-2 s-1] */
396 double * rd_fl;
397 /* layer specific activity state of rubisco at 25oC for full light adjusted leaves [umol m-2 s-1] */
398 double * vcAct25_fl;
399 /* layer specific activity state of rubisco with light and CO2 but not temperature restrictions [umol m-2 s-1] */
400 double * vcAct_fl;
401 /* layer specific activity state of rubisco at 25oC per canopy layer [umol m-2 s-1] */
402 double * vcMax25_fl;
403 /* layer specific actual activity state of rubisco per canopy layer and under standard conditions [umol m-2 s-1] */
404 double * vcMax_fl, * vcMax_std_fl;
405
406 /* fine root length per layer [m] */
407 double * rootlength_sl;
408 /* relative amount of fine roots per layer per species. [%] */
409 double * fFrt_sl;
410 /* fine root nitrogen litter input from events [kgN m-2] */
411 double * nLitFrt_sl, * d_nLitFrt_sl;
412 /* fine root senescence from events [kgDW m-2] */
413 double * sFrt_sl, * d_sFrt_sl;
414 /* belowground sapwood senescence from mortality events [kgDW m-2] */
415 double * sWoodBelow_sl, * d_sWoodBelow_sl;
416 /* belowground sapwood nitrogen from events [kgN m-2] */
417 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
418 /* absolut hypoxia per layer per species (not scaled by fFrt). [%] */
419 double * hypoxia_sl;
420
421 /* method for dimensional growth calculation (cone-based or taper-based) */
422 bool is_tapergrowth;
423public:
424
426 void reset();
427
429 double lai() const
430 { return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
431
439 double interception_capacity() const
440 { return this->aboveground_wood() * this->parameters()->MWWM()
441 + this->lai() * this->parameters()->MWFM(); };
442
450 double stand_volume() const // m3 ha-1 from kg m-2
451 { return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
452
453 double dead_structural_matter() const // kg m-2
454 { return ( this->mCor + this->dw_dst + this->mStoolCor); };
455
456 double living_structural_matter() const // kg m-2
457 { return ( this->mSap + this->dw_lst + this->mStoolSap); };
458
460 double stool_wood() const
461 { return ( this->mStoolSap + this->mStoolCor); };
462
463 double foliage_matter() const
464 { return ( this->mFol + this->dw_dfol); };
465
477 {
478 double living; /* fraction applied to the living pool [-] */
479 double dead; /* fraction applied to the dead pool [-] */
480 };
481
487 {
488 double axis; /* trunk + crown (stem axis) */
489 double branches; /* crown * FBRA */
490 double taproot; /* tap root */
491 double roots; /* tap root + coarse roots, tap root * (1 + FCRT) */
492 bool has_geometry;
493 };
494
503 double fcrt_eff() const
504 {
505 double const ugw( cbm::bound( 0.0, this->parameters()->UGWDF(), 0.9));
506 double const above( this->h_trunk + this->h_crown / 3.0 * ( 1.0 + this->parameters()->FBRA()));
507 if ( !cbm::flt_greater_zero( this->h_depth) || !cbm::flt_greater_zero( above))
508 {
509 return this->parameters()->FCRT();
510 }
511 return cbm::bound_min( 0.0, 3.0 * ugw / ( 1.0 - ugw) * above / this->h_depth - 1.0);
512 }
513
514 sapwood_volumes_t sapwood_volumes() const
515 {
516 sapwood_volumes_t v;
517 v.axis = this->vsap_trunk + this->vsap_crown;
518 v.branches = this->vsap_crown * this->parameters()->FBRA();
519 v.taproot = this->vsap_croot;
520 v.roots = this->vsap_croot * ( 1.0 + this->fcrt_eff());
521 v.has_geometry = cbm::flt_greater_zero( v.axis + v.branches + v.roots)
522 && cbm::flt_greater_zero( v.axis + v.taproot);
523 return v;
524 }
525
528 pool_fractions_t fraction_aboveground() const
529 {
530 sapwood_volumes_t const v( this->sapwood_volumes());
531 pool_fractions_t f;
532 if ( !v.has_geometry)
533 {
534 f.living = 1.0 - this->parameters()->UGWDF();
535 f.dead = f.living;
536 }
537 else
538 {
539 f.living = ( v.axis + v.branches) / ( v.axis + v.branches + v.roots);
540 f.dead = v.axis / ( v.axis + v.taproot);
541 }
542 return f;
543 }
544
547 pool_fractions_t fraction_stem_of_aboveground() const
548 {
549 sapwood_volumes_t const v( this->sapwood_volumes());
550 pool_fractions_t f;
551 if ( !v.has_geometry)
552 {
553 f.living = 1.0 - this->f_branch;
554 f.dead = f.living;
555 }
556 else
557 {
558 f.living = cbm::flt_greater_zero( v.axis + v.branches) ? v.axis / ( v.axis + v.branches) : 1.0;
559 f.dead = 1.0; /* no corewood in branches */
560 }
561 return f;
562 }
563
565 double stem_wood() const
566 {
567 pool_fractions_t const ag( this->fraction_aboveground());
568 pool_fractions_t const stem( this->fraction_stem_of_aboveground());
569 return this->mSap * ag.living * stem.living + this->mCor * ag.dead * stem.dead;
570 };
571
573 double aboveground_wood() const
574 {
575 pool_fractions_t const ag( this->fraction_aboveground());
576 return this->mSap * ag.living + this->mCor * ag.dead;
577 };
578
580 double branch_wood() const
581 { return this->aboveground_wood() - this->stem_wood(); };
582
584 double belowground_wood() const
585 { return ( this->mSap + this->mCor) - this->aboveground_wood() + this->stool_wood(); };
586
588 double aboveground_structural_matter() const
589 {
590 pool_fractions_t const ag( this->fraction_aboveground());
591 return this->aboveground_wood() + this->dw_lst * ag.living + this->dw_dst * ag.dead;
592 };
593
595 double aboveground_biomass() const
596 { return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud) ); };
597
599 double belowground_structural_matter() const
600 { return this->living_structural_matter() + this->dead_structural_matter() - this->aboveground_structural_matter(); };
601
603 double belowground_biomass() const
604 { return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0) ); };
605
607 double total_biomass() const
608 { return this->mSap + this->mStoolSap + this->dw_lst +
609 this->mCor + this->mStoolCor + this->dw_dst +
610 this->mFol + this->dw_dfol +
611 this->mBud + this->mFrt; };
612
614 double n_cor() const
615 { return this->mCor * this->ncCor; }
616 double nc_cor() const
617 { return this->ncCor; }
618
620 double n_sap() const
621 { return this->mSap * this->ncSap; }
622 double nc_sap() const
623 { return this->ncSap; }
624
626 double n_frt() const
627 { return this->mFrt * this->ncFrt; }
628 double nc_frt() const
629 { return this->ncFrt; }
630
632 double n_fol() const
633 { return this->mFol * this->ncFol; }
634 double nc_fol() const
635 { return this->ncFol; }
636
638 double n_bud() const
639 { return this->mBud * this->ncBud; }
640 double nc_bud() const
641 { return this->ncBud; }
642
644 double nc_lst() const
645 { return cbm::flt_greater_zero( this->living_structural_matter()) ? (this->n_sap() + this->n_lst + this->nStoolSap) / this->living_structural_matter(): 0.0; }
646
648 double nc_dst() const
649 { return cbm::flt_greater_zero( this->dead_structural_matter()) ? (this->n_cor() + this->n_dst + this->nStoolCor) / this->dead_structural_matter(): 0.0; }
650
652 double aboveground_nitrogen() const
653 {
654 pool_fractions_t const ag( this->fraction_aboveground());
655 return ( (this->n_sap() + this->n_lst) * ag.living
656 + (this->n_cor() + this->n_dst) * ag.dead
657 + this->n_fol() + this->n_dfol
658 + (this->parameters()->TUBER() ? 0.0 : this->n_bud()));
659 };
660
662 double belowground_nitrogen() const
663 { return this->total_nitrogen() - this->aboveground_nitrogen(); };
664
666 double total_nitrogen() const
667 { return this->n_sap() + this->n_lst + this->n_cor() + this->n_dst + this->nStoolSap + this->nStoolCor + this->n_fol() + this->n_dfol + this->n_bud() + this->n_frt(); };
668
670 double cn_ratio() const
671 { return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
672
673 /* Carbon of reproductive tissue [kgC m-2] */
674 double c_fru() const
675 { return this->mBud * cbm::CCDM; };
676
677 /* Carbon of dead structural matter [kgC m-2] */
678 double c_dst() const
679 { return this->dead_structural_matter() * cbm::CCDM; };
680
681 /* Carbon of living foliage biomass [kgC m-2] */
682 double c_fol() const
683 { return this->mFol * cbm::CCDM; };
684
685 /* Carbon of dead foliage biomass [kgC m-2] */
686 double c_dfol() const
687 { return this->dw_dfol * cbm::CCDM; };
688
689 /* Carbon of living fine root biomass [kgC m-2] */
690 double c_frt() const
691 { return this->mFrt * cbm::CCDM; };
692
693 /* Carbon of living structural matter [kgC m-2] */
694 double c_lst() const
695 { return this->living_structural_matter() * cbm::CCDM; };
696
698 double f_fol_maximum() const
699 {
700 double f_fol_max( 0.0);
701 for ( size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
702 {
703 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
704 {
705 f_fol_max = this->fFol_fl[fl];
706 }
707 }
708 return f_fol_max;
709 };
710
711 double n_leaf_surface() const
712 {
713 double n_tot( 0.0);
714 for ( size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
715 {
716 n_tot += nh4_fl[fl] + no3_fl[fl];
717 }
718 return n_tot;
719 }
720
722 double m_fol_fl( size_t _fl) const
723 { return this->mFol * this->fFol_fl[_fl]; }
724
734 double belowground_respiration()
735 { return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
736
737 double d_belowground_respiration()
738 { return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
739
740
741public:
742 /* properties */
743 ldate_t seeding_date;
744 double initial_biomass;
745 bool is_covercrop;
746
747private:
748 MoBiLE_PlantSettings m_plantsettings;
749 friend class MoBiLE_PlantVegetation;
750 MoBiLE_PlantVegetation const * m_plantvegetation;
751};
752
753class LDNDC_API MoBiLE_PlantVegetation : public LD_PlantVegetation< MoBiLE_Plant >
754{
755public:
756 MoBiLE_PlantVegetation( LD_PlantsParametersDB const * = NULL);
757 ~MoBiLE_PlantVegetation();
758
759 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings const *);
760 lerr_t delete_plant( char const * /*plant name*/);
761
762 bool is_family( MoBiLE_Plant const *, char const * /*family*/) const;
763 bool is_family( char const * /*plant type*/, char const * /*family*/) const;
764
773 size_t speciesparameters_generation() const;
774
775 void set_input( speciesparameters::input_class_speciesparameters_t const * _speciesparameters)
776 { this->m_speciesparameters = _speciesparameters; }
777 MoBiLE_PlantParameters get_parameters( char const * /*plant type*/);
778
779 size_t slot_cnt();
780
781 double canopy_height();
782 size_t canopy_layers_used();
783
784 double lai();
785 double lai_fl( size_t /* foliage layer */);
786 double dw_frt();
787 double mfrt_sl( size_t /* soil layer */);
788 double rootlength_sl( size_t /* soil layer */);
789 double root_density_sl( size_t /* soil layer */, double , bool );
790 double area_cover();
791
792private:
793 speciesparameters::input_class_speciesparameters_t const * m_speciesparameters;
794};
795
796typedef MoBiLE_PlantVegetation::Iterator PlantIterator;
797typedef MoBiLE_PlantVegetation::GroupIterator< species::crop > CropIterator;
798typedef MoBiLE_PlantVegetation::GroupIterator< species::grass > GrassIterator;
799typedef MoBiLE_PlantVegetation::GroupIterator< species::wood > TreeIterator;
800
801} /* namespace ldndc */
802
803
804#endif /* !PLANT_H_ */
Species parameter set accessor: wraps a parameterized_species_t; getters via SPECIESPARAMETERS_GETTER...
Definition speciesparameterstypes.h:127
Spatially explicit groundwater model.
Definition airchemistryput.h:21
Spatial partitioning of woody/structural tissue.
Definition mbe_plant.h:477
Sapwood volumes of tree parts [m3 tree-1].
Definition mbe_plant.h:487