11#ifndef MoBiLE_PLANT_H_
12#define MoBiLE_PLANT_H_
17#include <string/cbm_string.h>
21typedef speciesparameters::speciesparameters_set_t MoBiLE_PlantParameters;
22class LDNDC_API MoBiLE_PlantSettings :
public LD_PlantSettings< MoBiLE_PlantParameters >
25 MoBiLE_PlantSettings(
size_t ,
29 MoBiLE_PlantParameters
const * = NULL );
32 size_t nb_foliagelayers;
38class MoBiLE_PlantVegetation;
39class LDNDC_API MoBiLE_Plant :
public LD_Plant< MoBiLE_PlantSettings >
42 typedef MoBiLE_PlantParameters Parameters;
43 typedef MoBiLE_PlantSettings Settings;
45 MoBiLE_Plant( MoBiLE_PlantSettings
const *);
48 void switchparameters( Parameters _params){ m_parameters = _params; };
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(); }
59 bool is_family(
char const * )
const;
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; }
98 double height_at_canopy_start;
102 double rooting_depth;
128 double dcBud, d_dcBud;
130 double dcFac, d_dcFac;
132 double dcFol, d_dcFol;
134 double dcFrt, d_dcFrt;
136 double dcSap, d_dcSap;
139 double nox_uptake, d_nox_uptake;
141 double nhy_uptake, d_nhy_uptake;
143 double n2_fixation, d_n2_fixation;
146 double dvsFlush, dvsFlushOld;
153 double exsuLoss, d_exsuLoss;
165 double f_h2o, d_f_h2o;
223 double nLitBud, d_nLitBud;
225 double nLitFol, d_nLitFol;
227 double nLitWoodAbove, d_nLitWoodAbove;
230 double n_retention, d_n_retention;
257 double rGroBelow, d_rGroBelow;
263 double rSapBelow, d_rSapBelow;
276 double sWoodAbove, d_sWoodAbove;
278 double sWoodBelow, d_sWoodBelow;
281 double growing_degree_days;
293 double xylem_resistance;
299 double stem_shrinkage;
308 double * sFol_na, * d_sFol_na;
311 double * carbonuptake_fl, * d_carbonuptake_fl;
313 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
315 double * o2i_fl, * o2i_std_fl;
317 double * co2comp25_fl, * co2comp25_std_fl;
329 double * isoprene_emission_fl, * d_isoprene_emission_fl;
331 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
333 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
335 double * ovoc_emission_fl, * d_ovoc_emission_fl;
337 double * kco2_fl, * kco2_std_fl;
339 double * ko2_fl, * ko2_std_fl;
353 double * relativeconductance_fl, * d_relativeconductance_fl;
359 double * atp_pool_fl;
367 double * nadph_pool_fl;
379 double * jPot_fl, * d_jPot_fl;
383 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
395 double * vcMax_fl, * vcMax_std_fl;
398 double * rootlength_sl;
402 double * nLitFrt_sl, * d_nLitFrt_sl;
404 double * sFrt_sl, * d_sFrt_sl;
406 double * sWoodBelow_sl, * d_sWoodBelow_sl;
408 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
421 {
return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
430 double interception_capacity()
const
431 {
return this->aboveground_wood() * this->parameters()->MWWM()
432 + this->lai() * this->parameters()->MWFM(); };
441 double stand_volume() const
442 {
return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
444 double dead_structural_matter() const
445 {
return ( this->mCor + this->dw_dst + this->mStoolCor); };
447 double living_structural_matter() const
448 {
return ( this->mSap + this->dw_lst + this->mStoolSap); };
451 double stool_wood()
const
452 {
return ( this->mStoolSap + this->mStoolCor); };
454 double foliage_matter()
const
455 {
return ( this->mFol + this->dw_dfol); };
488 v.axis = this->vsap_trunk + this->vsap_crown;
489 v.branches = this->vsap_crown * this->parameters()->FBRA();
490 v.taproot = this->vsap_croot;
491 v.roots = this->vsap_croot * ( 1.0 + this->parameters()->FCRT());
492 v.has_geometry = cbm::flt_greater_zero( v.axis + v.branches + v.roots)
493 && cbm::flt_greater_zero( v.axis + v.taproot);
499 pool_fractions_t fraction_aboveground()
const
501 sapwood_volumes_t
const v( this->sapwood_volumes());
503 if ( !v.has_geometry)
505 f.living = 1.0 - this->parameters()->UGWDF();
510 f.living = ( v.axis + v.branches) / ( v.axis + v.branches + v.roots);
511 f.dead = v.axis / ( v.axis + v.taproot);
518 pool_fractions_t fraction_stem_of_aboveground()
const
520 sapwood_volumes_t
const v( this->sapwood_volumes());
522 if ( !v.has_geometry)
524 f.living = 1.0 - this->f_branch;
529 f.living = cbm::flt_greater_zero( v.axis + v.branches) ? v.axis / ( v.axis + v.branches) : 1.0;
536 double stem_wood()
const
538 pool_fractions_t
const ag( this->fraction_aboveground());
539 pool_fractions_t
const stem( this->fraction_stem_of_aboveground());
540 return this->mSap * ag.living * stem.living + this->mCor * ag.dead * stem.dead;
544 double aboveground_wood()
const
546 pool_fractions_t
const ag( this->fraction_aboveground());
547 return this->mSap * ag.living + this->mCor * ag.dead;
551 double branch_wood()
const
552 {
return this->aboveground_wood() - this->stem_wood(); };
555 double belowground_wood()
const
556 {
return ( this->mSap + this->mCor) - this->aboveground_wood() + this->stool_wood(); };
559 double aboveground_structural_matter()
const
561 pool_fractions_t
const ag( this->fraction_aboveground());
562 return this->aboveground_wood() + this->dw_lst * ag.living + this->dw_dst * ag.dead;
566 double aboveground_biomass()
const
567 {
return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud) ); };
570 double belowground_structural_matter()
const
571 {
return this->living_structural_matter() + this->dead_structural_matter() - this->aboveground_structural_matter(); };
574 double belowground_biomass()
const
575 {
return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0) ); };
578 double total_biomass()
const
579 {
return this->mSap + this->mStoolSap + this->dw_lst +
580 this->mCor + this->mStoolCor + this->dw_dst +
581 this->mFol + this->dw_dfol +
582 this->mBud + this->mFrt; };
586 {
return this->mCor * this->ncCor; }
587 double nc_cor()
const
588 {
return this->ncCor; }
592 {
return this->mSap * this->ncSap; }
593 double nc_sap()
const
594 {
return this->ncSap; }
598 {
return this->mFrt * this->ncFrt; }
599 double nc_frt()
const
600 {
return this->ncFrt; }
604 {
return this->mFol * this->ncFol; }
605 double nc_fol()
const
606 {
return this->ncFol; }
610 {
return this->mBud * this->ncBud; }
611 double nc_bud()
const
612 {
return this->ncBud; }
615 double nc_lst()
const
616 {
return cbm::flt_greater_zero( this->living_structural_matter()) ? (this->n_sap() + this->n_lst + this->nStoolSap) / this->living_structural_matter(): 0.0; }
619 double nc_dst()
const
620 {
return cbm::flt_greater_zero( this->dead_structural_matter()) ? (this->n_cor() + this->n_dst + this->nStoolCor) / this->dead_structural_matter(): 0.0; }
623 double aboveground_nitrogen()
const
625 pool_fractions_t
const ag( this->fraction_aboveground());
626 return ( (this->n_sap() + this->n_lst) * ag.living
627 + (this->n_cor() + this->n_dst) * ag.dead
628 + this->n_fol() + this->n_dfol
629 + (this->parameters()->TUBER() ? 0.0 : this->n_bud()));
633 double belowground_nitrogen()
const
634 {
return this->total_nitrogen() - this->aboveground_nitrogen(); };
637 double total_nitrogen()
const
638 {
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(); };
641 double cn_ratio()
const
642 {
return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
646 {
return this->mBud * cbm::CCDM; };
650 {
return this->dead_structural_matter() * cbm::CCDM; };
654 {
return this->mFol * cbm::CCDM; };
657 double c_dfol()
const
658 {
return this->dw_dfol * cbm::CCDM; };
662 {
return this->mFrt * cbm::CCDM; };
666 {
return this->living_structural_matter() * cbm::CCDM; };
669 double f_fol_maximum()
const
671 double f_fol_max( 0.0);
672 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
674 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
676 f_fol_max = this->fFol_fl[fl];
682 double n_leaf_surface()
const
685 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
687 n_tot += nh4_fl[fl] + no3_fl[fl];
693 double m_fol_fl(
size_t _fl)
const
694 {
return this->mFol * this->fFol_fl[_fl]; }
705 double belowground_respiration()
706 {
return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
708 double d_belowground_respiration()
709 {
return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
714 ldate_t seeding_date;
715 double initial_biomass;
719 MoBiLE_PlantSettings m_plantsettings;
720 friend class MoBiLE_PlantVegetation;
721 MoBiLE_PlantVegetation
const * m_plantvegetation;
724class LDNDC_API MoBiLE_PlantVegetation :
public LD_PlantVegetation< MoBiLE_Plant >
727 MoBiLE_PlantVegetation( LD_PlantsParametersDB
const * = NULL);
728 ~MoBiLE_PlantVegetation();
730 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings
const *);
731 lerr_t delete_plant(
char const * );
733 bool is_family( MoBiLE_Plant
const *,
char const * )
const;
734 bool is_family(
char const * ,
char const * )
const;
736 void set_input( speciesparameters::input_class_speciesparameters_t
const * _speciesparameters)
737 { this->m_speciesparameters = _speciesparameters; }
738 MoBiLE_PlantParameters get_parameters(
char const * );
742 double canopy_height();
743 size_t canopy_layers_used();
746 double lai_fl(
size_t );
748 double mfrt_sl(
size_t );
749 double rootlength_sl(
size_t );
750 double root_density_sl(
size_t ,
double ,
bool );
754 speciesparameters::input_class_speciesparameters_t
const * m_speciesparameters;
757typedef MoBiLE_PlantVegetation::Iterator PlantIterator;
758typedef MoBiLE_PlantVegetation::GroupIterator< species::crop > CropIterator;
759typedef MoBiLE_PlantVegetation::GroupIterator< species::grass > GrassIterator;
760typedef MoBiLE_PlantVegetation::GroupIterator< species::wood > TreeIterator;
Spatially explicit groundwater model.
Definition airchemistryput.h:15
Spatial partitioning of woody/structural tissue.
Definition mbe_plant.h:468
Sapwood volumes of tree parts [m3 tree-1].
Definition mbe_plant.h:478