16#ifndef MoBiLE_PLANT_H_
17#define MoBiLE_PLANT_H_
22#include <string/cbm_string.h>
27class LDNDC_API MoBiLE_PlantSettings :
public LD_PlantSettings< MoBiLE_PlantParameters >
30 MoBiLE_PlantSettings(
size_t ,
34 MoBiLE_PlantParameters
const * = NULL );
37 size_t nb_foliagelayers;
43class MoBiLE_PlantVegetation;
44class LDNDC_API MoBiLE_Plant :
public LD_Plant< MoBiLE_PlantSettings >
47 typedef MoBiLE_PlantParameters Parameters;
48 typedef MoBiLE_PlantSettings Settings;
50 MoBiLE_Plant( MoBiLE_PlantSettings
const *);
53 void switchparameters( Parameters _params){ m_parameters = _params; };
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(); }
64 bool is_family(
char const * )
const;
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; }
103 double height_at_canopy_start;
107 double rooting_depth;
133 double dcBud, d_dcBud;
135 double dcFac, d_dcFac;
137 double dcFol, d_dcFol;
139 double dcFrt, d_dcFrt;
141 double dcSap, d_dcSap;
144 double nox_uptake, d_nox_uptake;
146 double nhy_uptake, d_nhy_uptake;
150 double d_nh4_uptake, d_no3_uptake, d_don_uptake;
152 double n2_fixation, d_n2_fixation;
155 double dvsFlush, dvsFlushOld;
162 double exsuLoss, d_exsuLoss;
174 double f_h2o, d_f_h2o;
232 double nLitBud, d_nLitBud;
234 double nLitFol, d_nLitFol;
236 double nLitWoodAbove, d_nLitWoodAbove;
239 double n_retention, d_n_retention;
266 double rGroBelow, d_rGroBelow;
272 double rSapBelow, d_rSapBelow;
285 double sWoodAbove, d_sWoodAbove;
287 double sWoodBelow, d_sWoodBelow;
290 double growing_degree_days;
302 double xylem_resistance;
308 double stem_shrinkage;
317 double * sFol_na, * d_sFol_na;
320 double * carbonuptake_fl, * d_carbonuptake_fl;
322 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
324 double * o2i_fl, * o2i_std_fl;
326 double * co2comp25_fl, * co2comp25_std_fl;
338 double * isoprene_emission_fl, * d_isoprene_emission_fl;
340 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
342 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
344 double * ovoc_emission_fl, * d_ovoc_emission_fl;
346 double * kco2_fl, * kco2_std_fl;
348 double * ko2_fl, * ko2_std_fl;
362 double * relativeconductance_fl, * d_relativeconductance_fl;
368 double * atp_pool_fl;
376 double * nadph_pool_fl;
388 double * jPot_fl, * d_jPot_fl;
392 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
404 double * vcMax_fl, * vcMax_std_fl;
407 double * rootlength_sl;
411 double * nLitFrt_sl, * d_nLitFrt_sl;
413 double * sFrt_sl, * d_sFrt_sl;
415 double * sWoodBelow_sl, * d_sWoodBelow_sl;
417 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
430 {
return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
439 double interception_capacity()
const
440 {
return this->aboveground_wood() * this->parameters()->MWWM()
441 + this->lai() * this->parameters()->MWFM(); };
450 double stand_volume() const
451 {
return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
453 double dead_structural_matter() const
454 {
return ( this->mCor + this->dw_dst + this->mStoolCor); };
456 double living_structural_matter() const
457 {
return ( this->mSap + this->dw_lst + this->mStoolSap); };
460 double stool_wood()
const
461 {
return ( this->mStoolSap + this->mStoolCor); };
463 double foliage_matter()
const
464 {
return ( this->mFol + this->dw_dfol); };
503 double fcrt_eff()
const
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))
509 return this->parameters()->FCRT();
511 return cbm::bound_min( 0.0, 3.0 * ugw / ( 1.0 - ugw) * above / this->h_depth - 1.0);
514 sapwood_volumes_t sapwood_volumes()
const
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);
528 pool_fractions_t fraction_aboveground()
const
530 sapwood_volumes_t
const v( this->sapwood_volumes());
532 if ( !v.has_geometry)
534 f.living = 1.0 - this->parameters()->UGWDF();
539 f.living = ( v.axis + v.branches) / ( v.axis + v.branches + v.roots);
540 f.dead = v.axis / ( v.axis + v.taproot);
547 pool_fractions_t fraction_stem_of_aboveground()
const
549 sapwood_volumes_t
const v( this->sapwood_volumes());
551 if ( !v.has_geometry)
553 f.living = 1.0 - this->f_branch;
558 f.living = cbm::flt_greater_zero( v.axis + v.branches) ? v.axis / ( v.axis + v.branches) : 1.0;
565 double stem_wood()
const
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;
573 double aboveground_wood()
const
575 pool_fractions_t
const ag( this->fraction_aboveground());
576 return this->mSap * ag.living + this->mCor * ag.dead;
580 double branch_wood()
const
581 {
return this->aboveground_wood() - this->stem_wood(); };
584 double belowground_wood()
const
585 {
return ( this->mSap + this->mCor) - this->aboveground_wood() + this->stool_wood(); };
588 double aboveground_structural_matter()
const
590 pool_fractions_t
const ag( this->fraction_aboveground());
591 return this->aboveground_wood() + this->dw_lst * ag.living + this->dw_dst * ag.dead;
595 double aboveground_biomass()
const
596 {
return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud) ); };
599 double belowground_structural_matter()
const
600 {
return this->living_structural_matter() + this->dead_structural_matter() - this->aboveground_structural_matter(); };
603 double belowground_biomass()
const
604 {
return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0) ); };
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; };
615 {
return this->mCor * this->ncCor; }
616 double nc_cor()
const
617 {
return this->ncCor; }
621 {
return this->mSap * this->ncSap; }
622 double nc_sap()
const
623 {
return this->ncSap; }
627 {
return this->mFrt * this->ncFrt; }
628 double nc_frt()
const
629 {
return this->ncFrt; }
633 {
return this->mFol * this->ncFol; }
634 double nc_fol()
const
635 {
return this->ncFol; }
639 {
return this->mBud * this->ncBud; }
640 double nc_bud()
const
641 {
return this->ncBud; }
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; }
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; }
652 double aboveground_nitrogen()
const
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()));
662 double belowground_nitrogen()
const
663 {
return this->total_nitrogen() - this->aboveground_nitrogen(); };
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(); };
670 double cn_ratio()
const
671 {
return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
675 {
return this->mBud * cbm::CCDM; };
679 {
return this->dead_structural_matter() * cbm::CCDM; };
683 {
return this->mFol * cbm::CCDM; };
686 double c_dfol()
const
687 {
return this->dw_dfol * cbm::CCDM; };
691 {
return this->mFrt * cbm::CCDM; };
695 {
return this->living_structural_matter() * cbm::CCDM; };
698 double f_fol_maximum()
const
700 double f_fol_max( 0.0);
701 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
703 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
705 f_fol_max = this->fFol_fl[fl];
711 double n_leaf_surface()
const
714 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
716 n_tot += nh4_fl[fl] + no3_fl[fl];
722 double m_fol_fl(
size_t _fl)
const
723 {
return this->mFol * this->fFol_fl[_fl]; }
734 double belowground_respiration()
735 {
return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
737 double d_belowground_respiration()
738 {
return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
743 ldate_t seeding_date;
744 double initial_biomass;
748 MoBiLE_PlantSettings m_plantsettings;
749 friend class MoBiLE_PlantVegetation;
750 MoBiLE_PlantVegetation
const * m_plantvegetation;
753class LDNDC_API MoBiLE_PlantVegetation :
public LD_PlantVegetation< MoBiLE_Plant >
756 MoBiLE_PlantVegetation( LD_PlantsParametersDB
const * = NULL);
757 ~MoBiLE_PlantVegetation();
759 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings
const *);
760 lerr_t delete_plant(
char const * );
762 bool is_family( MoBiLE_Plant
const *,
char const * )
const;
763 bool is_family(
char const * ,
char const * )
const;
773 size_t speciesparameters_generation()
const;
775 void set_input( speciesparameters::input_class_speciesparameters_t
const * _speciesparameters)
776 { this->m_speciesparameters = _speciesparameters; }
777 MoBiLE_PlantParameters get_parameters(
char const * );
781 double canopy_height();
782 size_t canopy_layers_used();
785 double lai_fl(
size_t );
787 double mfrt_sl(
size_t );
788 double rootlength_sl(
size_t );
789 double root_density_sl(
size_t ,
double ,
bool );
793 speciesparameters::input_class_speciesparameters_t
const * m_speciesparameters;
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;
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