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;
137 double f_h2o, d_f_h2o;
185 double nLitBud, d_nLitBud;
187 double nLitFol, d_nLitFol;
189 double nLitWoodAbove, d_nLitWoodAbove;
192 double n_retention, d_n_retention;
219 double rGroBelow, d_rGroBelow;
225 double rSapBelow, d_rSapBelow;
236 double sWoodAbove, d_sWoodAbove;
239 double growing_degree_days;
251 double xylem_resistance;
257 double stem_shrinkage;
266 double * sFol_na, * d_sFol_na;
269 double * carbonuptake_fl, * d_carbonuptake_fl;
271 double * co2i_fl, * co2i_std_fl, * d_co2i_fl;
273 double * o2i_fl, * o2i_std_fl;
275 double * co2comp25_fl, * co2comp25_std_fl;
287 double * isoprene_emission_fl, * d_isoprene_emission_fl;
289 double * monoterpene_emission_fl, * d_monoterpene_emission_fl;
291 double * monoterpene_s_emission_fl, * d_monoterpene_s_emission_fl;
293 double * ovoc_emission_fl, * d_ovoc_emission_fl;
295 double * kco2_fl, * kco2_std_fl;
297 double * ko2_fl, * ko2_std_fl;
311 double * relativeconductance_fl, * d_relativeconductance_fl;
317 double * atp_pool_fl;
325 double * nadph_pool_fl;
337 double * jPot_fl, * d_jPot_fl;
341 double * jMax_fl, * jMax_std_fl, * d_jMax_fl;
353 double * vcMax_fl, * vcMax_std_fl;
356 double * rootlength_sl;
360 double * nLitFrt_sl, * d_nLitFrt_sl;
362 double * sFrt_sl, * d_sFrt_sl;
364 double * sWoodBelow_sl, * d_sWoodBelow_sl;
366 double * nLitWoodBelow_sl, * d_nLitWoodBelow_sl;
379 {
return cbm::sum( this->lai_fl, this->nb_foliagelayers()); };
388 double interception_capacity()
const
389 {
return this->aboveground_wood() * this->parameters()->MWWM()
390 + this->lai() * this->parameters()->MWFM(); };
399 double stand_volume()
const
400 {
return this->stem_wood() / (this->parameters()->DSAP() * cbm::DM3_IN_M3) * cbm::M2_IN_HA; };
402 double dead_structural_matter()
const
403 {
return ( this->mCor + this->dw_dst); };
405 double living_structural_matter()
const
406 {
return ( this->mSap + this->dw_lst); };
408 double foliage_matter()
const
409 {
return ( this->mFol + this->dw_dfol); };
412 double aboveground_biomass()
const
413 {
return ( this->aboveground_structural_matter() + this->mFol + this->dw_dfol + (this->parameters()->TUBER() ? 0.0 : this->mBud)); };
416 double aboveground_structural_matter()
const
417 {
return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * ( 1.0 - this->parameters()->UGWDF()); };
420 double aboveground_wood()
const
421 {
return ( this->mSap + this->mCor) * ( 1.0 - this->parameters()->UGWDF()); };
424 double belowground_biomass()
const
425 {
return ( this->belowground_structural_matter() + this->mFrt + (this->parameters()->TUBER() ? this->mBud : 0.0)); };
428 double belowground_structural_matter()
const
429 {
return ( this->mSap + this->mCor + this->dw_lst + this->dw_dst) * this->parameters()->UGWDF(); };
432 double belowground_wood()
const
433 {
return ( this->mSap + this->mCor) * this->parameters()->UGWDF(); };
436 double stem_wood()
const
437 {
return this->aboveground_wood() * ( 1.0 - this->f_branch); };
440 double branch_wood()
const
441 {
return this->aboveground_wood() * this->f_branch; };
444 double total_biomass()
const
445 {
return this->mSap + this->dw_lst +
446 this->mCor + this->dw_dst +
447 this->mFol + this->dw_dfol +
448 this->mBud + this->mFrt; };
452 {
return this->mCor * this->ncCor; }
453 double nc_cor()
const
454 {
return this->ncCor; }
458 {
return this->mSap * this->ncSap; }
459 double nc_sap()
const
460 {
return this->ncSap; }
464 {
return this->mFrt * this->ncFrt; }
465 double nc_frt()
const
466 {
return this->ncFrt; }
470 {
return this->mFol * this->ncFol; }
471 double nc_fol()
const
472 {
return this->ncFol; }
476 {
return this->mBud * this->ncBud; }
477 double nc_bud()
const
478 {
return this->ncBud; }
481 double nc_lst()
const
482 {
return cbm::flt_greater_zero( this->mSap + this->dw_lst) ? (this->n_sap() + this->n_lst) / (this->mSap + this->dw_lst): 0.0; }
485 double nc_dst()
const
486 {
return cbm::flt_greater_zero( this->mCor + this->dw_dst) ? (this->n_cor() + this->n_dst) / (this->mCor + this->dw_dst): 0.0; }
489 double aboveground_nitrogen()
const
490 {
return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * ( 1.0 - this->parameters()->UGWDF())
491 + this->n_fol() + this->n_dfol
492 + (this->parameters()->TUBER() ? 0.0 : this->n_bud())); };
495 double belowground_nitrogen()
const
496 {
return ( (this->n_sap() + this->n_lst + this->n_cor() + this->n_dst) * this->parameters()->UGWDF()
497 + this->n_frt() + (this->parameters()->TUBER() ? this->n_bud() : 0.0)); };
500 double total_nitrogen()
const
501 {
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(); };
504 double cn_ratio()
const
505 {
return cbm::flt_greater_zero( total_nitrogen()) ? total_biomass() * cbm::CCDM / total_nitrogen() : 0.0; };
509 {
return this->mBud * cbm::CCDM; };
513 {
return (this->mCor + this->dw_dst) * cbm::CCDM; };
517 {
return this->mFol * cbm::CCDM; };
520 double c_dfol()
const
521 {
return this->dw_dfol * cbm::CCDM; };
525 {
return this->mFrt * cbm::CCDM; };
529 {
return (this->mSap + this->dw_lst) * cbm::CCDM; };
532 double f_fol_maximum()
const
534 double f_fol_max( 0.0);
535 for (
size_t fl = 0; fl < this->nb_foliagelayers(); fl++)
537 if ( cbm::flt_greater( this->fFol_fl[fl], f_fol_max))
539 f_fol_max = this->fFol_fl[fl];
546 double m_fol_fl(
size_t _fl)
const
547 {
return this->mFol * this->fFol_fl[_fl]; }
558 double belowground_respiration()
559 {
return rGroBelow + rFrt + rTra + rSapBelow + (parameters()->TUBER() ? rBud : 0.0); };
561 double d_belowground_respiration()
562 {
return d_rGroBelow + d_rFrt + d_rTra + d_rSapBelow + (parameters()->TUBER() ? d_rBud : 0.0); };
567 ldate_t seeding_date;
568 double initial_biomass;
572 MoBiLE_PlantSettings m_plantsettings;
573 friend class MoBiLE_PlantVegetation;
574 MoBiLE_PlantVegetation
const * m_plantvegetation;
577class LDNDC_API MoBiLE_PlantVegetation :
public LD_PlantVegetation< MoBiLE_Plant >
580 MoBiLE_PlantVegetation( LD_PlantsParametersDB
const * = NULL);
581 ~MoBiLE_PlantVegetation();
583 MoBiLE_Plant * new_plant( MoBiLE_PlantSettings
const *);
584 lerr_t delete_plant(
char const * );
586 bool is_family( MoBiLE_Plant
const *,
char const * )
const;
587 bool is_family(
char const * ,
char const * )
const;
589 void set_input( speciesparameters::input_class_speciesparameters_t
const * _speciesparameters)
590 { this->m_speciesparameters = _speciesparameters; }
591 MoBiLE_PlantParameters get_parameters(
char const * );
595 double canopy_height();
596 size_t canopy_layers_used();
599 double lai_fl(
size_t );
601 double mfrt_sl(
size_t );
602 double rootlength_sl(
size_t );
606 speciesparameters::input_class_speciesparameters_t
const * m_speciesparameters;
609typedef MoBiLE_PlantVegetation::Iterator PlantIterator;
610typedef MoBiLE_PlantVegetation::GroupIterator< species::crop > CropIterator;
611typedef MoBiLE_PlantVegetation::GroupIterator< species::grass > GrassIterator;
612typedef MoBiLE_PlantVegetation::GroupIterator< species::wood > TreeIterator;
Spatially explicit groundwater model.
Definition: airchemistryput.h:15