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 n2_fixation, d_n2_fixation;
120 double dvsFlush, dvsFlushOld;
127 double exsuLoss, d_exsuLoss;
139 double f_h2o, d_f_h2o;
188 double nLitBud, d_nLitBud;
190 double nLitFol, d_nLitFol;
192 double nLitWoodAbove, d_nLitWoodAbove;
195 double n_retention, d_n_retention;
222 double rGroBelow, d_rGroBelow;
228 double rSapBelow, d_rSapBelow;
239 double sWoodAbove, d_sWoodAbove;
242 double growing_degree_days;
254 double xylem_resistance;
260 double stem_shrinkage;
269 double * sFol_na, * d_sFol_na;
272 double * carbonuptake_fl, * d_carbonuptake_fl;
274 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
276 double * o2i_fl, * o2i_std_fl;
278 double * co2comp25_fl, * co2comp25_std_fl;
290 double * isoprene_emission_fl, * d_isoprene_emission_fl;
292 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
294 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
296 double * ovoc_emission_fl, * d_ovoc_emission_fl;
298 double * kco2_fl, * kco2_std_fl;
300 double * ko2_fl, * ko2_std_fl;
314 double * relativeconductance_fl, * d_relativeconductance_fl;
320 double * atp_pool_fl;
328 double * nadph_pool_fl;
340 double * jPot_fl, * d_jPot_fl;
344 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
356 double * vcMax_fl, * vcMax_std_fl;
359 double * rootlength_sl;
363 double * nLitFrt_sl, * d_nLitFrt_sl;
365 double * sFrt_sl, * d_sFrt_sl;
367 double * sWoodBelow_sl, * d_sWoodBelow_sl;
369 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
382 {
return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
391 double interception_capacity()
const
392 {
return this->aboveground_wood() * this->parameters()->MWWM()
393 + this->lai() * this->parameters()->MWFM(); };
402 double stand_volume()
const
403 {
return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
405 double dead_structural_matter()
const
406 {
return ( this->mCor + this->dw_dst); };
408 double living_structural_matter()
const
409 {
return ( this->mSap + this->dw_lst); };
411 double foliage_matter()
const
412 {
return ( this->mFol + this->dw_dfol); };
415 double aboveground_biomass()
const
416 {
return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud)); };
419 double aboveground_structural_matter()
const
420 {
return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * ( 1.0 - this->parameters()->UGWDF()); };
423 double aboveground_wood()
const
424 {
return ( this->mSap + this->mCor) * ( 1.0 - this->parameters()->UGWDF()); };
427 double belowground_biomass()
const
428 {
return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0)); };
431 double belowground_structural_matter()
const
432 {
return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * this->parameters()->UGWDF(); };
435 double belowground_wood()
const
436 {
return ( this->mSap + this->mCor) * this->parameters()->UGWDF(); };
439 double stem_wood()
const
440 {
return this->aboveground_wood() * ( 1.0 - this->f_branch); };
443 double branch_wood()
const
444 {
return this->aboveground_wood() * this->f_branch; };
447 double total_biomass()
const
448 {
return this->mSap + this->dw_lst +
449 this->mCor + this->dw_dst +
450 this->mFol + this->dw_dfol +
451 this->mBud + this->mFrt; };
455 {
return this->mCor * this->ncCor; }
456 double nc_cor()
const
457 {
return this->ncCor; }
461 {
return this->mSap * this->ncSap; }
462 double nc_sap()
const
463 {
return this->ncSap; }
467 {
return this->mFrt * this->ncFrt; }
468 double nc_frt()
const
469 {
return this->ncFrt; }
473 {
return this->mFol * this->ncFol; }
474 double nc_fol()
const
475 {
return this->ncFol; }
479 {
return this->mBud * this->ncBud; }
480 double nc_bud()
const
481 {
return this->ncBud; }
484 double nc_lst()
const
485 {
return cbm::flt_greater_zero( this->mSap + this->dw_lst) ? (this->n_sap() + this->n_lst) / (this->mSap + this->dw_lst): 0.0; }
488 double nc_dst()
const
489 {
return cbm::flt_greater_zero( this->mCor + this->dw_dst) ? (this->n_cor() + this->n_dst) / (this->mCor + this->dw_dst): 0.0; }
492 double aboveground_nitrogen()
const
493 {
return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * ( 1.0 - this->parameters()->UGWDF())
494 + this->n_fol() + this->n_dfol
495 + (this->parameters()->TUBER() ? 0.0 : this->n_bud())); };
498 double belowground_nitrogen()
const
499 {
return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * this->parameters()->UGWDF()
500 + this->n_frt() + (this->parameters()->TUBER() ? this->n_bud() : 0.0)); };
503 double total_nitrogen()
const
504 {
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(); };
507 double cn_ratio()
const
508 {
return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
512 {
return this->mBud * cbm::CCDM; };
516 {
return (this->mCor + this->dw_dst) * cbm::CCDM; };
520 {
return this->mFol * cbm::CCDM; };
523 double c_dfol()
const
524 {
return this->dw_dfol * cbm::CCDM; };
528 {
return this->mFrt * cbm::CCDM; };
532 {
return (this->mSap + this->dw_lst) * cbm::CCDM; };
535 double f_fol_maximum()
const
537 double f_fol_max( 0.0);
538 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
540 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
542 f_fol_max = this->fFol_fl[fl];
549 double m_fol_fl(
size_t _fl)
const
550 {
return this->mFol * this->fFol_fl[_fl]; }
561 double belowground_respiration()
562 {
return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
564 double d_belowground_respiration()
565 {
return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
570 ldate_t seeding_date;
571 double initial_biomass;
575 MoBiLE_PlantSettings m_plantsettings;
576 friend class MoBiLE_PlantVegetation;
577 MoBiLE_PlantVegetation
const * m_plantvegetation;
580class LDNDC_API MoBiLE_PlantVegetation :
public LD_PlantVegetation< MoBiLE_Plant >
583 MoBiLE_PlantVegetation( LD_PlantsParametersDB
const * = NULL);
584 ~MoBiLE_PlantVegetation();
586 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings
const *);
587 lerr_t delete_plant(
char const * );
589 bool is_family( MoBiLE_Plant
const *,
char const * )
const;
590 bool is_family(
char const * ,
char const * )
const;
592 void set_input( speciesparameters::input_class_speciesparameters_t
const * _speciesparameters)
593 { this->m_speciesparameters = _speciesparameters; }
594 MoBiLE_PlantParameters get_parameters(
char const * );
598 double canopy_height();
599 size_t canopy_layers_used();
602 double lai_fl(
size_t );
604 double mfrt_sl(
size_t );
605 double rootlength_sl(
size_t );
606 double root_density_sl(
size_t ,
double ,
bool );
610 speciesparameters::input_class_speciesparameters_t
const * m_speciesparameters;
613typedef MoBiLE_PlantVegetation::Iterator PlantIterator;
614typedef MoBiLE_PlantVegetation::GroupIterator< species::crop > CropIterator;
615typedef MoBiLE_PlantVegetation::GroupIterator< species::grass > GrassIterator;
616typedef MoBiLE_PlantVegetation::GroupIterator< species::wood > TreeIterator;
Spatially explicit groundwater model.
Definition: airchemistryput.h:15