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; }
95 double height_at_canopy_start;
104 double dcBud, d_dcBud;
106 double dcFac, d_dcFac;
108 double dcFol, d_dcFol;
110 double dcFrt, d_dcFrt;
112 double dcSap, d_dcSap;
115 double nox_uptake, d_nox_uptake;
117 double nhy_uptake, d_nhy_uptake;
119 double n2_fixation, d_n2_fixation;
122 double dvsFlush, dvsFlushOld;
129 double exsuLoss, d_exsuLoss;
141 double f_h2o, d_f_h2o;
192 double nLitBud, d_nLitBud;
194 double nLitFol, d_nLitFol;
196 double nLitWoodAbove, d_nLitWoodAbove;
199 double n_retention, d_n_retention;
226 double rGroBelow, d_rGroBelow;
232 double rSapBelow, d_rSapBelow;
243 double sWoodAbove, d_sWoodAbove;
246 double growing_degree_days;
258 double xylem_resistance;
264 double stem_shrinkage;
273 double * sFol_na, * d_sFol_na;
276 double * carbonuptake_fl, * d_carbonuptake_fl;
278 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
280 double * o2i_fl, * o2i_std_fl;
282 double * co2comp25_fl, * co2comp25_std_fl;
294 double * isoprene_emission_fl, * d_isoprene_emission_fl;
296 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
298 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
300 double * ovoc_emission_fl, * d_ovoc_emission_fl;
302 double * kco2_fl, * kco2_std_fl;
304 double * ko2_fl, * ko2_std_fl;
318 double * relativeconductance_fl, * d_relativeconductance_fl;
324 double * atp_pool_fl;
332 double * nadph_pool_fl;
344 double * jPot_fl, * d_jPot_fl;
348 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
360 double * vcMax_fl, * vcMax_std_fl;
363 double * rootlength_sl;
367 double * nLitFrt_sl, * d_nLitFrt_sl;
369 double * sFrt_sl, * d_sFrt_sl;
371 double * sWoodBelow_sl, * d_sWoodBelow_sl;
373 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
386 {
return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
395 double interception_capacity()
const
396 {
return this->aboveground_wood() * this->parameters()->MWWM()
397 + this->lai() * this->parameters()->MWFM(); };
406 double stand_volume()
const
407 {
return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
409 double dead_structural_matter()
const
410 {
return ( this->mCor + this->dw_dst); };
412 double living_structural_matter()
const
413 {
return ( this->mSap + this->dw_lst); };
415 double foliage_matter()
const
416 {
return ( this->mFol + this->dw_dfol); };
419 double aboveground_biomass()
const
420 {
return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud)); };
423 double aboveground_structural_matter()
const
424 {
return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * ( 1.0 - this->parameters()->UGWDF()); };
427 double aboveground_wood()
const
428 {
return ( this->mSap + this->mCor) * ( 1.0 - this->parameters()->UGWDF()); };
431 double belowground_biomass()
const
432 {
return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0)); };
435 double belowground_structural_matter()
const
436 {
return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * this->parameters()->UGWDF(); };
439 double belowground_wood()
const
440 {
return ( this->mSap + this->mCor) * this->parameters()->UGWDF(); };
443 double stem_wood()
const
444 {
return this->aboveground_wood() * ( 1.0 - this->f_branch); };
447 double branch_wood()
const
448 {
return this->aboveground_wood() * this->f_branch; };
451 double total_biomass()
const
452 {
return this->mSap + this->dw_lst +
453 this->mCor + this->dw_dst +
454 this->mFol + this->dw_dfol +
455 this->mBud + this->mFrt; };
459 {
return this->mCor * this->ncCor; }
460 double nc_cor()
const
461 {
return this->ncCor; }
465 {
return this->mSap * this->ncSap; }
466 double nc_sap()
const
467 {
return this->ncSap; }
471 {
return this->mFrt * this->ncFrt; }
472 double nc_frt()
const
473 {
return this->ncFrt; }
477 {
return this->mFol * this->ncFol; }
478 double nc_fol()
const
479 {
return this->ncFol; }
483 {
return this->mBud * this->ncBud; }
484 double nc_bud()
const
485 {
return this->ncBud; }
488 double nc_lst()
const
489 {
return cbm::flt_greater_zero( this->mSap + this->dw_lst) ? (this->n_sap() + this->n_lst) / (this->mSap + this->dw_lst): 0.0; }
492 double nc_dst()
const
493 {
return cbm::flt_greater_zero( this->mCor + this->dw_dst) ? (this->n_cor() + this->n_dst) / (this->mCor + this->dw_dst): 0.0; }
496 double aboveground_nitrogen()
const
497 {
return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * ( 1.0 - this->parameters()->UGWDF())
498 + this->n_fol() + this->n_dfol
499 + (this->parameters()->TUBER() ? 0.0 : this->n_bud())); };
502 double belowground_nitrogen()
const
503 {
return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * this->parameters()->UGWDF()
504 + this->n_frt() + (this->parameters()->TUBER() ? this->n_bud() : 0.0)); };
507 double total_nitrogen()
const
508 {
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(); };
511 double cn_ratio()
const
512 {
return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
516 {
return this->mBud * cbm::CCDM; };
520 {
return (this->mCor + this->dw_dst) * cbm::CCDM; };
524 {
return this->mFol * cbm::CCDM; };
527 double c_dfol()
const
528 {
return this->dw_dfol * cbm::CCDM; };
532 {
return this->mFrt * cbm::CCDM; };
536 {
return (this->mSap + this->dw_lst) * cbm::CCDM; };
539 double f_fol_maximum()
const
541 double f_fol_max( 0.0);
542 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
544 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
546 f_fol_max = this->fFol_fl[fl];
552 double n_leaf_surface()
const
555 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
557 n_tot += nh4_fl[fl] + no3_fl[fl];
563 double m_fol_fl(
size_t _fl)
const
564 {
return this->mFol * this->fFol_fl[_fl]; }
575 double belowground_respiration()
576 {
return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
578 double d_belowground_respiration()
579 {
return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
584 ldate_t seeding_date;
585 double initial_biomass;
589 MoBiLE_PlantSettings m_plantsettings;
590 friend class MoBiLE_PlantVegetation;
591 MoBiLE_PlantVegetation
const * m_plantvegetation;
594class LDNDC_API MoBiLE_PlantVegetation :
public LD_PlantVegetation< MoBiLE_Plant >
597 MoBiLE_PlantVegetation( LD_PlantsParametersDB
const * = NULL);
598 ~MoBiLE_PlantVegetation();
600 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings
const *);
601 lerr_t delete_plant(
char const * );
603 bool is_family( MoBiLE_Plant
const *,
char const * )
const;
604 bool is_family(
char const * ,
char const * )
const;
606 void set_input( speciesparameters::input_class_speciesparameters_t
const * _speciesparameters)
607 { this->m_speciesparameters = _speciesparameters; }
608 MoBiLE_PlantParameters get_parameters(
char const * );
612 double canopy_height();
613 size_t canopy_layers_used();
616 double lai_fl(
size_t );
618 double mfrt_sl(
size_t );
619 double rootlength_sl(
size_t );
620 double root_density_sl(
size_t ,
double ,
bool );
624 speciesparameters::input_class_speciesparameters_t
const * m_speciesparameters;
627typedef MoBiLE_PlantVegetation::Iterator PlantIterator;
628typedef MoBiLE_PlantVegetation::GroupIterator< species::crop > CropIterator;
629typedef MoBiLE_PlantVegetation::GroupIterator< species::grass > GrassIterator;
630typedef MoBiLE_PlantVegetation::GroupIterator< species::wood > TreeIterator;
Spatially explicit groundwater model.
Definition airchemistryput.h:15