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;
130 double dcBud, d_dcBud;
132 double dcFac, d_dcFac;
134 double dcFol, d_dcFol;
136 double dcFrt, d_dcFrt;
138 double dcSap, d_dcSap;
141 double nox_uptake, d_nox_uptake;
143 double nhy_uptake, d_nhy_uptake;
145 double n2_fixation, d_n2_fixation;
148 double dvsFlush, dvsFlushOld;
155 double exsuLoss, d_exsuLoss;
167 double f_h2o, d_f_h2o;
218 double nLitBud, d_nLitBud;
220 double nLitFol, d_nLitFol;
222 double nLitWoodAbove, d_nLitWoodAbove;
225 double n_retention, d_n_retention;
252 double rGroBelow, d_rGroBelow;
258 double rSapBelow, d_rSapBelow;
269 double sWoodAbove, d_sWoodAbove;
272 double growing_degree_days;
284 double xylem_resistance;
290 double stem_shrinkage;
299 double * sFol_na, * d_sFol_na;
302 double * carbonuptake_fl, * d_carbonuptake_fl;
304 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
306 double * o2i_fl, * o2i_std_fl;
308 double * co2comp25_fl, * co2comp25_std_fl;
320 double * isoprene_emission_fl, * d_isoprene_emission_fl;
322 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
324 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
326 double * ovoc_emission_fl, * d_ovoc_emission_fl;
328 double * kco2_fl, * kco2_std_fl;
330 double * ko2_fl, * ko2_std_fl;
344 double * relativeconductance_fl, * d_relativeconductance_fl;
350 double * atp_pool_fl;
358 double * nadph_pool_fl;
370 double * jPot_fl, * d_jPot_fl;
374 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
386 double * vcMax_fl, * vcMax_std_fl;
389 double * rootlength_sl;
393 double * nLitFrt_sl, * d_nLitFrt_sl;
395 double * sFrt_sl, * d_sFrt_sl;
397 double * sWoodBelow_sl, * d_sWoodBelow_sl;
399 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
412 {
return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
421 double interception_capacity()
const
422 {
return this->aboveground_wood() * this->parameters()->MWWM()
423 + this->lai() * this->parameters()->MWFM(); };
432 double stand_volume()
const
433 {
return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
435 double dead_structural_matter()
const
436 {
return ( this->mCor + this->dw_dst); };
438 double living_structural_matter()
const
439 {
return ( this->mSap + this->dw_lst); };
441 double foliage_matter()
const
442 {
return ( this->mFol + this->dw_dfol); };
445 double aboveground_biomass()
const
446 {
return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud)); };
449 double aboveground_structural_matter()
const
450 {
return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * ( 1.0 - this->parameters()->UGWDF()); };
453 double aboveground_wood()
const
454 {
return ( this->mSap + this->mCor) * ( 1.0 - this->parameters()->UGWDF()); };
457 double belowground_biomass()
const
458 {
return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0)); };
461 double belowground_structural_matter()
const
462 {
return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * this->parameters()->UGWDF(); };
465 double belowground_wood()
const
466 {
return ( this->mSap + this->mCor) * this->parameters()->UGWDF(); };
469 double stem_wood()
const
470 {
return this->aboveground_wood() * ( 1.0 - this->f_branch); };
473 double branch_wood()
const
474 {
return this->aboveground_wood() * this->f_branch; };
477 double total_biomass()
const
478 {
return this->mSap + this->dw_lst +
479 this->mCor + this->dw_dst +
480 this->mFol + this->dw_dfol +
481 this->mBud + this->mFrt; };
485 {
return this->mCor * this->ncCor; }
486 double nc_cor()
const
487 {
return this->ncCor; }
491 {
return this->mSap * this->ncSap; }
492 double nc_sap()
const
493 {
return this->ncSap; }
497 {
return this->mFrt * this->ncFrt; }
498 double nc_frt()
const
499 {
return this->ncFrt; }
503 {
return this->mFol * this->ncFol; }
504 double nc_fol()
const
505 {
return this->ncFol; }
509 {
return this->mBud * this->ncBud; }
510 double nc_bud()
const
511 {
return this->ncBud; }
514 double nc_lst()
const
515 {
return cbm::flt_greater_zero( this->mSap + this->dw_lst) ? (this->n_sap() + this->n_lst) / (this->mSap + this->dw_lst): 0.0; }
518 double nc_dst()
const
519 {
return cbm::flt_greater_zero( this->mCor + this->dw_dst) ? (this->n_cor() + this->n_dst) / (this->mCor + this->dw_dst): 0.0; }
522 double aboveground_nitrogen()
const
523 {
return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * ( 1.0 - this->parameters()->UGWDF())
524 + this->n_fol() + this->n_dfol
525 + (this->parameters()->TUBER() ? 0.0 : this->n_bud())); };
528 double belowground_nitrogen()
const
529 {
return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * this->parameters()->UGWDF()
530 + this->n_frt() + (this->parameters()->TUBER() ? this->n_bud() : 0.0)); };
533 double total_nitrogen()
const
534 {
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(); };
537 double cn_ratio()
const
538 {
return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
542 {
return this->mBud * cbm::CCDM; };
546 {
return (this->mCor + this->dw_dst) * cbm::CCDM; };
550 {
return this->mFol * cbm::CCDM; };
553 double c_dfol()
const
554 {
return this->dw_dfol * cbm::CCDM; };
558 {
return this->mFrt * cbm::CCDM; };
562 {
return (this->mSap + this->dw_lst) * cbm::CCDM; };
565 double f_fol_maximum()
const
567 double f_fol_max( 0.0);
568 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
570 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
572 f_fol_max = this->fFol_fl[fl];
578 double n_leaf_surface()
const
581 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
583 n_tot += nh4_fl[fl] + no3_fl[fl];
589 double m_fol_fl(
size_t _fl)
const
590 {
return this->mFol * this->fFol_fl[_fl]; }
601 double belowground_respiration()
602 {
return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
604 double d_belowground_respiration()
605 {
return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
610 ldate_t seeding_date;
611 double initial_biomass;
615 MoBiLE_PlantSettings m_plantsettings;
616 friend class MoBiLE_PlantVegetation;
617 MoBiLE_PlantVegetation
const * m_plantvegetation;
620class LDNDC_API MoBiLE_PlantVegetation :
public LD_PlantVegetation< MoBiLE_Plant >
623 MoBiLE_PlantVegetation( LD_PlantsParametersDB
const * = NULL);
624 ~MoBiLE_PlantVegetation();
626 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings
const *);
627 lerr_t delete_plant(
char const * );
629 bool is_family( MoBiLE_Plant
const *,
char const * )
const;
630 bool is_family(
char const * ,
char const * )
const;
632 void set_input( speciesparameters::input_class_speciesparameters_t
const * _speciesparameters)
633 { this->m_speciesparameters = _speciesparameters; }
634 MoBiLE_PlantParameters get_parameters(
char const * );
638 double canopy_height();
639 size_t canopy_layers_used();
642 double lai_fl(
size_t );
644 double mfrt_sl(
size_t );
645 double rootlength_sl(
size_t );
646 double root_density_sl(
size_t ,
double ,
bool );
650 speciesparameters::input_class_speciesparameters_t
const * m_speciesparameters;
653typedef MoBiLE_PlantVegetation::Iterator PlantIterator;
654typedef MoBiLE_PlantVegetation::GroupIterator< species::crop > CropIterator;
655typedef MoBiLE_PlantVegetation::GroupIterator< species::grass > GrassIterator;
656typedef MoBiLE_PlantVegetation::GroupIterator< species::wood > TreeIterator;
Spatially explicit groundwater model.
Definition airchemistryput.h:15