11#ifndef LM_PHYSIOLOGY_PLAMOX_H_
12#define LM_PHYSIOLOGY_PLAMOX_H_
14#include "mbe_legacymodel.h"
15#include "state/mbe_state.h"
18#include <input/remotesensing/remotesensing.h>
20#include "physiology/ld_plantfunctions.h"
21#include "physiology/ld_rootsystem.h"
22#include "physiology/ld_nitrogenfixation.h"
23#include "physiology/ld_transpiration.h"
24#include "physiology/ld_vernalization.h"
25#include "watercycle/ld_droughtstress.h"
26#include "physiology/ld_stomatalconductance.h"
27#include "physiology/photofarquhar/berryball.h"
29#include "eventhandler/graze/graze.h"
30#include "eventhandler/cut/cut.h"
38extern cbm::logger_t * PhysiologyPlaMoxLogger;
40struct BaseRootSystemDNDC;
41class NitrogenFixation;
53 LMOD_EXPORT_MODULE_INFO(
PhysiologyPlaMox,
"physiology:plamox",
"Physiology PlaMox");
55 enum plant_life_cycle_e
76 lerr_t configure( ldndc::config_file_t
const *);
77 lerr_t register_ports( cbm::io_kcomm_t *);
81 lerr_t unregister_ports( cbm::io_kcomm_t *);
82 lerr_t finalize() {
return LDNDC_ERR_OK; }
84 lerr_t sleep() {
return LDNDC_ERR_OK; }
85 lerr_t wake() {
return LDNDC_ERR_OK; }
89 MoBiLE_State * m_state;
90 cbm::io_kcomm_t * io_kcomm;
93 input_class_climate_t
const & cl_;
94 input_class_setup_t
const * m_setup;
95 input_class_soillayers_t
const & sl_;
96 input_class_species_t
const * m_species;
97 input_class_speciesparameters_t
const * m_speciesparameters;
98 input_class_siteparameters_t
const * m_siteparameters;
99 remotesensing::input_class_remotesensing_t
const * rm_;
101 MoBiLE_PlantVegetation * m_veg;
104 substate_airchemistry_t & ac_;
105 substate_microclimate_t & mc_;
106 substate_physiology_t & ph_;
107 substate_soilchemistry_t & sc_;
108 substate_watercycle_t & wc_;
111 SubscribedEvent<LD_EventHandlerQueue> m_HarvestEvents;
112 SubscribedEvent<LD_EventHandlerQueue> m_PlantEvents;
114 PublishedField<double> aboveground_biomass;
115 PublishedField<double> maturity_status;
116 PublishedField<double> growing_degree_days_maturity;
117 PublishedField<double> dEmerg;
119 PublishedField<double> carbon_plant_biomass_total_exported_from_field;
120 PublishedField<double> carbon_plant_biomass_fruit_exported_from_field;
121 PublishedField<double> nitrogen_plant_biomass_total_exported_from_field;
122 PublishedField<double> nitrogen_plant_biomass_fruit_exported_from_field;
124 EventHandlerGraze m_eventgraze;
125 EventHandlerCut m_eventcut;
153 lvector_t< double > no3_sl;
154 lvector_t< double > nh4_sl;
155 lvector_t< double > don_sl;
190 lvector_t< long long int > seconds_crop_planting;
192 lvector_t< double > gdd_grain_filling;
194 lvector_t< double > hypoxia;
196 lvector_t< int > days_after_emergence;
198 lvector_t< std::string > location;
199 lvector_t< double > dw_retranslocation_stem;
200 lvector_t< double > dw_retranslocation_foliage;
201 lvector_t< double > dw_fol_old;
202 lvector_t< double > lai_dynamic;
208 std::map< std::string, double > gdd_target;
216 bool have_automatic_nitrogen;
221 double automatic_nitrogen_uptake;
226 double photoperiod_min;
227 double photoperiod_max;
231 double timestep_c_assi;
236 double n_at_planting;
244 lvector_t< double > transplanting_shock_vt;
249 lvector_t< int > yearly_cuts;
254 lvector_t< bool > reset_phenology;
259 lvector_t< double > n_plant;
314 lvector_t< double > m_fruit_maximum;
320 lvector_t< double > spikelets_sterility;
326 lvector_t< double > nc_fol_opt;
380 double c_total_exported;
381 double c_fruit_exported;
382 double n_total_exported;
383 double n_fruit_exported;
402 PlaMox_step_resize();
438 PlaMox_event_plant( MoBiLE_Plant *, EventAttributes
const &);
461 PlaMox_event_harvest( MoBiLE_Plant *, EventAttributes
const &);
464 PlaMox_reset_phenology( MoBiLE_Plant * );
471 PlaMox_photosynthesis( MoBiLE_Plant * );
493 PlaMox_heat_stress_limitation(MoBiLE_Plant* _vt );
500 PlaMox_plant_development_crop( MoBiLE_Plant * );
514 PlaMox_bud_burst( MoBiLE_Plant * );
521 PlaMox_redistribution( MoBiLE_Plant * );
535 PlaMox_exsudation( MoBiLE_Plant * );
560 PlaMox_abscission( MoBiLE_Plant * );
567 PlaMox_drought( MoBiLE_Plant * );
574 PlaMox_transpiration( MoBiLE_Plant * );
613 PlaMox_update_foliage_structure( MoBiLE_Plant *);
622 PlaMox_update_specific_leaf_area( MoBiLE_Plant *);
630 PlaMox_update_nitrogen_concentrations( MoBiLE_Plant *);
638 PlaMox_get_nitrogen_deficiency( MoBiLE_Plant * );
646 PlaMox_get_biomass_induced_downregulation( MoBiLE_Plant *);
655 PlaMox_get_age_factor( MoBiLE_Plant * );
666 PlaMox_get_frost_factor( MoBiLE_Plant *,
674 PlaMox_get_hypoxia_factor( MoBiLE_Plant * );
681 PlaMox_get_heat_factor( MoBiLE_Plant * );
688 PlaMox_get_foliage_nitrogen_concentration( MoBiLE_Plant * );
695 PlaMox_n_opt( MoBiLE_Plant * );
702 PlaMox_balance_check(
int );
707 lerr_t PLAMOX_CHECK_FOR_NEGATIVE_VALUE(
char const * );
722 PlaMoxIterator(MoBiLE_PlantVegetation *_vg,
723 cbm::string_t::cbmstring_array_t &_f,
724 PlantIterator
const &_it) :
729 if ( this->vegetation && this->not_my_family())
740 if ( this->iterator != this->vegetation->end())
742 for (
size_t i = 0; i < this->plantfamilies.size(); ++i)
744 cbm::string_t family =
":";
745 family << this->plantfamilies[i] <<
":";
746 if ( this->vegetation->is_family( this->iterator, family.c_str()))
757 while ( ++this->iterator != this->vegetation->end() && not_my_family())
763 PlaMoxIterator operator++()
769 MoBiLE_Plant * operator*()
771 return this->iterator.operator*();
774 bool operator==(
const PlaMoxIterator &_it)
const
776 return this->iterator.operator==( _it.iterator);
779 bool operator!=(
const PlaMoxIterator &_it)
const
781 return this->iterator.operator!=( _it.iterator);
785 MoBiLE_PlantVegetation *vegetation;
786 cbm::string_t::cbmstring_array_t plantfamilies;
787 PlantIterator iterator;
790 PlaMoxIterator begin();
792 PlaMoxIterator end();
795 PlaMox_get_life_cycle( MoBiLE_Plant *);
Vegetation model PlaMox.
Definition: plamox.h:52
void PlaMox_nitrogen_uptake(MoBiLE_Plant *)
Calculates plant nitrogen uptake based on daily demand.
lvector_t< double > allocation_factor_stems
Allocation factor of daily assimilated carbon to stem growth [-].
Definition: plamox.h:271
double influence_heat_reduction_grainfilling
Resulting impact factor of the heat stress influence on grain yield.
Definition: plamox.h:350
void PlaMox_update_root_structure(MoBiLE_Plant *, double)
Updates all relevant root structural matters.
lvector_t< double > allocation_factor_fruit
Allocation factor of daily assimilated carbon to fruit growth [-].
Definition: plamox.h:277
BerryBall plamox_berryball
Photosynthesis.
Definition: plamox.h:131
ldndc::growable_array< BaseRootSystemDNDC *, 1000, 1 > plamox_root_system
Root system.
Definition: plamox.h:145
double const FTS_TOT_
Time resolution factor: .
Definition: plamox.h:184
double day_of_flowering
day after emergence where flowering is onset
Definition: plamox.h:356
void PlaMox_growing_degree_days(MoBiLE_Plant *)
Calculates growing degree days depending on daily average temperature.
lvector_t< double > influence_heat_daily
store daily impact factor of heat stress on grain yield;
Definition: plamox.h:344
lerr_t PlaMox_allocation_grass(MoBiLE_Plant *)
Allocation metrics for grass species.
lvector_t< double > daytime_temperatures
store daytime temperature for heat stress analysis
Definition: plamox.h:338
bool have_drought_stress
Consider drought stress yes/no.
Definition: plamox.h:161
void PlaMox_respiration(MoBiLE_Plant *)
Calculates maintenance/residual and growth respiration.
lvector_t< double > allocation_factor_roots
Allocation factor of daily assimilated carbon to root growth [-].
Definition: plamox.h:283
LD_PlantFunctions m_pf
All kind of plant related functions.
Definition: plamox.h:151
NitrogenFixation * plamox_nitrogen_fixation
Nitrogen fixation.
Definition: plamox.h:137
lvector_t< double > fractional_cover
Density of seeded plants with regard to optimum (full area) seeding (-).
Definition: plamox.h:296
bool have_heat_stress
Consider heat stress yes/no.
Definition: plamox.h:166
lvector_t< double > chill_factor
Factor that retards plant development if vernalization requirement is not fullfilled.
Definition: plamox.h:302
lvector_t< double > lai_min
Minimum value of üplamt leaf area index (m^2:m^-2). For crops, this value is fixed until between sowi...
Definition: plamox.h:290
lvector_t< double > allocation_factor_leafs
Allocation factor of daily assimilated carbon to leaf growth [-].
Definition: plamox.h:265
double Tzero
The temperature at which there is zero pod-set (°C)
Definition: plamox.h:378
lvector_t< unsigned int > root_q_vt_
Largest soil layer index where roots exist [-].
Definition: plamox.h:332
void PlaMox_update_height(MoBiLE_Plant *)
void PlaMox_vernalization(MoBiLE_Plant *)
Determines the growing degree days and the plant development stage based on if vernalization requirem...
void PlaMox_update_ground_cover(MoBiLE_Plant *)
cbm::string_t droughtstress_method
Transpiration method used by PlaMox.
Definition: plamox.h:171
cbm::string_t::cbmstring_array_t plantfamilies
Plant families that are considered by PlaMox.
Definition: plamox.h:177
double Tcrit
the timing of the episode of high temperatures relative to flowering
Definition: plamox.h:373
lerr_t PlaMox_nitrogen_fixation(MoBiLE_Plant *)
Calculates plant nitrogen fixation.
lvector_t< double > chill_units
Accumulated chilling units for vernalization;.
Definition: plamox.h:308
lerr_t PlaMox_senescence(MoBiLE_Plant *)
Calculates aboveground and belowground plant senecsence.
Spatially explicit groundwater model.
Definition: airchemistryput.h:15