LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
ldndc::PhysiologyPlaMox Class Reference

Vegetation model PlaMox: carbon and nitrogen dynamics of crops and grass (see PlaMox - Plant Growth Model). More...

#include <models/physiology/plamox/plamox.h>

Public Member Functions

 PhysiologyPlaMox (MoBiLE_State *, cbm::io_kcomm_t *, timemode_e)
 Constructor.
 
 ~PhysiologyPlaMox ()
 Delete allocated classes.
 
lerr_t configure (ldndc::config_file_t const *)
 
lerr_t register_ports (cbm::io_kcomm_t *)
 
lerr_t initialize ()
 
lerr_t solve ()
 
lerr_t unregister_ports (cbm::io_kcomm_t *)
 
lerr_t finalize ()
 Finalization (nothing to do)
 
lerr_t sleep ()
 Sleep (nothing to do)
 
lerr_t wake ()
 Wake up (nothing to do)
 

Private Types

enum  plant_life_cycle_e {
  ANNUAL = 0 ,
  BIENNIAL ,
  PLURIENNIAL ,
  PERENNIAL
}
 Life cycle of a plant. More...
 
enum  plamox_family_e {
  FAMILY_RICE = 1u << 0 ,
  FAMILY_WHEAT = 1u << 1 ,
  FAMILY_CORNS = 1u << 2 ,
  FAMILY_BRASSICANAPUS = 1u << 3 ,
  FAMILY_MILT = 1u << 4 ,
  FAMILY_SORG = 1u << 5 ,
  FAMILY_CASSAVA = 1u << 6 ,
  FAMILY_PERENNIAL = 1u << 7
}
 Species families with specific functions in PlaMox (bit flags) More...
 
typedef std::vector< MoBiLE_Plant * >::iterator PlaMoxIterator
 Iterator over all plants whose family is handled by PlaMox (model option plantfamilies), see PlaMox_update_plant_list()
 

Private Member Functions

 LMOD_EXPORT_MODULE_INFO (PhysiologyPlaMox,"physiology:plamox","Physiology PlaMox")
 Module registration.
 
lerr_t PlaMox_step_init ()
 pre-run initialization each time step
 
lerr_t PlaMox_step_resize ()
 resize plant species vector
 
lerr_t PlaMox_step_out ()
 Post-time step: oxygen deficiency, soil nitrogen and published fields.
 
lerr_t PlaMox_management ()
 Applies grazing and cutting events.
 
lerr_t PlaMox_planting ()
 Handles all pending planting events.
 
lerr_t PlaMox_event_plant (MoBiLE_Plant *, EventAttributes const &)
 Initializes a newly planted plant (see Planting)
 
lerr_t PlaMox_harvest ()
 Handles all pending harvest events.
 
lerr_t PlaMox_event_harvest (MoBiLE_Plant *, EventAttributes const &)
 Harvests a plant (see Harvest)
 
lerr_t PlaMox_reset_phenology (MoBiLE_Plant *)
 Resets the phenological state of a plant.
 
lerr_t PlaMox_photosynthesis (MoBiLE_Plant *)
 Photosynthesis and allocation of assimilates (see Photosynthesis and growth)
 
void PlaMox_vernalization (MoBiLE_Plant *)
 Chilling units and chill factor (see Vernalization)
 
void PlaMox_growing_degree_days (MoBiLE_Plant *)
 Growing degree days, development stage, mortality state and emergence (see Growing degree days)
 
void PlaMox_heat_stress_limitation (MoBiLE_Plant *_vt)
 Heat stress around flowering that limits the fruit set (see Heat stress around flowering)
 
void PlaMox_plant_development_crop (MoBiLE_Plant *)
 Allocation fractions of crops (see Crops)
 
lerr_t PlaMox_allocation_grass (MoBiLE_Plant *)
 Allocation fractions of grass (see Grass)
 
lerr_t PlaMox_bud_burst (MoBiLE_Plant *)
 Translocation from storage to foliage of grass (see Bud burst of grass)
 
lerr_t PlaMox_redistribution (MoBiLE_Plant *)
 Retranslocation of stem and leaf mass to the fruit (see Retranslocation to the fruit)
 
void PlaMox_respiration (MoBiLE_Plant *)
 Maintenance and growth respiration (see Respiration)
 
void PlaMox_exsudation (MoBiLE_Plant *)
 Root exudation (see Root exudation)
 
void PlaMox_nitrogen_uptake (MoBiLE_Plant *)
 Nitrogen uptake from the soil (see Nitrogen uptake)
 
lerr_t PlaMox_nitrogen_fixation (MoBiLE_Plant *)
 Symbiotic nitrogen fixation (see Nitrogen fixation)
 
lerr_t PlaMox_senescence (MoBiLE_Plant *)
 Aboveground and belowground senescence (see Senescence)
 
lerr_t PlaMox_abscission (MoBiLE_Plant *)
 Shedding of dead foliage and stems of grass (see Abscission of grass)
 
void PlaMox_drought (MoBiLE_Plant *)
 Drought stress index (see Drought stress)
 
void PlaMox_transpiration (MoBiLE_Plant *)
 Potential transpiration (see Transpiration)
 
void PlaMox_update_root_structure (MoBiLE_Plant *, double)
 Distributes new fine root mass over the soil layers and updates the root conductivity (see Root structure)
 
void PlaMox_update_height (MoBiLE_Plant *)
 Plant height and height of the canopy base (see Plant height)
 
void PlaMox_update_ground_cover (MoBiLE_Plant *)
 Ground cover (see Ground cover)
 
void PlaMox_update_foliage_structure (MoBiLE_Plant *)
 Foliage distribution and leaf area index of the foliage layers (see Leaf area)
 
void PlaMox_update_specific_leaf_area (MoBiLE_Plant *)
 Specific leaf area of the foliage layers (see Specific leaf area)
 
void PlaMox_update_nitrogen_concentrations (MoBiLE_Plant *)
 Distributes the plant nitrogen among the living compartments (see Nitrogen distribution)
 
double PlaMox_get_nitrogen_deficiency (MoBiLE_Plant *)
 Nitrogen deficiency factor of photosynthesis [-] (see Nitrogen deficiency)
 
double PlaMox_get_biomass_induced_downregulation (MoBiLE_Plant *)
 Biomass-induced down-regulation of photosynthesis [-] (see Biomass-induced down-regulation)
 
double PlaMox_get_age_factor (MoBiLE_Plant *)
 Age factor [-] (see Age factor)
 
double PlaMox_get_frost_factor (MoBiLE_Plant *, double)
 Low temperature factor [-] (see Low temperature factor)
 
double PlaMox_get_hypoxia_factor (MoBiLE_Plant *)
 Photosynthesis factor for oxygen deficiency [-] (see Oxygen deficiency (hypoxia))
 
double PlaMox_get_heat_factor (MoBiLE_Plant *)
 Heat factor [-] (see Heat factor)
 
double PlaMox_get_foliage_nitrogen_concentration (MoBiLE_Plant *)
 Optimum foliage nitrogen concentration [kgN kgDW-1] (see Optimum foliage nitrogen concentration)
 
double PlaMox_n_opt (MoBiLE_Plant *)
 Optimum nitrogen of the living plant [kgN m-2] (see Optimum plant nitrogen)
 
void PlaMox_balance_check (int)
 Carbon and nitrogen balance check (stage ON_ENTRY or ON_EXIT)
 
lerr_t PLAMOX_CHECK_FOR_NEGATIVE_VALUE (char const *)
 Debugging helper: checks the plant states for negative values or NaN.
 
void PlaMox_update_plant_list ()
 Updates the list of plants handled by PlaMox and their family flags.
 
bool PlaMox_is_family (MoBiLE_Plant const *_p, unsigned int _family) const
 True if the plant belongs to the given family (see plamox_family_e)
 
PlaMoxIterator begin ()
 First plant handled by PlaMox.
 
PlaMoxIterator end ()
 End of the plants handled by PlaMox.
 
plant_life_cycle_e PlaMox_get_life_cycle (MoBiLE_Plant *)
 Life cycle of a plant: perennial for grass and the families ment and alfa, annual otherwise.
 

Private Attributes

MoBiLE_State * m_state
 Model state.
 
cbm::io_kcomm_t * io_kcomm
 Input/output communicator.
 
input_class_climate_t const & cl_
 Climate input.
 
input_class_setup_t const * m_setup
 Setup input (e.g., canopy layers, latitude)
 
input_class_soillayers_t const & sl_
 Soil layers input.
 
input_class_species_t const * m_species
 Species input.
 
input_class_speciesparameters_t const * m_speciesparameters
 Species parameters input.
 
input_class_siteparameters_t const * m_siteparameters
 Site parameters input.
 
remotesensing::input_class_remotesensing_t const * rm_
 Optional remote sensing input (leaf area index)
 
MoBiLE_PlantVegetation * m_veg
 Vegetation (all plants)
 
substate_airchemistry_t & ac_
 Air chemistry state (CO2 concentration)
 
substate_microclimate_t & mc_
 Microclimate state (temperature, radiation, vapour pressure deficit)
 
substate_physiology_t & ph_
 Physiology state (canopy layers, nitrogen uptake, exports)
 
substate_soilchemistry_t & sc_
 Soil chemistry state (nitrogen, carbon, litter, oxygen)
 
substate_watercycle_t & wc_
 Water cycle state (soil water, ice, transpiration)
 
SubscribedEvent< LD_EventHandlerQueue > m_HarvestEvents
 Harvest events.
 
SubscribedEvent< LD_EventHandlerQueue > m_PlantEvents
 Planting events.
 
PublishedField< double > aboveground_biomass
 Published field: aboveground biomass of all plants [kgDW m-2].
 
PublishedField< double > maturity_status
 Published field: sum of the development stages of all plants [-].
 
PublishedField< double > growing_degree_days_maturity
 Published field: sum of the growing degree days of all plants [°C d].
 
PublishedField< double > dEmerg
 Published field: sum of the days of emergence of all plants.
 
PublishedField< double > carbon_plant_biomass_total_exported_from_field
 Published field: carbon exported with harvest [kgC m-2].
 
PublishedField< double > carbon_plant_biomass_fruit_exported_from_field
 Published field: carbon exported with the fruit [kgC m-2].
 
PublishedField< double > nitrogen_plant_biomass_total_exported_from_field
 Published field: nitrogen exported with harvest [kgN m-2].
 
PublishedField< double > nitrogen_plant_biomass_fruit_exported_from_field
 Published field: nitrogen exported with the fruit [kgN m-2].
 
EventHandlerGraze m_eventgraze
 Grazing event handler.
 
EventHandlerCut m_eventcut
 Cutting event handler.
 
BerryBall plamox_berryball
 Photosynthesis.
 
NitrogenFixation * plamox_nitrogen_fixation
 Nitrogen fixation.
 
ldndc::growable_array< BaseRootSystemDNDC *, 1000, 1 > plamox_root_system
 Root system.
 
LD_PlantFunctions m_pf
 All kind of plant related functions.
 
lvector_t< double > no3_sl
 Soil nitrate (aerobic + anaerobic) available for uptake in the time step [kgN m-2].
 
lvector_t< double > nh4_sl
 Soil ammonium available for uptake in the time step [kgN m-2].
 
lvector_t< double > don_sl
 Soil DON available for uptake in the time step [kgN m-2].
 
bool have_drought_stress
 Consider drought stress yes/no.
 
bool have_heat_stress
 Consider heat stress yes/no.
 
cbm::string_t droughtstress_method
 Drought stress method (option droughtstressmethod: rootweighted or uniform)
 
cbm::string_t::cbmstring_array_t plantfamilies
 Plant families that are considered by PlaMox.
 
double const FTS_TOT_
 Time resolution factor: \( \text{FTS\_TOT\_} = \frac{1.0}{\text{time resolution}} \).
 
lvector_t< long long int > seconds_crop_planting
 Time of planting [s].
 
lvector_t< double > gdd_grain_filling
 Growing degree days at the onset of grain filling [°C d] (GDD_GRAIN_FILLING, delayed by drought for corn)
 
lvector_t< double > hypoxia
 Hypoxia index of the root system [-] (0: no stress, 1: no oxygen)
 
lvector_t< int > days_after_emergence
 Days after emergence [d] (-1 before emergence)
 
lvector_t< std::string > location
 Location of the plant for location-specific nitrogen supply.
 
lvector_t< double > dw_retranslocation_stem
 Stem mass available for retranslocation to the fruit [kgDW m-2].
 
lvector_t< double > dw_retranslocation_foliage
 Foliage mass available for retranslocation to the fruit [kgDW m-2].
 
lvector_t< double > dw_fol_old
 Foliage mass at the beginning of the time step [kgDW m-2].
 
lvector_t< double > lai_dynamic
 Leaf area index used with remote sensing input [m2 m-2].
 
std::map< std::string, double > gdd_target
 Growing degree days at the last harvest per plant name, used as maturity target [°C d].
 
bool have_automatic_nitrogen
 Potential nitrogen mode (option npot): demand not covered by uptake is supplied directly.
 
double automatic_nitrogen_uptake
 Nitrogen supplied in the potential nitrogen mode in the time step [kgN m-2].
 
double photoperiod_min
 Minimum day length of the site [h].
 
double photoperiod_max
 Maximum day length of the site [h].
 
double tot_c_
 Carbon balance at the beginning of the time step [kgC m-2].
 
double tot_n_
 Nitrogen balance at the beginning of the time step [kgN m-2].
 
double timestep_c_assi
 Carbon assimilated (and added at planting) in the time step [kgC m-2].
 
double n_at_planting
 Nitrogen added with the initial biomass at planting in the time step [kgN m-2].
 
lvector_t< double > transplanting_shock_vt
 Transplanting shock [-] (1 at transplanting, decreasing by 0.1 per day)
 
lvector_t< int > yearly_cuts
 Number of cutting events in the current year.
 
lvector_t< bool > reset_phenology
 Phenology of a perennial plant is reset as soon as MOS > 0.99.
 
lvector_t< double > n_plant
 Total plant nitrogen including dead foliage and stems [kgN m-2].
 
lvector_t< double > allocation_factor_leafs
 Allocation factor of daily assimilated carbon to leaf growth [-].
 
lvector_t< double > allocation_factor_stems
 Allocation factor of daily assimilated carbon to stem growth [-].
 
lvector_t< double > allocation_factor_fruit
 Allocation factor of daily assimilated carbon to fruit growth [-].
 
lvector_t< double > allocation_factor_roots
 Allocation factor of daily assimilated carbon to root growth [-].
 
lvector_t< double > lai_min
 Minimum leaf area index [m2 m-2]. For crops with GDD_AUTOTROPHY, it increases from the value at planting to lai_min_at_tillering at AGDD = GDD_AUTOTROPHY.
 
lvector_t< double > lai_min_at_tillering
 Minimum leaf area index at the end of the seedling phase (GDD_AUTOTROPHY) [m2 m-2].
 
lvector_t< double > fractional_cover
 Density of seeded plants with regard to optimum (full area) seeding (-).
 
lvector_t< double > chill_units
 Accumulated chilling units for vernalization;.
 
lvector_t< double > m_fruit_maximum
 Maximum fruit mass [kgDW m-2] (M_FRUIT_OPT reduced by heat stress and spikelet sterility; -1: no limit)
 
lvector_t< double > spikelets_sterility
 Spikelet sterility caused by oxygen deficiency [-].
 
lvector_t< double > nc_fol_opt
 Reference foliage nitrogen concentration of the nitrogen deficiency factor [kgN kgDW-1].
 
lvector_t< unsigned int > root_q_vt_
 Number of rooted soil layers [-], i.e., the index of the first soil layer without roots (invalid if the plant has no root system)
 
lvector_t< double > daytime_temperatures
 Daytime temperatures of the last 19 days around flowering [°C] (shared by all plants)
 
lvector_t< double > influence_heat_daily
 Daily heat impact on grain filling of the last 19 days [-].
 
double influence_heat_reduction_grainfilling
 Heat factor for grain filling (minimum of the daily heat impact) [-].
 
double day_of_flowering
 Days after emergence at flowering [d] (999 before flowering; shared by all plants)
 
double Tcrit
 Critical temperature above which heat reduces the fruit set [°C] (depends on timing and duration of the heat episode)
 
double Tzero
 Temperature of zero fruit set [°C].
 
double c_total_exported
 Carbon exported with harvest in the time step, including roots [kgC m-2].
 
double c_fruit_exported
 Carbon exported with the fruit in the time step [kgC m-2].
 
double n_total_exported
 Nitrogen exported with harvest in the time step, including roots [kgN m-2].
 
double n_fruit_exported
 Nitrogen exported with the fruit in the time step [kgN m-2].
 
std::vector< MoBiLE_Plant * > plamox_plants
 Plants handled by PlaMox in the current time step (in the order of the vegetation); updated at the beginning of each time step and after planting.
 
std::vector< std::string > plantfamily_tags
 Family tags (":family:") of the plant families handled by PlaMox.
 
lvector_t< unsigned int > family_flags
 Species family flags of each plant (slot), see plamox_family_e; updated with the plant list.
 

Detailed Description

Vegetation model PlaMox: carbon and nitrogen dynamics of crops and grass (see PlaMox - Plant Growth Model).

Author
David Kraus

Member Enumeration Documentation

◆ plamox_family_e

Species families with specific functions in PlaMox (bit flags)

Enumerator
FAMILY_RICE 

family :rice:

FAMILY_WHEAT 

family :wheat:

FAMILY_CORNS 

family :corns:

FAMILY_BRASSICANAPUS 

family :brassicanapus:

FAMILY_MILT 

family milt

FAMILY_SORG 

family sorg

FAMILY_CASSAVA 

family cassava

FAMILY_PERENNIAL 

perennial life cycle (grass or families ment, alfa)

804 {
806 FAMILY_RICE = 1u << 0,
808 FAMILY_WHEAT = 1u << 1,
810 FAMILY_CORNS = 1u << 2,
812 FAMILY_BRASSICANAPUS = 1u << 3,
814 FAMILY_MILT = 1u << 4,
816 FAMILY_SORG = 1u << 5,
818 FAMILY_CASSAVA = 1u << 6,
820 FAMILY_PERENNIAL = 1u << 7
821 };
@ FAMILY_CORNS
family :corns:
Definition plamox.h:810
@ FAMILY_CASSAVA
family cassava
Definition plamox.h:818
@ FAMILY_WHEAT
family :wheat:
Definition plamox.h:808
@ FAMILY_BRASSICANAPUS
family :brassicanapus:
Definition plamox.h:812
@ FAMILY_SORG
family sorg
Definition plamox.h:816
@ FAMILY_RICE
family :rice:
Definition plamox.h:806
@ FAMILY_PERENNIAL
perennial life cycle (grass or families ment, alfa)
Definition plamox.h:820
@ FAMILY_MILT
family milt
Definition plamox.h:814

◆ plant_life_cycle_e

Life cycle of a plant.

Enumerator
ANNUAL 

Annual plant.

BIENNIAL 

Biennial plant (currently not used)

PLURIENNIAL 

Pluriennial plant (currently not used)

PERENNIAL 

Perennial plant.

66 {
68 ANNUAL = 0,
75 };
@ BIENNIAL
Biennial plant (currently not used)
Definition plamox.h:70
@ PERENNIAL
Perennial plant.
Definition plamox.h:74
@ ANNUAL
Annual plant.
Definition plamox.h:68
@ PLURIENNIAL
Pluriennial plant (currently not used)
Definition plamox.h:72

Constructor & Destructor Documentation

◆ ~PhysiologyPlaMox()

ldndc::PhysiologyPlaMox::~PhysiologyPlaMox ( )

Delete allocated classes.

Delete:

  • roots system
  • nitrogen fixation
115{
116 for ( size_t r = 0; r < plamox_root_system.size(); ++r)
117 {
118 if ( plamox_root_system[r])
119 {
120 LD_Allocator->destroy( plamox_root_system[r]);
121 }
122 }
123
125}
ldndc::growable_array< BaseRootSystemDNDC *, 1000, 1 > plamox_root_system
Root system.
Definition plamox.h:190
NitrogenFixation * plamox_nitrogen_fixation
Nitrogen fixation.
Definition plamox.h:182

References plamox_nitrogen_fixation, and plamox_root_system.

Member Function Documentation

◆ configure()

lerr_t ldndc::PhysiologyPlaMox::configure ( ldndc::config_file_t const * _cf)

Reads the model options (see Model options).

134{
135 /* logger stream */
136 std::string loggerstream = get_option< char const * >( "loggerstream", "null");
137 loggerstream = cbm::format_expand( loggerstream);
138 PhysiologyPlaMoxLogger->initialize( loggerstream.c_str(), _cf->log_level());
139
140 /* option npot: potential nitrogen supply (see plamox_options in doc/userguide.dox) */
141 have_automatic_nitrogen = get_option< bool >( "npot", false);
143 {
144 KLOGINFO_TO( PhysiologyPlaMoxLogger, "PlaMox runs in potential nitrogen mode!");
145 }
146
147 /* option transpirationmethod */
148 cbm::string_t transpiration_method = get_option< char const * >("transpirationmethod", "wateruseefficiency");
149 if ( transpiration_method == "wateruseefficiency")
150 {
151 wc_.transpiration_method = static_cast<lflags_t>(substate_watercycle_t::WATERUSEEFFICIENCY);
152 KLOGINFO_TO( PhysiologyPlaMoxLogger,
153 "Transpiration estimated via carbon assimilation and water use efficiency!");
154 }
155 else
156 {
157 wc_.transpiration_method = static_cast<lflags_t>(substate_watercycle_t::POTENTIALTRANSPIRATION);
158 KLOGINFO_TO( PhysiologyPlaMoxLogger,
159 "Transpiration estimated via stomatal conductance and vapour pressure deficit!");
160 }
161
162 /* option droughtstress */
163 have_drought_stress = get_option< bool >( "droughtstress", true);
165 {
166 KLOGINFO_TO( PhysiologyPlaMoxLogger, "PlaMox runs not considering drought stress!");
167 }
168 /* option heatstress */
169 have_heat_stress = get_option< bool >("heatstress", true);
170 if (!have_heat_stress)
171 {
172 KLOGINFO_TO(PhysiologyPlaMoxLogger, "PlaMox runs not considering heat stress!");
173 }
174
175 /* option droughtstressmethod */
176 droughtstress_method = get_option< char const * >( "droughtstressmethod", "rootweighted");
177 if ( droughtstress_method == "uniform")
178 {
179 KLOGINFO_TO( PhysiologyPlaMoxLogger,
180 "Drought stress estimated from water availability in the rooted zone!");
181 }
182 else
183 {
184 KLOGINFO_TO( PhysiologyPlaMoxLogger,
185 "Drought stress estimated from water availability in the rooted zone ",
186 "weighted by fine roots distribution!");
187 }
188
189 plamox_berryball.stomatalconductance_method = leuning_1995_b;
190
191 /* option plantfamilies */
192 cbm::string_t plantfamilylist = get_option< char const * >( "plantfamilies", "crops grass");
193 plantfamilies = plantfamilylist.split( ' ');
194 plantfamily_tags.clear();
195 for ( size_t i = 0; i < plantfamilies.size(); ++i)
196 {
197 cbm::string_t family = ":";
198 family << plantfamilies[i] <<":";
199 plantfamily_tags.push_back( family.c_str());
200 }
201
202 return LDNDC_ERR_OK;
203}
bool have_automatic_nitrogen
Potential nitrogen mode (option npot): demand not covered by uptake is supplied directly.
Definition plamox.h:276
std::vector< std::string > plantfamily_tags
Family tags (":family:") of the plant families handled by PlaMox.
Definition plamox.h:800
BerryBall plamox_berryball
Photosynthesis.
Definition plamox.h:176
substate_watercycle_t & wc_
Water cycle state (soil water, ice, transpiration)
Definition plamox.h:141
bool have_drought_stress
Consider drought stress yes/no.
Definition plamox.h:209
bool have_heat_stress
Consider heat stress yes/no.
Definition plamox.h:214
cbm::string_t droughtstress_method
Drought stress method (option droughtstressmethod: rootweighted or uniform)
Definition plamox.h:219
cbm::string_t::cbmstring_array_t plantfamilies
Plant families that are considered by PlaMox.
Definition plamox.h:225
cbm::logger_t * PhysiologyPlaMoxLogger
Logger of PlaMox.
Definition plamox-setting.cpp:26

References droughtstress_method, have_automatic_nitrogen, have_drought_stress, have_heat_stress, ldndc::PhysiologyPlaMoxLogger, plamox_berryball, plantfamilies, plantfamily_tags, and wc_.

◆ initialize()

lerr_t ldndc::PhysiologyPlaMox::initialize ( )

Checks the time resolution (subdaily, at least two time steps per day) and acquires the optional remote sensing input (leaf area index).

213{
214 /* check for proper time resolution */
215 if ( lclock()->time_resolution() < 2)
216 {
217 KLOGERROR( "module \"", name(), "\" requires higher time resolution!\nchosen time resolution: ",
218 lclock()->time_resolution()," required time resolution: >1");
219 return LDNDC_ERR_OBJECT_INIT_FAILED;
220 }
221
222 /* optional remote sensing input (e.g., leaf area index) */
223 cbm::source_descriptor_t rm_source_info;
224 lid_t rm_id = io_kcomm->get_input_class_source_info< remotesensing::input_class_remotesensing_t >( &rm_source_info);
225 if ( rm_id != invalid_lid)
226 {
227 rm_ = io_kcomm->acquire_input< remotesensing::input_class_remotesensing_t >( &rm_source_info);
228 }
229 else
230 {
231 rm_ = NULL;
232 }
233
234 return LDNDC_ERR_OK;
235}
remotesensing::input_class_remotesensing_t const * rm_
Optional remote sensing input (leaf area index)
Definition plamox.h:126
cbm::io_kcomm_t * io_kcomm
Input/output communicator.
Definition plamox.h:110

References io_kcomm, and rm_.

◆ PlaMox_balance_check()

void ldndc::PhysiologyPlaMox::PlaMox_balance_check ( int _stage)
private

Carbon and nitrogen balance check (stage ON_ENTRY or ON_EXIT)

Carbon and nitrogen balance check of all PlaMox plants. The plant carbon and nitrogen plus the cumulative litter, exudation and export fluxes minus the inputs (assimilation; uptake, fixation, automatic supply and planting for nitrogen) are stored on entry (ON_ENTRY). On exit (ON_EXIT), a warning is issued if they changed by more than cbm::DIFFMAX.

316{
317 double tot_c( - timestep_c_assi
318 + sc_.accumulated_c_litter_stubble
319 + ph_.accumulated_c_export_harvest
320 + ph_.accumulated_c_export_grazing
321 + sc_.accumulated_c_litter_above
322 + sc_.accumulated_c_litter_below_sl.sum()
323 + sc_.accumulated_c_root_exsudates_sl.sum());
325 - m_pf.accumulated_n_uptake()
326 + sc_.accumulated_n_litter_stubble
327 + ph_.accumulated_n_export_harvest
328 + ph_.accumulated_n_export_grazing
329 + sc_.accumulated_n_litter_above
330 + sc_.accumulated_n_litter_below_sl.sum());
331
332 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
333 {
334 MoBiLE_Plant *p = *vt;
335 tot_c += p->total_biomass() * cbm::CCDM + p->rGro + p->rRes + p->rTra;
336
337 tot_n += p->total_nitrogen() - p->n2_fixation;
338 }
339 if ( _stage == ON_ENTRY)
340 {
341 tot_c_ = tot_c;
342 tot_n_ = tot_n;
343 }
344 else if ( _stage == ON_EXIT)
345 {
346 double difference( tot_c_ - tot_c);
347 if ( cbm::flt_greater( std::abs( difference), cbm::DIFFMAX))
348 {
349 KLOGWARN("C-Leak: difference is ", difference * cbm::M2_IN_HA, " kg C ha-1");
350 }
351
352 difference = tot_n_ - tot_n;
353 if ( cbm::flt_greater( std::abs( difference), cbm::DIFFMAX))
354 {
355 KLOGWARN("N-Leak: difference is ", difference * cbm::M2_IN_HA, " kg N ha-1");
356 }
357 }
358 else
359 {
360 KLOGFATAL( "[BUG] Unknown stage for Balance Check");
361 }
362}
PlaMoxIterator end()
End of the plants handled by PlaMox.
Definition plamox-setting.cpp:465
double automatic_nitrogen_uptake
Nitrogen supplied in the potential nitrogen mode in the time step [kgN m-2].
Definition plamox.h:282
substate_soilchemistry_t & sc_
Soil chemistry state (nitrogen, carbon, litter, oxygen)
Definition plamox.h:139
double tot_c_
Carbon balance at the beginning of the time step [kgC m-2].
Definition plamox.h:292
substate_physiology_t & ph_
Physiology state (canopy layers, nitrogen uptake, exports)
Definition plamox.h:137
double timestep_c_assi
Carbon assimilated (and added at planting) in the time step [kgC m-2].
Definition plamox.h:297
LD_PlantFunctions m_pf
All kind of plant related functions.
Definition plamox.h:196
std::vector< MoBiLE_Plant * >::iterator PlaMoxIterator
Iterator over all plants whose family is handled by PlaMox (model option plantfamilies),...
Definition plamox.h:786
PlaMoxIterator begin()
First plant handled by PlaMox.
Definition plamox-setting.cpp:460
double n_at_planting
Nitrogen added with the initial biomass at planting in the time step [kgN m-2].
Definition plamox.h:303
double tot_n_
Nitrogen balance at the beginning of the time step [kgN m-2].
Definition plamox.h:294

References automatic_nitrogen_uptake, begin(), end(), m_pf, n_at_planting, ph_, sc_, timestep_c_assi, tot_c_, and tot_n_.

Referenced by PlaMox_get_age_factor(), and solve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaMox_event_harvest()

lerr_t ldndc::PhysiologyPlaMox::PlaMox_event_harvest ( MoBiLE_Plant * _vt,
EventAttributes const & _attributes )
private

Harvests a plant (see Harvest)

Parameters
_vtPlant
_attributesAttributes of the harvest event
Returns
LDNDC_ERR_OK on success, an error code if the plant has no root system or the harvest attributes are invalid

Applies a harvest event to a plant (see Harvest).

926{
927 if ( plamox_root_system[_vt->slot] == NULL)
928 {
929 KLOGERROR( "[BUG] ", "root_system is NULL when not expected \"",_vt->name(),"\"!");
930 return LDNDC_ERR_RUNTIME_ERROR;
931 }
932
933 bool const mulching = _attributes.get( "/mulching", false);
934
935 double const export_root = _attributes.get( "/fraction-export-rootwood", 0.0);
936 double const rootlitter_c( (1.0 - export_root) * _vt->mFrt * cbm::CCDM);
937 double const rootlitter_n( (1.0 - export_root) * _vt->n_frt());
938 double const root_c_export( export_root * _vt->mFrt * cbm::CCDM);
939 double const root_n_export( export_root * _vt->mFrt * _vt->ncFrt);
940
941 double const straw_c( (_vt->mFol + _vt->dw_dfol + _vt->dw_lst+ _vt->dw_dst) * cbm::CCDM);
942 double const straw_n( _vt->n_fol() + _vt->n_dfol + _vt->n_lst + _vt->n_dst);
943
944 double const fru_c( _vt->mBud * cbm::CCDM);
945 double const fru_n( _vt->n_bud());
946
947 double fru_c_export( 0.0);
948 double fru_n_export( 0.0);
949
950 double straw_c_export( 0.0);
951 double straw_n_export( 0.0);
952
953 double mulching_c( 0.0);
954 double mulching_n( 0.0);
955
956 double stubble_c( 0.0);
957 double stubble_n( 0.0);
958
959 double gdd_sum( _vt->growing_degree_days );
960 double dvs_flush( _vt->dvsFlush );
961
962 double const height( _attributes.get( "/height", invalid_flt));
963 double remains_relative( _attributes.get( "/remains_relative", invalid_flt));
964 double remains_absolute( _attributes.get( "/remains_absolute", invalid_flt));
965 if( cbm::is_valid( remains_absolute))
966 {
967 remains_absolute *= cbm::HA_IN_M2;
968 }
969
970 if ( !cbm::flt_greater_equal_zero( remains_relative)
971 && !cbm::flt_greater_equal_zero( remains_absolute)
972 && !cbm::flt_greater_equal_zero( height))
973 {
974 if ( _vt->is_covercrop)
975 {
976 remains_relative = 1.0;
977 }
978 else
979 {
980 KLOGWARN( "harvest event attribute \"remains_relative\" and \"remains_absolute\" and \"height\" not set;",
981 " \"remains_relative\" set to zero and used [species=", _vt->name(),"]");
982 }
983 }
984 else if ( (cbm::flt_greater_equal_zero( remains_relative) ||
985 cbm::flt_greater_equal_zero( remains_absolute))
986 && cbm::flt_greater_equal_zero( height))
987 {
988 KLOGWARN( "harvest event attribute \"remains_(relative/absolute)\" and \"height\" both set;"
989 " attribute \"remains_relative\" used [species=", _vt->name(),"]");
990 }
991
992 if ( cbm::flt_greater_equal_zero( remains_relative))
993 {
994 /* no op */
995 }
996 else if ( cbm::flt_greater_equal_zero( remains_absolute))
997 {
998 remains_relative = cbm::bound( 0.0,
999 remains_absolute / (_vt->mFol + _vt->dw_dfol + _vt->dw_lst+ _vt->dw_dst),
1000 1.0);
1001 }
1002 else if ( cbm::flt_equal_zero( height))
1003 {
1004 remains_relative = 0.0;
1005 }
1006 else if ( cbm::flt_greater_zero( height))
1007 {
1008 double h_cum( 0.0);
1009 double remains_relative_fol = 0.0;
1010 for ( int fl = 0; fl < m_setup->canopylayers(); ++fl)
1011 {
1012 remains_relative_fol += _vt->fFol_fl[fl];
1013 h_cum += ph_.h_fl[fl];
1014 if ( cbm::flt_greater_equal( h_cum, height))
1015 {
1016 break;
1017 }
1018 }
1019
1020 h_cum = 0.0;
1021 double remains_relative_lst = 0.0;
1022 double remains_relative_lst_total = 0.0;
1023 for ( int fl = 0; fl < m_setup->canopylayers(); ++fl)
1024 {
1025 //lst decreases with height
1026 remains_relative_lst_total += pow( cbm::bound_min( 0.0, _vt->height_max - h_cum), 0.3);
1027 if ( cbm::flt_less_equal( h_cum, height))
1028 {
1029 remains_relative_lst += pow( cbm::bound_min( 0.0, _vt->height_max - h_cum), 0.3);
1030 }
1031 h_cum += ph_.h_fl[fl];
1032 }
1033 remains_relative_lst /= remains_relative_lst_total;
1034
1035 remains_relative = (remains_relative_fol * (_vt->mFol + _vt->dw_dfol) +
1036 remains_relative_lst * (_vt->dw_lst+ _vt->dw_dst)) /
1037 (_vt->mFol + _vt->dw_dfol + _vt->dw_lst+ _vt->dw_dst);
1038 }
1039 else
1040 {
1041 KLOGERROR( "[BUG] ", "harvest event attribute \"remains_relative\" and \"height\" are invalid [species=", _vt->name(),"]");
1042 return LDNDC_ERR_FAIL;
1043 }
1044
1045 stubble_c += remains_relative * straw_c;
1046 stubble_n += remains_relative * straw_n;
1047 if ( mulching)
1048 {
1049 mulching_c += (1.0-remains_relative) * straw_c;
1050 mulching_n += (1.0-remains_relative) * straw_n;
1051 }
1052 else
1053 {
1054 straw_c_export += (1.0-remains_relative) * straw_c;
1055 straw_n_export += (1.0-remains_relative) * straw_n;
1056 }
1057
1058 if ( _vt->is_covercrop)
1059 {
1060 stubble_c += remains_relative * fru_c;
1061 stubble_n += remains_relative * fru_n;
1062 if ( mulching)
1063 {
1064 mulching_c += (1.0-remains_relative) * fru_c;
1065 mulching_n += (1.0-remains_relative) * fru_n;
1066 }
1067 else
1068 {
1069 stubble_c += (1.0-remains_relative) * fru_c;
1070 stubble_n += (1.0-remains_relative) * fru_n;
1071 }
1072 }
1073 else
1074 {
1075 fru_c_export = fru_c;
1076 fru_n_export = fru_n;
1077 }
1078
1079 //export
1080 c_total_exported += straw_c_export + fru_c_export + root_c_export;
1081 c_fruit_exported += fru_c_export;
1082 n_total_exported += straw_n_export + fru_n_export + root_n_export;
1083 n_fruit_exported += fru_n_export;
1084
1085 ph_.accumulated_c_export_harvest += straw_c_export + fru_c_export + root_c_export;
1086 ph_.accumulated_n_export_harvest += straw_n_export + fru_n_export + root_n_export;
1087
1088 ph_.accumulated_c_fru_export_harvest += fru_c_export;
1089 ph_.accumulated_n_fru_export_harvest += fru_n_export;
1090
1091 //stubble litter
1092 sc_.c_stubble_lit3 += stubble_c * (*_vt)->LIGNIN();
1093 sc_.c_stubble_lit2 += stubble_c * (*_vt)->CELLULOSE();
1094 sc_.c_stubble_lit1 += stubble_c * (1.0 - (*_vt)->LIGNIN() - (*_vt)->CELLULOSE());
1095 sc_.accumulated_c_litter_stubble += stubble_c;
1096
1097 sc_.n_stubble_lit3 += stubble_n * (*_vt)->LIGNIN();
1098 sc_.n_stubble_lit2 += stubble_n * (*_vt)->CELLULOSE();
1099 sc_.n_stubble_lit1 += stubble_n * (1.0 - (*_vt)->LIGNIN() - (*_vt)->CELLULOSE());
1100 sc_.accumulated_n_litter_stubble += stubble_n;
1101
1102 //raw litter
1103 sc_.c_raw_lit_1_above += mulching_c * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN());
1104 sc_.c_raw_lit_2_above += mulching_c * (*_vt)->CELLULOSE();
1105 sc_.c_raw_lit_3_above += mulching_c * (*_vt)->LIGNIN();
1106 sc_.accumulated_c_litter_above += mulching_c;
1107
1108 sc_.n_raw_lit_1_above += mulching_n * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN());
1109 sc_.n_raw_lit_2_above += mulching_n * (*_vt)->CELLULOSE();
1110 sc_.n_raw_lit_3_above += mulching_n * (*_vt)->LIGNIN();
1111 sc_.accumulated_n_litter_above += mulching_n;
1112
1113 //root litter
1114 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
1115 {
1116 double const dw_rootlitter( rootlitter_c / cbm::CCDM * _vt->fFrt_sl[sl]);
1117 double const n_rootlitter( dw_rootlitter * _vt->ncFrt);
1118
1119 sc_.c_raw_lit_1_sl[sl] += dw_rootlitter * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN()) * cbm::CCDM;
1120 sc_.c_raw_lit_2_sl[sl] += dw_rootlitter * (*_vt)->CELLULOSE() * cbm::CCDM;
1121 sc_.c_raw_lit_3_sl[sl] += dw_rootlitter * (*_vt)->LIGNIN() * cbm::CCDM;
1122 sc_.accumulated_c_litter_below_sl[sl] += dw_rootlitter * cbm::CCDM;
1123
1124 sc_.n_raw_lit_1_sl[sl] += n_rootlitter * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN());
1125 sc_.n_raw_lit_2_sl[sl] += n_rootlitter * (*_vt)->CELLULOSE();
1126 sc_.n_raw_lit_3_sl[sl] += n_rootlitter * (*_vt)->LIGNIN();
1127 sc_.accumulated_n_litter_below_sl[sl] += n_rootlitter;
1128 }
1129
1130 cbm::state_scratch_t * mcom = io_kcomm->get_scratch();
1131 std::string mcom_key;
1132
1133 char const * species_name = _attributes.get( "/name", "?");
1134
1135 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:daysOnField", species_name);
1136 mcom->set( mcom_key.c_str(), (double)((lclock()->seconds() - seconds_crop_planting[_vt->slot]) / cbm::SEC_IN_DAY));
1137
1138 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:gddsum", species_name);
1139 mcom->set( mcom_key.c_str(), gdd_sum);
1140
1141 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:dvsflush", species_name);
1142 mcom->set( mcom_key.c_str(), dvs_flush);
1143
1144 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_fru", species_name);
1145 mcom->set( mcom_key.c_str(), fru_c);
1146
1147 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_fru_export", species_name);
1148 mcom->set( mcom_key.c_str(), fru_c_export);
1149
1150 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_fru", species_name);
1151 mcom->set( mcom_key.c_str(), fru_n);
1152
1153 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_fru_export", species_name);
1154 mcom->set( mcom_key.c_str(), fru_n_export);
1155
1156 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_straw", species_name);
1157 mcom->set( mcom_key.c_str(), straw_c);
1158
1159 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_straw_export", species_name);
1160 mcom->set( mcom_key.c_str(), straw_c_export);
1161
1162 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_straw", species_name);
1163 mcom->set( mcom_key.c_str(), straw_n);
1164
1165 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_straw_export", species_name);
1166 mcom->set( mcom_key.c_str(), straw_n_export);
1167
1168 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_stubble", species_name);
1169 mcom->set( mcom_key.c_str(), stubble_c);
1170
1171 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_stubble", species_name);
1172 mcom->set( mcom_key.c_str(), stubble_n);
1173
1174 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_frt", species_name);
1175 mcom->set( mcom_key.c_str(), rootlitter_c);
1176
1177 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_frt", species_name);
1178 mcom->set( mcom_key.c_str(), rootlitter_n);
1179
1180 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
1181 {
1182 _vt->fFrt_sl[sl] = 0.0;
1183 _vt->rootlength_sl[sl] = 0.0;
1184 _vt->hypoxia_sl[sl] = 0.0;
1185 }
1186
1187 cbm::invalidate( root_q_vt_[_vt->slot]);
1188 _vt->rooting_depth = 0.0;
1189
1190 days_after_emergence[_vt->slot] = -1;
1191
1192 dw_retranslocation_stem[_vt->slot] = 0.0;
1193 dw_retranslocation_foliage[_vt->slot] = 0.0;
1194
1195 dw_fol_old[_vt->slot] = 0.0;
1196 lai_dynamic[_vt->slot] = 0.0;
1197
1198 _vt->mFol = 0.0;
1199 _vt->dw_dfol = 0.0;
1200 _vt->ncFol = 0.0;
1201 _vt->n_dfol = 0.0;
1202
1203 _vt->dw_lst = 0.0;
1204 _vt->n_lst = 0.0;
1205
1206 _vt->dw_dst = 0.0;
1207 _vt->n_dst = 0.0;
1208
1209 _vt->mBud = 0.0;
1210 _vt->mBudStart = 0.0;
1211 _vt->ncBud = 0.0;
1212
1213 _vt->mFrt = 0.0;
1214 _vt->ncFrt = 0.0;
1215
1216 _vt->dEmerg = -1;
1217 _vt->growing_degree_days = 0.0;
1218 _vt->dvsMort = 0.0;
1219 _vt->dvsFlush = 0.0;
1220 _vt->dvsFlushOld = 0.0;
1221
1222 n_plant[_vt->slot] = 0.0;
1223 _vt->a_fix_n = 0.0;
1224
1225 _vt->height_max = 0.0;
1226 _vt->height_at_canopy_start = 0.0;
1227
1228 _vt->f_area = 0.0;
1229 for ( int fl = 0; fl < m_setup->canopylayers(); ++fl)
1230 {
1231 _vt->fFol_fl[fl] = 0.0;
1232 _vt->lai_fl[fl] = 0.0;
1233 }
1234
1235 _vt->f_fac = 0.0;
1236 chill_units[_vt->slot] = 0.0;
1237 _vt->chill_factor = 1.0;
1238
1239 yearly_cuts[_vt->slot] = 0;
1240
1241 allocation_factor_leafs[_vt->slot] = 0.0;
1242 allocation_factor_stems[_vt->slot] = 0.0;
1243 allocation_factor_fruit[_vt->slot] = 0.0;
1244 allocation_factor_roots[_vt->slot] = 0.0;
1245
1246 m_fruit_maximum[_vt->slot] = -1.0;
1247 spikelets_sterility[_vt->slot] = 0.0;
1248 hypoxia[_vt->slot] = 0.0;
1249
1250 LD_Allocator->destroy( plamox_root_system[_vt->slot]);
1251 plamox_root_system[_vt->slot] = NULL;
1252
1253 return LDNDC_ERR_OK;
1254}
lvector_t< double > dw_fol_old
Foliage mass at the beginning of the time step [kgDW m-2].
Definition plamox.h:257
lvector_t< double > allocation_factor_stems
Allocation factor of daily assimilated carbon to stem growth [-].
Definition plamox.h:342
lvector_t< long long int > seconds_crop_planting
Time of planting [s].
Definition plamox.h:239
lvector_t< double > dw_retranslocation_foliage
Foliage mass available for retranslocation to the fruit [kgDW m-2].
Definition plamox.h:255
lvector_t< double > allocation_factor_fruit
Allocation factor of daily assimilated carbon to fruit growth [-].
Definition plamox.h:348
input_class_soillayers_t const & sl_
Soil layers input.
Definition plamox.h:118
lvector_t< double > lai_dynamic
Leaf area index used with remote sensing input [m2 m-2].
Definition plamox.h:259
double c_total_exported
Carbon exported with harvest in the time step, including roots [kgC m-2].
Definition plamox.h:450
lvector_t< double > dw_retranslocation_stem
Stem mass available for retranslocation to the fruit [kgDW m-2].
Definition plamox.h:253
lvector_t< double > m_fruit_maximum
Maximum fruit mass [kgDW m-2] (M_FRUIT_OPT reduced by heat stress and spikelet sterility; -1: no limi...
Definition plamox.h:383
lvector_t< double > allocation_factor_roots
Allocation factor of daily assimilated carbon to root growth [-].
Definition plamox.h:354
double c_fruit_exported
Carbon exported with the fruit in the time step [kgC m-2].
Definition plamox.h:452
lvector_t< double > spikelets_sterility
Spikelet sterility caused by oxygen deficiency [-].
Definition plamox.h:389
lvector_t< double > n_plant
Total plant nitrogen including dead foliage and stems [kgN m-2].
Definition plamox.h:330
double n_total_exported
Nitrogen exported with harvest in the time step, including roots [kgN m-2].
Definition plamox.h:454
lvector_t< double > allocation_factor_leafs
Allocation factor of daily assimilated carbon to leaf growth [-].
Definition plamox.h:336
double n_fruit_exported
Nitrogen exported with the fruit in the time step [kgN m-2].
Definition plamox.h:456
lvector_t< unsigned int > root_q_vt_
Number of rooted soil layers [-], i.e., the index of the first soil layer without roots (invalid if t...
Definition plamox.h:403
lvector_t< double > hypoxia
Hypoxia index of the root system [-] (0: no stress, 1: no oxygen)
Definition plamox.h:245
input_class_setup_t const * m_setup
Setup input (e.g., canopy layers, latitude)
Definition plamox.h:116
lvector_t< double > chill_units
Accumulated chilling units for vernalization;.
Definition plamox.h:376
lvector_t< int > days_after_emergence
Days after emergence [d] (-1 before emergence)
Definition plamox.h:248
lvector_t< int > yearly_cuts
Number of cutting events in the current year.
Definition plamox.h:318

References allocation_factor_fruit, allocation_factor_leafs, allocation_factor_roots, allocation_factor_stems, c_fruit_exported, c_total_exported, chill_units, days_after_emergence, dw_fol_old, dw_retranslocation_foliage, dw_retranslocation_stem, hypoxia, io_kcomm, lai_dynamic, m_fruit_maximum, m_setup, n_fruit_exported, n_plant, n_total_exported, ph_, plamox_root_system, root_q_vt_, sc_, seconds_crop_planting, sl_, spikelets_sterility, and yearly_cuts.

Referenced by PlaMox_harvest().

Here is the caller graph for this function:

◆ PlaMox_event_plant()

lerr_t ldndc::PhysiologyPlaMox::PlaMox_event_plant ( MoBiLE_Plant * _vt,
EventAttributes const & _attributes )
private

Initializes a newly planted plant (see Planting)

Parameters
_vtPlant
_attributesAttributes of the planting event
Returns
LDNDC_ERR_OK on success, an error code if the species group is not supported or the root system cannot be created

Initializes the state of a newly planted plant (see Planting).

550{
551 species_t const * sp = NULL;
552 if ( m_species)
553 {
554 sp = m_species->get_species( _vt->cname());
555 }
556
558
559 seconds_crop_planting[_vt->slot] = lclock()->seconds();
560 fractional_cover[_vt->slot] = _attributes.get( "/fractional-cover", 1.0);
561
562 //Scale growing degree days
563 //Currently only used by FarmSystem to dynamically adjust species
564 //over larger regions and/or time periods
565 double gdd_maturity_target( _attributes.get( "/gdd-maturity-target", -1.0));
566 if ( cbm::flt_less( gdd_maturity_target, 0.0) &&
567 (std::strstr( _vt->cname(), "GDD-MATURITY-TARGET") != NULL) &&
568 gdd_target.find( _vt->cname()) != gdd_target.end())
569 {
570 gdd_maturity_target = gdd_target[_vt->cname()];
571 }
572
573 if ( cbm::flt_greater_zero( gdd_maturity_target) &&
574 cbm::flt_greater_zero( (*_vt)->GDD_MATURITY()))
575 {
576 double const scale_gdd( gdd_maturity_target / (*_vt)->GDD_MATURITY());
577 MoBiLE_PlantParameters p_parameters = (*m_speciesparameters)[_vt->ctype()];
578 p_parameters.GDD_EMERGENCE_UPDATE( (*_vt)->GDD_EMERGENCE() * scale_gdd);
579 p_parameters.GDD_STEM_ELONGATION_UPDATE( (*_vt)->GDD_STEM_ELONGATION() * scale_gdd);
580 p_parameters.GDD_FLOWERING_UPDATE( (*_vt)->GDD_FLOWERING() * scale_gdd);
581 p_parameters.GDD_GRAIN_FILLING_UPDATE( (*_vt)->GDD_GRAIN_FILLING() * scale_gdd);
582 p_parameters.GDD_ROOTS_GROWN_UPDATE( (*_vt)->GDD_ROOTS_GROWN() * scale_gdd);
583 p_parameters.GDD_MATURITY_UPDATE( gdd_maturity_target);
584 _vt->switchparameters( p_parameters);
585 }
586
587 _vt->is_covercrop = _attributes.get( "/cover-crop", false);
588 //_vt->f_fac = (*_vt)->FFACMAX();
589
590 //amount of seeds
591 double const initial_biomass( cbm::bound_min( 10.0,
592 cbm::flt_greater_zero( _attributes.get( "/initial-biomass", 0.0)) ?
593 _attributes.get( "/initial-biomass", 0.0) :
594 (*_vt)->SEED_RATE()) * cbm::HA_IN_M2);
595
596 location[_vt->slot] = _attributes.get( "/location", "?");
597
598 dw_retranslocation_stem[_vt->slot] = 0.0;
599 dw_retranslocation_foliage[_vt->slot] = 0.0;
600
601 dw_fol_old[_vt->slot] = 0.0;
602 lai_dynamic[_vt->slot] = 0.0;
603
604 //plant gets biomass by species initializer
605 //store and substract later according amounts of C and N
606 //for balance check at day of planting
607 double const plant_n_old( _vt->total_nitrogen());
608 double const plant_c_old( _vt->total_biomass() * cbm::CCDM);
609
610 _vt->height_max = 0.0;
611 _vt->height_at_canopy_start = 0.0;
612
613 chill_units[_vt->slot] = 0.0;
614 _vt->chill_factor = 1.0;
615
616 _vt->f_heat_daily = 1.0;
617
618 if ( cbm::flt_greater_zero( (*_vt)->M_FRUIT_OPT()))
619 {
620 m_fruit_maximum[_vt->slot] = (*_vt)->M_FRUIT_OPT();
621 }
622 else
623 {
624 m_fruit_maximum[_vt->slot] = -1.0;
625 }
626 spikelets_sterility[_vt->slot] = 0.0;
627
628 if ( m_veg->is_family( _vt, ":rice:"))
629 {
630 nc_fol_opt[_vt->slot] = 0.5 * ((*_vt)->NC_FOLIAGE_MAX() + (*_vt)->NC_FOLIAGE_MIN());
631 }
632 else if ( m_veg->is_family( _vt, ":wheat:"))
633 {
634 nc_fol_opt[_vt->slot] = 0.5 * ((*_vt)->NC_FOLIAGE_MAX() + (*_vt)->NC_FOLIAGE_MIN());
635 }
636 else
637 {
638 nc_fol_opt[_vt->slot] = (*_vt)->NC_FOLIAGE_MAX();
639 }
640
641 gdd_grain_filling[_vt->slot] = (*_vt)->GDD_GRAIN();
642
643 hypoxia[_vt->slot] = 0.0;
644 transplanting_shock_vt[_vt->slot] = 0.0;
645
647
648 if ( cbm::is_equal( _vt->group().c_str(), "crop"))
649 {
650 lerr_t rc_plant = m_pf.initialize_crop( _vt, sp ? sp->crop() : NULL);
651 if ( rc_plant)
652 {
653 return LDNDC_ERR_OK;
654 }
655
656 /* only considered for rice so far */
657 int const seedbedduration( _attributes.get( "/seedbed-duration", 0));
658 if ( seedbedduration > 0)
659 {
660 double const mean_gdd( cbm::bound_max(mc_.nd_airtemperature - (*_vt)->GDD_BASE_TEMPERATURE(), (*_vt)->GDD_MAX_TEMPERATURE()));
661 _vt->growing_degree_days = seedbedduration * mean_gdd;
662 _vt->dvsFlush = _vt->growing_degree_days / (*_vt)->GDD_MATURITY();
663 transplanting_shock_vt[_vt->slot] = 1.0;
664 days_after_emergence[_vt->slot] = 0;
665 }
666 else
667 {
668 _vt->growing_degree_days = 0.0;
669 _vt->dvsFlush = 0.0;
670 }
671
672 allocation_factor_roots[_vt->slot] = (*_vt)->FRACTION_ROOT();
673 allocation_factor_leafs[_vt->slot] = 1.0 - (*_vt)->FRACTION_ROOT();
674 allocation_factor_stems[_vt->slot] = 0.0;
675 allocation_factor_fruit[_vt->slot] = 0.0;
676
677 _vt->ncFrt = (*_vt)->NC_FINEROOTS_MAX();
678 _vt->ncFol = (*_vt)->NC_FOLIAGE_MAX();
679 _vt->n_lst = 0.0;
680 _vt->ncBud = 0.0;
681 _vt->ncSap = 0.0;
682 _vt->ncCor = 0.0;
683
684 if ( cbm::flt_greater_zero( (*_vt)->GDD_AUTOTROPHY()))
685 {
686 _vt->mFol = 0.01 * initial_biomass;
687 _vt->mFrt = initial_biomass - _vt->mFol;
688 _vt->dw_lst = 0.0;
689 _vt->mBud = 0.0;
690 _vt->mSap = 0.0;
691 _vt->mCor = 0.0;
692
693 //assuming a constant value of 50% of seeds being respired and 50% being allocated to leaves
694 double const leaves_from_seed( 0.5 * 0.5);;
695 lai_min[_vt->slot] = 0.001;
696 lai_min_at_tillering[_vt->slot] = cbm::bound_min( lai_min[_vt->slot],
697 leaves_from_seed * initial_biomass * (*_vt)->SLAMAX());
698 }
699 else
700 {
701 double const fraction_root_start( cbm::flt_greater_zero( (*_vt)->FRACTION_ROOT_START()) ?
702 (*_vt)->FRACTION_ROOT_START() :
703 (*_vt)->FRACTION_ROOT());
704 double const initial_foliage_biomass_max( 0.02);
705 _vt->mFol = cbm::bound_max( (1.0 - fraction_root_start) * initial_biomass,
706 initial_foliage_biomass_max);
707
708 _vt->mFrt = cbm::bound_min( 0.0, initial_biomass - _vt->mFol);
709 _vt->dw_lst = 0.0;
710 _vt->mBud = 0.0;
711 _vt->mSap = 0.0;
712 _vt->mCor = 0.0;
713
714 lai_min[_vt->slot] = 0.01;
715 lai_min_at_tillering[_vt->slot] = 0.01;
716 }
717
718 n_plant[_vt->slot] = _vt->total_nitrogen();
720
721 n_at_planting += (n_plant[_vt->slot] - plant_n_old);
722 timestep_c_assi += (initial_biomass * cbm::CCDM - plant_c_old);
723 }
724 else if ( cbm::is_equal( _vt->cgroup(), "grass"))
725 {
726 lerr_t rc_plant = m_pf.initialize_grass( _vt, sp ? sp->grass() : NULL);
727 if ( rc_plant)
728 {
729 return LDNDC_ERR_OK;
730 }
731
732 if ( lclock()->seconds() > cbm::SEC_IN_DAY)
733 {
735 }
736
737 /* set to fixed value */
738 lai_min[_vt->slot] = 0.1;
739 lai_min_at_tillering[_vt->slot] = 0.1;
740
741 allocation_factor_roots[_vt->slot] = (*_vt)->FRACTION_ROOT();
742 allocation_factor_fruit[_vt->slot] = (*_vt)->FRACTION_FRUIT();
743 allocation_factor_leafs[_vt->slot] = (*_vt)->FRACTION_FOLIAGE();
744 allocation_factor_stems[_vt->slot] = (1.0 - allocation_factor_leafs[_vt->slot] - allocation_factor_roots[_vt->slot] - allocation_factor_fruit[_vt->slot]);
745
746 _vt->mFrt = allocation_factor_roots[_vt->slot] * initial_biomass;
747 _vt->mFol = allocation_factor_leafs[_vt->slot] * initial_biomass;
748 _vt->dw_lst = allocation_factor_stems[_vt->slot] * initial_biomass;
749 _vt->mBud = allocation_factor_fruit[_vt->slot] * initial_biomass;
750
751 _vt->ncFrt = (*_vt)->NC_FINEROOTS_MAX();
752 _vt->ncFol = (*_vt)->NC_FOLIAGE_MAX();
753 _vt->n_lst = (*_vt)->NC_STRUCTURAL_TISSUE_MAX() * _vt->dw_lst;
754 _vt->ncBud = (*_vt)->NC_FRUIT_MAX();
755
756 n_plant[_vt->slot] = _vt->total_nitrogen();
757
759
760 n_at_planting += (n_plant[_vt->slot] - plant_n_old);
761 timestep_c_assi += (initial_biomass * cbm::CCDM - plant_c_old);
762 }
763 else
764 {
765 KLOGERROR( "I do not handle this group of species ",
766 "[species=\"",_vt->name(),"\",group=",_vt->group(),"]");
767 return LDNDC_ERR_RUNTIME_ERROR;
768 }
769
770 // currently no concept for free available carbon
771 _vt->f_fac = 0.0;
772
773 // initialize root system
774 if (plamox_root_system.size() <= _vt->slot)
775 {
776 plamox_root_system.resize(_vt->slot+1);
777 }
778
779 if ( plamox_root_system[_vt->slot])
780 {
781 /* root system left over from a plant that was removed without PlaMox
782 * harvest (should not happen; safeguard against leaking it) */
783 KLOGWARN( "Replacing existing root system [species=", _vt->name(),"]");
784 LD_Allocator->destroy( plamox_root_system[_vt->slot]);
785 plamox_root_system[_vt->slot] = NULL;
786 }
787 plamox_root_system[_vt->slot] = LD_Allocator->construct_args< RootSystemDNDC >( 1, m_state, io_kcomm);
788 if ( !plamox_root_system[_vt->slot])
789 {
790 KLOGERROR( "Failed to allocate root-system object");
791 return LDNDC_ERR_NOMEM;
792 }
793
794 double const seed_depth = _attributes.get( "/seed-depth", 0.05);
795 root_q_vt_[_vt->slot] = sl_.soil_layer_cnt();
796 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
797 {
798 if (cbm::flt_greater( sc_.depth_sl[sl], seed_depth))
799 {
800 root_q_vt_[_vt->slot] = sl+1;
801 break;
802 }
803 }
804
805 PlaMox_update_root_structure( _vt, _vt->mFrt);
806
807 return LDNDC_ERR_OK;
808}
input_class_species_t const * m_species
Species input.
Definition plamox.h:120
MoBiLE_State * m_state
Model state.
Definition plamox.h:108
std::map< std::string, double > gdd_target
Growing degree days at the last harvest per plant name, used as maturity target [°C d].
Definition plamox.h:266
void PlaMox_update_root_structure(MoBiLE_Plant *, double)
Distributes new fine root mass over the soil layers and updates the root conductivity (see Root struc...
lvector_t< double > transplanting_shock_vt
Transplanting shock [-] (1 at transplanting, decreasing by 0.1 per day)
Definition plamox.h:312
lvector_t< double > nc_fol_opt
Reference foliage nitrogen concentration of the nitrogen deficiency factor [kgN kgDW-1].
Definition plamox.h:396
lvector_t< double > daytime_temperatures
Daytime temperatures of the last 19 days around flowering [°C] (shared by all plants)
Definition plamox.h:410
void PlaMox_update_nitrogen_concentrations(MoBiLE_Plant *)
Distributes the plant nitrogen among the living compartments (see Nitrogen distribution)
Definition plamox.cpp:3633
lerr_t PlaMox_reset_phenology(MoBiLE_Plant *)
Resets the phenological state of a plant.
Definition plamox.cpp:387
lvector_t< double > fractional_cover
Density of seeded plants with regard to optimum (full area) seeding (-).
Definition plamox.h:370
lvector_t< double > lai_min
Minimum leaf area index [m2 m-2]. For crops with GDD_AUTOTROPHY, it increases from the value at plant...
Definition plamox.h:362
lvector_t< std::string > location
Location of the plant for location-specific nitrogen supply.
Definition plamox.h:251
lvector_t< double > gdd_grain_filling
Growing degree days at the onset of grain filling [°C d] (GDD_GRAIN_FILLING, delayed by drought for c...
Definition plamox.h:242
lvector_t< double > lai_min_at_tillering
Minimum leaf area index at the end of the seedling phase (GDD_AUTOTROPHY) [m2 m-2].
Definition plamox.h:364
substate_microclimate_t & mc_
Microclimate state (temperature, radiation, vapour pressure deficit)
Definition plamox.h:135
MoBiLE_PlantVegetation * m_veg
Vegetation (all plants)
Definition plamox.h:129

References allocation_factor_fruit, allocation_factor_leafs, allocation_factor_roots, allocation_factor_stems, chill_units, days_after_emergence, daytime_temperatures, dw_fol_old, dw_retranslocation_foliage, dw_retranslocation_stem, fractional_cover, gdd_grain_filling, gdd_target, hypoxia, io_kcomm, lai_dynamic, lai_min, lai_min_at_tillering, location, m_fruit_maximum, m_pf, m_species, m_state, m_veg, mc_, n_at_planting, n_plant, nc_fol_opt, PlaMox_reset_phenology(), plamox_root_system, PlaMox_update_nitrogen_concentrations(), PlaMox_update_root_structure(), root_q_vt_, sc_, seconds_crop_planting, sl_, spikelets_sterility, timestep_c_assi, and transplanting_shock_vt.

Referenced by PlaMox_planting().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaMox_get_hypoxia_factor()

double ldndc::PhysiologyPlaMox::PlaMox_get_hypoxia_factor ( MoBiLE_Plant * _vt)
private

Photosynthesis factor for oxygen deficiency [-] (see Oxygen deficiency (hypoxia))

Returns
Photosynthesis factor for oxygen deficiency [-] (see Oxygen deficiency (hypoxia))
3757{
3758 return cbm::bound_min( 0.0, 1.0 - hypoxia[_vt->slot] * (*_vt)->HYPOXIA());
3759}

References hypoxia.

Referenced by PlaMox_get_age_factor(), and PlaMox_photosynthesis().

Here is the caller graph for this function:

◆ PlaMox_harvest()

lerr_t ldndc::PhysiologyPlaMox::PlaMox_harvest ( )
private

Handles all pending harvest events.

Applies all pending harvest events (see Harvest). Harvest events for plants that do not exist are ignored with a warning. If a plant is harvested at \( AGDD \) below 0.95 or above 1.1 times GDD_MATURITY, \( 0.95 \, AGDD \) is stored as maturity target for later plantings of the same plant (see Planting).

821{
822 EventAttributes const * ev_harv = NULL;
823 while (( ev_harv = this->m_HarvestEvents.pop()) != NULL)
824 {
825 char const * p_name = ev_harv->get( "/name", "?");
826 MoBiLE_Plant * vt = m_veg->get_plant( p_name);
827 if ( !vt)
828 {
829 /* skip only this event; returning here would drop all remaining
830 * harvest events of the time step */
831 KLOGWARN( "Harvest event for unknown plant ignored [species=", p_name,"]");
832 continue;
833 }
834
835 for ( size_t i = 0; i < this->plantfamily_tags.size(); ++i)
836 {
837 char const * family = this->plantfamily_tags[i].c_str();
838 if ( this->m_veg->is_family( vt->ctype(), family)
839 || cbm::is_equal( vt->cname(), family))
840 {
841 if ( cbm::flt_less( vt->growing_degree_days, 0.95 * (*vt)->GDD_MATURITY()) ||
842 cbm::flt_greater( vt->growing_degree_days, 1.1 * (*vt)->GDD_MATURITY()))
843 {
844 if ( gdd_target.find( vt->cname()) == gdd_target.end())
845 {
846 gdd_target.insert( { vt->cname(), 0.95 * vt->growing_degree_days});
847 }
848 else
849 {
850 gdd_target[vt->cname()] = 0.95 * vt->growing_degree_days;
851 }
852 }
853 lerr_t rc_harv = PlaMox_event_harvest( vt, *ev_harv);
854 if ( rc_harv)
855 {
856 KLOGERROR( "Handling harvest event failed [species=", vt->name(),"]");
857 return LDNDC_ERR_FAIL;
858 }
859 // TODO delete plant..
860 }
861 }
862 }
863 return LDNDC_ERR_OK;
864}
lerr_t PlaMox_event_harvest(MoBiLE_Plant *, EventAttributes const &)
Harvests a plant (see Harvest)
Definition plamox.cpp:923
SubscribedEvent< LD_EventHandlerQueue > m_HarvestEvents
Harvest events.
Definition plamox.h:145

References gdd_target, m_HarvestEvents, m_veg, PlaMox_event_harvest(), and plantfamily_tags.

Referenced by solve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaMox_management()

lerr_t ldndc::PhysiologyPlaMox::PlaMox_management ( )
private

Applies grazing and cutting events.

Applies grazing and cutting events (see Grazing and Cutting).

1284{
1285 lvector_t< double > agb_vt( m_veg->slot_cnt(), 0.0);
1286 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
1287 {
1288 MoBiLE_Plant *p = (*vt);
1289 agb_vt[p->slot] = p->aboveground_biomass();
1290 }
1291
1292 lerr_t rc_ff = m_eventgraze.update_available_freshfood_c( m_veg, species_groups_select_t< species::grass >());
1293 if ( rc_ff) { return rc_ff; }
1294
1295 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
1296 {
1297 MoBiLE_Plant *p = (*vt);
1298 if ( p->group() == "grass")
1299 {
1300 lerr_t rc_graze = m_eventgraze.event_graze_physiology( p);
1301 if ( rc_graze == LDNDC_ERR_EVENT_MATCH)
1302 {
1303 n_plant[p->slot] = p->total_nitrogen();
1304 }
1305 }
1306 }
1307
1308 lerr_t rc_cut = m_eventcut.event_cut_physiology(
1309 m_veg,
1310 species_groups_select_t< species::grass, species::crop >());
1311 if ( rc_cut == LDNDC_ERR_EVENT_MATCH)
1312 {
1313 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
1314 {
1315 MoBiLE_Plant *p = (*vt);
1316 yearly_cuts[p->slot] += 1;
1317 n_plant[p->slot] = p->total_nitrogen();
1318
1319 if ( (*p)->RATOON())
1320 {
1322 }
1323 }
1324 }
1325
1326 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
1327 {
1328 MoBiLE_Plant *p = (*vt);
1329 if ( cbm::flt_less( p->aboveground_biomass(), agb_vt[p->slot]))
1330 {
1331 double const scale( p->aboveground_biomass() / agb_vt[p->slot]);
1332 p->dvsFlush *= scale;
1333 p->dvsFlushOld *= scale;
1334 }
1335 }
1336
1337 return LDNDC_ERR_OK;
1338}
EventHandlerCut m_eventcut
Cutting event handler.
Definition plamox.h:170
EventHandlerGraze m_eventgraze
Grazing event handler.
Definition plamox.h:168

References begin(), end(), m_eventcut, m_eventgraze, m_veg, n_plant, PlaMox_reset_phenology(), and yearly_cuts.

Referenced by solve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaMox_n_opt()

double ldndc::PhysiologyPlaMox::PlaMox_n_opt ( MoBiLE_Plant * _vt)
private

Optimum nitrogen of the living plant [kgN m-2] (see Optimum plant nitrogen)

Returns
Optimum nitrogen of the living plant [kgN m-2] (see Optimum plant nitrogen)
3602{
3603 return ( _vt->mFol * PlaMox_get_foliage_nitrogen_concentration( _vt)
3604 + _vt->dw_lst * (*_vt)->NC_STRUCTURAL_TISSUE_MAX()
3605 + _vt->mFrt * (*_vt)->NC_FINEROOTS_MAX()
3606 + _vt->mBud * (*_vt)->NC_FRUIT_MAX());
3607}
double PlaMox_get_foliage_nitrogen_concentration(MoBiLE_Plant *)
Optimum foliage nitrogen concentration [kgN kgDW-1] (see Optimum foliage nitrogen concentration)
Definition plamox.cpp:4072

References PlaMox_get_foliage_nitrogen_concentration().

Referenced by PlaMox_get_age_factor(), and PlaMox_update_nitrogen_concentrations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaMox_planting()

lerr_t ldndc::PhysiologyPlaMox::PlaMox_planting ( )
private

Handles all pending planting events.

Creates the plants of all pending planting events and initializes them (see Planting).

425{
426 EventAttributes const * ev_plant = NULL;
427 while ((ev_plant = this->m_PlantEvents.pop()) != NULL)
428 {
429 char const * p_name = ev_plant->get( "/name", "?");
430 char const * p_type = ev_plant->get( "/type", "?");
431 char const * p_group = ev_plant->get( "/group", "?");
432 if ( !m_state->vegetation.have_plant( p_name))
433 {
434 species_t const * p = NULL;
435 if ( m_species)
436 { p = m_species->get_species( p_name); }
437
438 MoBiLE_PlantParameters p_parameters;
439 if ( p)
440 { p_parameters = p->get_parameters(); }
441 else if ( m_speciesparameters) /* assume event was not provided via input */
442 { p_parameters = (*m_speciesparameters)[p_type]; }
443 else
444 { /* no parameters.. */ }
445
446 MoBiLE_PlantSettings plant_settings( static_cast< unsigned int >(m_setup->canopylayers()),
447 p_name, p_type, p_group, &p_parameters);
448 plant_settings.nb_soillayers = sl_.soil_layer_cnt();
449
450 MoBiLE_Plant * plant = this->m_state->vegetation.new_plant( &plant_settings);
451 if ( plant)
452 {
453 plant->initialize();
454 }
455 else
456 {
457 KLOGERROR( "Species creation failed [species=", p->name(),"]");
458 return LDNDC_ERR_FAIL;
459 }
460 }
461
463
464 MoBiLE_Plant * vt = m_veg->get_plant( ev_plant->get( "/name", "?"));
465 if ( !vt){ return LDNDC_ERR_RUNTIME_ERROR; }
466
467 for (size_t i = 0; i < this->plantfamily_tags.size(); ++i)
468 {
469 char const * family = this->plantfamily_tags[i].c_str();
470 if ( this->m_veg->is_family( vt->ctype(), family)
471 || cbm::is_equal( vt->cname(), family))
472 {
473 lerr_t rc_plant = PlaMox_event_plant( vt, *ev_plant);
474 if ( rc_plant)
475 {
476 KLOGERROR( "Handling plant event failed [species=", vt->name(),"]");
477 return LDNDC_ERR_FAIL;
478 }
479 }
480 }
481 }
482
483 return LDNDC_ERR_OK;
484}
SubscribedEvent< LD_EventHandlerQueue > m_PlantEvents
Planting events.
Definition plamox.h:147
lerr_t PlaMox_step_resize()
resize plant species vector
Definition plamox-setting.cpp:413
input_class_speciesparameters_t const * m_speciesparameters
Species parameters input.
Definition plamox.h:122
lerr_t PlaMox_event_plant(MoBiLE_Plant *, EventAttributes const &)
Initializes a newly planted plant (see Planting)
Definition plamox.cpp:547

References m_PlantEvents, m_setup, m_species, m_speciesparameters, m_state, m_veg, PlaMox_event_plant(), PlaMox_step_resize(), plantfamily_tags, and sl_.

Referenced by solve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaMox_reset_phenology()

lerr_t ldndc::PhysiologyPlaMox::PlaMox_reset_phenology ( MoBiLE_Plant * _p)
private

Resets the phenological state of a plant.

Resets the phenological state of a plant: accumulated growing degree days, development stage \( DVS \), mortality state \( MOS \), day of emergence, days after emergence, nitrogen fixed in the season and number of cuts in the current year. Used at planting, at the beginning of a new year for perennial plants and after cutting of ratoon species.

388{
389 _p->a_fix_n = 0.0;
390 _p->growing_degree_days = 0.0;
391 _p->dEmerg = -1;
392 _p->dvsMort = 0.0;
393 _p->dvsFlush = 0.0;
394 _p->dvsFlushOld = 0.0;
395 _p->mFol_na[0] = 0.0;
396 _p->mFol_na[1] = _p->mFol;
397
398 days_after_emergence[_p->slot] = -1;
399 yearly_cuts[_p->slot] = 0;
400 reset_phenology[_p->slot] = false;
401
402 return LDNDC_ERR_OK;
403}
lvector_t< bool > reset_phenology
Phenology of a perennial plant is reset as soon as MOS > 0.99.
Definition plamox.h:324

References days_after_emergence, reset_phenology, and yearly_cuts.

Referenced by PlaMox_event_plant(), PlaMox_management(), and PlaMox_step_init().

Here is the caller graph for this function:

◆ PlaMox_step_init()

lerr_t ldndc::PhysiologyPlaMox::PlaMox_step_init ( )
private

pre-run initialization each time step

  • Resets the photosynthetic activity of all foliage layers and the accumulators of the time step (assimilation, automatic nitrogen supply, nitrogen added at planting, harvest exports).
  • At the first time step of a day: increments the days after emergence and resets the daily food consumption of grazers.
  • At the beginning of the year (hemisphere dependent), the phenology of perennial plants is flagged for a reset, which is carried out as soon as the mortality state \( MOS \) exceeds 0.99 (see Phenology).
  • Copies the soil nitrogen pools available for uptake (ammonium, DON and the sum of aerobic and anaerobic nitrate).
178{
181
182 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
183 {
184 MoBiLE_Plant *p = (*vt);
185
186 /* reset */
187 for ( int fl = 0; fl < m_setup->canopylayers(); ++fl)
188 {
189 p->vcAct25_fl[fl] = 0.0;
190 p->jAct25_fl[fl] = 0.0;
191 p->rdAct25_fl[fl] = 0.0;
192 }
193 }
194
195 timestep_c_assi = 0.0;
197 n_at_planting = 0.0;
198
199 c_total_exported = 0.0;
200 c_fruit_exported = 0.0;
201 n_total_exported = 0.0;
202 n_fruit_exported = 0.0;
203
204
205
206 if ( lclock()->subday() == 1)
207 {
208 m_eventgraze.reset_daily_food_consumption();
209
210 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
211 {
212 MoBiLE_Plant *p = (*vt);
213 if ( days_after_emergence[p->slot] >= 0)
214 {
215 days_after_emergence[p->slot] += 1;
216 }
217 }
218 }
219
220 if ( MoBiLE_IsBeginningOfYear( lclock(), m_setup->latitude()))
221 {
222 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
223 {
224 MoBiLE_Plant *p = (*vt);
226 && (lclock()->seconds() > seconds_crop_planting[p->slot])) //avoid reset directly after planting at start of year
227 {
228 reset_phenology[p->slot] = true;
229 }
230 }
231 }
232
233 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
234 {
235 MoBiLE_Plant *p = (*vt);
236 if ( reset_phenology[p->slot]
237 && cbm::flt_greater(p->dvsMort, 0.99))
238 {
240 }
241 dw_fol_old[p->slot] = p->mFol;
242 }
243
244 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
245 {
246 nh4_sl[sl] = sc_.nh4_sl[sl];
247 don_sl[sl] = sc_.don_sl[sl];
248 no3_sl[sl] = sc_.no3_sl[sl] + sc_.an_no3_sl[sl];
249 }
250
251 return LDNDC_ERR_OK;
252}
plant_life_cycle_e PlaMox_get_life_cycle(MoBiLE_Plant *)
Life cycle of a plant: perennial for grass and the families ment and alfa, annual otherwise.
Definition plamox.cpp:4095
lvector_t< double > don_sl
Soil DON available for uptake in the time step [kgN m-2].
Definition plamox.h:203
lvector_t< double > no3_sl
Soil nitrate (aerobic + anaerobic) available for uptake in the time step [kgN m-2].
Definition plamox.h:199
lvector_t< double > nh4_sl
Soil ammonium available for uptake in the time step [kgN m-2].
Definition plamox.h:201
void PlaMox_update_plant_list()
Updates the list of plants handled by PlaMox and their family flags.
Definition plamox-setting.cpp:470

References ANNUAL, automatic_nitrogen_uptake, begin(), c_fruit_exported, c_total_exported, days_after_emergence, don_sl, dw_fol_old, end(), m_eventgraze, m_setup, n_at_planting, n_fruit_exported, n_total_exported, nh4_sl, no3_sl, PlaMox_get_life_cycle(), PlaMox_reset_phenology(), PlaMox_step_resize(), PlaMox_update_plant_list(), reset_phenology, sc_, seconds_crop_planting, sl_, and timestep_c_assi.

Referenced by solve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaMox_step_out()

lerr_t ldndc::PhysiologyPlaMox::PlaMox_step_out ( )
private

Post-time step: oxygen deficiency, soil nitrogen and published fields.

  • Calculates the oxygen deficiency of the rooted soil layers, which is used in the next time step (see Oxygen deficiency (hypoxia)).
  • Stores the development stage of this time step (used by the development-based nitrogen fixation).
  • Writes the soil nitrogen pools back. Nitrate is split between the aerobic and anaerobic soil fraction in proportion to the pools before uptake (by the anaerobic volume fraction if both pools were empty).
  • Publishes aboveground biomass, development stage, growing degree days, day of emergence and the harvest exports of the time step.
269{
270 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
271 {
272 MoBiLE_Plant *p = (*vt);
273 hypoxia[p->slot] = 0.0;
274 size_t const sl_rooted( cbm::is_valid( root_q_vt_[p->slot]) ? root_q_vt_[p->slot] : 0);
275 for ( size_t sl = sl_rooted; sl < sl_.soil_layer_cnt(); ++sl)
276 {
277 p->hypoxia_sl[sl] = 0.0;
278 }
279 if ( cbm::flt_greater_zero( p->belowground_respiration()) &&
280 cbm::flt_greater_zero( m_veg->dw_frt()) &&
281 cbm::flt_greater_zero( p->mFrt) &&
282 cbm::is_valid( root_q_vt_[p->slot]) &&
283 cbm::flt_equal_zero( p->root_tc))
284 {
285 hypoxia[p->slot] = 0.0;
286 // O2 demand [kgO2 m-2] of belowground respiration [kgC m-2] (1 mol O2 per mol C)
287 double const o2_demand( p->belowground_respiration() * 2.0 * cbm::MO / cbm::MC);
288 for (size_t sl = 0; sl < root_q_vt_[p->slot]; sl++)
289 {
290 // calc available o2 in this soil layer for this species
291 double const v_pores( sc_.h_sl[sl] * sc_.poro_sl[sl]);
292 double const v_water( wc_.wc_sl[sl] / cbm::DWAT * sc_.h_sl[sl]);
293 double const v_ice( wc_.ice_sl[sl] / cbm::DICE * sc_.h_sl[sl]);
294 double const v_air( cbm::bound_min( 0.0, v_pores - v_water - v_ice));
295 double const o2( sc_.o2_sl[sl] * v_air /
296 ((mc_.temp_sl[sl] + cbm::D_IN_K) * (cbm::RGAS / (2.0 * cbm::MO * cbm::KG_IN_G) * cbm::PA_IN_BAR)));
297 // scale to root mass of species in relation to total root mass of all species per soil layer
298 // calc o2 demand of this species in this soil layer
299 double const o2_demand_sl( p->fFrt_sl[sl] * o2_demand);
300 double const o2_avail( o2 * (p->fFrt_sl[sl] * p->mFrt) / m_veg->mfrt_sl( sl));
301
302 if ( cbm::flt_greater( o2_demand_sl, o2_avail))
303 {
304 // 1 is full stress (no o2 avail), 0 is no stress (demand can be fullfiled)
305 // The value for the whole root system is weighed by the fine root distribution.
306 p->hypoxia_sl[sl] = cbm::bound( 0.0, 1.0 - o2_avail / o2_demand_sl, 1.0);
307 hypoxia[p->slot] += p->fFrt_sl[sl] * p->hypoxia_sl[sl];
308 }
309 else
310 {
311 p->hypoxia_sl[sl] = 0.0;
312 }
313 }
314 }
315 }
316
317 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
318 {
319 MoBiLE_Plant *p = (*vt);
320 p->dvsFlushOld = p->dvsFlush;
321 }
322
323 double agb( 0.0);
324 double dvs( 0.0);
325 double gdd( 0.0);
326 double dEmerg_send(0.0);
327 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
328 {
329 MoBiLE_Plant *p = *vt;
330 agb += p->aboveground_biomass();
331 dvs += p->dvsFlush;
332 gdd += p->growing_degree_days;
333 dEmerg_send += p->dEmerg;
334 }
335
336 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
337 {
338 if ( cbm::flt_greater_zero( nh4_sl[sl]))
339 {
340 sc_.nh4_sl[sl] = nh4_sl[sl];
341 }
342 else { sc_.nh4_sl[sl] = 0.0; }
343
344 if ( cbm::flt_greater_zero( don_sl[sl]))
345 {
346 sc_.don_sl[sl] = don_sl[sl];
347 }
348 else { sc_.don_sl[sl] = 0.0; }
349
350 double const no3_tot( sc_.no3_sl[sl] + sc_.an_no3_sl[sl]);
351 if ( cbm::flt_greater_zero( no3_tot))
352 {
353 sc_.no3_sl[sl] = sc_.no3_sl[sl] / no3_tot * no3_sl[sl];
354 sc_.an_no3_sl[sl] = no3_sl[sl] - sc_.no3_sl[sl];
355 }
356 else
357 {
358 sc_.no3_sl[sl] = no3_sl[sl] * (1.0 - sc_.anvf_sl[sl]);
359 sc_.an_no3_sl[sl] = no3_sl[sl] - sc_.no3_sl[sl];
360 }
361 }
362
363 aboveground_biomass.send( agb);
364 maturity_status.send( dvs);
366 dEmerg.send(dEmerg_send);
367
372
373
374 return LDNDC_ERR_OK;
375}
PublishedField< double > dEmerg
Published field: sum of the days of emergence of all plants.
Definition plamox.h:156
PublishedField< double > maturity_status
Published field: sum of the development stages of all plants [-].
Definition plamox.h:152
PublishedField< double > growing_degree_days_maturity
Published field: sum of the growing degree days of all plants [°C d].
Definition plamox.h:154
PublishedField< double > nitrogen_plant_biomass_fruit_exported_from_field
Published field: nitrogen exported with the fruit [kgN m-2].
Definition plamox.h:165
PublishedField< double > carbon_plant_biomass_total_exported_from_field
Published field: carbon exported with harvest [kgC m-2].
Definition plamox.h:159
PublishedField< double > nitrogen_plant_biomass_total_exported_from_field
Published field: nitrogen exported with harvest [kgN m-2].
Definition plamox.h:163
PublishedField< double > carbon_plant_biomass_fruit_exported_from_field
Published field: carbon exported with the fruit [kgC m-2].
Definition plamox.h:161
PublishedField< double > aboveground_biomass
Published field: aboveground biomass of all plants [kgDW m-2].
Definition plamox.h:150

References aboveground_biomass, begin(), c_fruit_exported, c_total_exported, carbon_plant_biomass_fruit_exported_from_field, carbon_plant_biomass_total_exported_from_field, dEmerg, don_sl, end(), growing_degree_days_maturity, hypoxia, m_veg, maturity_status, mc_, n_fruit_exported, n_total_exported, nh4_sl, nitrogen_plant_biomass_fruit_exported_from_field, nitrogen_plant_biomass_total_exported_from_field, no3_sl, root_q_vt_, sc_, sl_, and wc_.

Referenced by solve().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlaMox_update_foliage_structure()

void ldndc::PhysiologyPlaMox::PlaMox_update_foliage_structure ( MoBiLE_Plant * _vt)
private

Foliage distribution and leaf area index of the foliage layers (see Leaf area)

Calculates the foliage distribution and the leaf area index of all foliage layers (see Leaf area).

3433{
3434 size_t const fl_cnt( _vt->nb_foliagelayers());
3435
3436 double sla_cum( 0.0);
3437 for (size_t fl = 0; fl < fl_cnt; ++fl)
3438 {
3439 sla_cum += _vt->sla_fl[fl];
3440 }
3441
3442 /* Foliage biomass for lai calculation has lower boundary ensuring: lai >= lai_min */
3443 double mFol_lai( cbm::bound_min( lai_min[_vt->slot] / (*_vt)->SLAMAX(),
3444 _vt->mFol));
3445
3446 if ( rm_ && cbm::is_valid( rm_->lai_subday( lclock_ref())))
3447 {
3448 lai_dynamic[_vt->slot] = rm_->lai_subday( lclock_ref());
3449 }
3450 else
3451 {
3452 lai_dynamic[_vt->slot] = cbm::bound_min( lai_min[_vt->slot],
3453 lai_dynamic[_vt->slot] + (_vt->mFol - dw_fol_old[_vt->slot]) * _vt->sla_fl[fl_cnt-1]);
3454 }
3455
3456 if (cbm::flt_greater_zero( transplanting_shock_vt[_vt->slot]))
3457 {
3458 mFol_lai = mFol_lai * cbm::bound_min( 0.01, 1.0 - transplanting_shock_vt[_vt->slot]);
3459 }
3460
3461 if ( cbm::flt_greater_zero( sla_cum))
3462 {
3463 DroughtStress droughtstress;
3464 droughtstress.fh2o_ref = (*_vt)->H2OREF_LEAF_GROWTH();
3465
3466 //use dynamic lai only if remote sensing input is available
3467 if ( rm_)
3468 {
3469 for (size_t fl = 0; fl < fl_cnt; ++fl)
3470 {
3471 _vt->fFol_fl[fl] = _vt->sla_fl[fl] / sla_cum;
3472 _vt->lai_fl[fl] = lai_dynamic[_vt->slot] * _vt->fFol_fl[fl] * droughtstress.linear_threshold( _vt->f_h2o);
3473 }
3474 }
3475 else
3476 {
3477 for (size_t fl = 0; fl < fl_cnt; ++fl)
3478 {
3479 _vt->fFol_fl[fl] = _vt->sla_fl[fl] / sla_cum;
3480 _vt->lai_fl[fl] = mFol_lai * _vt->fFol_fl[fl] * _vt->sla_fl[fl] * droughtstress.linear_threshold( _vt->f_h2o);
3481 }
3482 }
3483
3484 for (int fl = fl_cnt; fl < m_setup->canopylayers(); ++fl)
3485 {
3486 _vt->fFol_fl[fl] = 0.0;
3487 _vt->lai_fl[fl] = 0.0;
3488 _vt->sla_fl[fl] = 0.0;
3489 }
3490 }
3491 else
3492 {
3493 for (int fl = 0; fl < m_setup->canopylayers(); ++fl)
3494 {
3495 _vt->fFol_fl[fl] = 0.0;
3496 _vt->lai_fl[fl] = 0.0;
3497 _vt->sla_fl[fl] = 0.0;
3498 }
3499 }
3500}

References dw_fol_old, lai_dynamic, lai_min, m_setup, rm_, and transplanting_shock_vt.

Referenced by PlaMox_update_ground_cover(), and solve().

Here is the caller graph for this function:

◆ register_ports()

lerr_t ldndc::PhysiologyPlaMox::register_ports ( cbm::io_kcomm_t * _io_kcomm)

Publishes aboveground biomass, development stage, growing degree days, day of emergence and harvest exports; subscribes to planting and harvest events and registers the ports of the cutting and grazing handlers.

246{
247 lerr_t rc = LDNDC_ERR_OK;
248
249 aboveground_biomass.publish( "AbovegroundBiomass", "kg/m2", _io_kcomm);
250 maturity_status.publish( "MaturityStatus", "-", _io_kcomm);
251 growing_degree_days_maturity.publish( "GrowingDegreeDays", "-", _io_kcomm);
252 dEmerg.publish("dEmerg_send", "-", _io_kcomm);
253
254 carbon_plant_biomass_total_exported_from_field.publish( "carbon_plant_biomass_total_exported_from_field", "kg/m2", _io_kcomm);
255 carbon_plant_biomass_fruit_exported_from_field.publish( "carbon_plant_biomass_fruit_exported_from_field", "kg/m2", _io_kcomm);
256 nitrogen_plant_biomass_total_exported_from_field.publish( "nitrogen_plant_biomass_total_exported_from_field", "kg/m2", _io_kcomm);
257 nitrogen_plant_biomass_fruit_exported_from_field.publish( "nitrogen_plant_biomass_fruit_exported_from_field", "kg/m2", _io_kcomm);
258
259 rc = m_eventcut.register_ports( _io_kcomm);
260 if ( rc)
261 { return LDNDC_ERR_FAIL; }
262
263 rc = m_eventgraze.register_ports( _io_kcomm);
264 if ( rc)
265 { return LDNDC_ERR_FAIL; }
266
267 int rc_harvest = this->m_HarvestEvents.subscribe( "harvest", _io_kcomm);
268 if ( rc_harvest != LD_PortOk)
269 { return LDNDC_ERR_FAIL; }
270
271 int rc_plant = this->m_PlantEvents.subscribe( "plant", _io_kcomm);
272 if ( rc_plant != LD_PortOk)
273 { return LDNDC_ERR_FAIL; }
274
275 return rc;
276}

References aboveground_biomass, carbon_plant_biomass_fruit_exported_from_field, carbon_plant_biomass_total_exported_from_field, dEmerg, growing_degree_days_maturity, m_eventcut, m_eventgraze, m_HarvestEvents, m_PlantEvents, maturity_status, nitrogen_plant_biomass_fruit_exported_from_field, and nitrogen_plant_biomass_total_exported_from_field.

◆ solve()

lerr_t ldndc::PhysiologyPlaMox::solve ( )

Simulates one time step of all plants handled by PlaMox in the order given in Processes within a time step. Grazing, cutting and planting are applied at the beginning, harvest at the end of the time step. The carbon and nitrogen balance of all plants is checked in between.

36{
37 /* Pre-time step setting */
38 (void)PlaMox_step_init();
39
40 /* Begin balance check */
41 PlaMox_balance_check( ON_ENTRY);
42
43 /* Grazing and Cutting */
44 lerr_t rc = PlaMox_management();
45 if ( rc) { return rc; }
46
47 /* Planting */
50
51 /* Vernalization */
52 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
53 {
54 MoBiLE_Plant *p = *vt;
57 }
58
59 /* Plant development
60 * determines how much C is given to which plant part in photosynthesis (C allocation) */
61 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
62 {
63 MoBiLE_Plant *p = *vt;
65
66 if ( p->group() == "crop")
67 {
69 }
70 else if ( p->group() == "grass")
71 {
73 }
74 }
75
76 /* Photosynthesis activity and carbon allocation
77 * The C is translated into biomass via CCDM. */
78 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
79 {
80 MoBiLE_Plant *p = *vt;
81
82 // here some mass is added to _vt->mFrt! but the root length is not increased
83 lerr_t rc_photosynthesis = PlaMox_photosynthesis( p);
84
85 if ( rc_photosynthesis)
86 {
87 KLOGERROR( "Photosynthesis calculation failed [species=", p->name(),"]");
88 return LDNDC_ERR_FAIL;
89 }
90
91 /* root growth */
92 PlaMox_update_root_structure( p, p->dcFrt/cbm::CCDM);
93
94 if ( p->group() == "grass")
95 {
97 }
98
100 }
101
102 /* Nitrogen uptake/fixation */
103 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
104 {
105 MoBiLE_Plant *p = *vt;
106
108
110
111 }
112
113 /* C-losses (respiration, exudation and senescence */
114 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
115 {
116 MoBiLE_Plant *p = *vt;
117
118 /* respiration */
120
121 /* exsudation */
123
124 /* senescence */
126
127 /* abscission */
129
130 /* ground coverage */
132
133 /* plant height */
135
136 /* specific leaf area */
138
139 /* leaf area index */
141
142 /* drought */
143 PlaMox_drought( p);
144
145 /* transpiration */
147
148 }
149
150 /* Harvest */
152
153 /* End balance check */
154 PlaMox_balance_check( ON_EXIT);
155
156 /* Post-time step setting */
158
159 return LDNDC_ERR_OK;
160}
void PlaMox_nitrogen_uptake(MoBiLE_Plant *)
Nitrogen uptake from the soil (see Nitrogen uptake)
lerr_t PlaMox_step_init()
pre-run initialization each time step
Definition plamox.cpp:177
void PlaMox_update_specific_leaf_area(MoBiLE_Plant *)
Specific leaf area of the foliage layers (see Specific leaf area)
Definition plamox.cpp:3520
lerr_t PlaMox_abscission(MoBiLE_Plant *)
Shedding of dead foliage and stems of grass (see Abscission of grass)
Definition plamox.cpp:3091
lerr_t PlaMox_management()
Applies grazing and cutting events.
Definition plamox.cpp:1283
void PlaMox_heat_stress_limitation(MoBiLE_Plant *_vt)
Heat stress around flowering that limits the fruit set (see Heat stress around flowering)
Definition plamox.cpp:3803
void PlaMox_growing_degree_days(MoBiLE_Plant *)
Growing degree days, development stage, mortality state and emergence (see Growing degree days)
void PlaMox_exsudation(MoBiLE_Plant *)
Root exudation (see Root exudation)
Definition plamox.cpp:2752
lerr_t PlaMox_allocation_grass(MoBiLE_Plant *)
Allocation fractions of grass (see Grass)
void PlaMox_plant_development_crop(MoBiLE_Plant *)
Allocation fractions of crops (see Crops)
void PlaMox_update_foliage_structure(MoBiLE_Plant *)
Foliage distribution and leaf area index of the foliage layers (see Leaf area)
Definition plamox.cpp:3432
void PlaMox_respiration(MoBiLE_Plant *)
Maintenance and growth respiration (see Respiration)
lerr_t PlaMox_harvest()
Handles all pending harvest events.
Definition plamox.cpp:820
lerr_t PlaMox_step_out()
Post-time step: oxygen deficiency, soil nitrogen and published fields.
Definition plamox.cpp:268
void PlaMox_transpiration(MoBiLE_Plant *)
Potential transpiration (see Transpiration)
Definition plamox.cpp:3210
void PlaMox_balance_check(int)
Carbon and nitrogen balance check (stage ON_ENTRY or ON_EXIT)
Definition plamox-setting.cpp:315
void PlaMox_update_height(MoBiLE_Plant *)
Plant height and height of the canopy base (see Plant height)
lerr_t PlaMox_planting()
Handles all pending planting events.
Definition plamox.cpp:424
void PlaMox_vernalization(MoBiLE_Plant *)
Chilling units and chill factor (see Vernalization)
Definition plamox.cpp:1534
void PlaMox_update_ground_cover(MoBiLE_Plant *)
Ground cover (see Ground cover)
void PlaMox_drought(MoBiLE_Plant *)
Drought stress index (see Drought stress)
Definition plamox.cpp:3171
lerr_t PlaMox_redistribution(MoBiLE_Plant *)
Retranslocation of stem and leaf mass to the fruit (see Retranslocation to the fruit)
Definition plamox.cpp:2138
lerr_t PlaMox_bud_burst(MoBiLE_Plant *)
Translocation from storage to foliage of grass (see Bud burst of grass)
Definition plamox.cpp:2101
lerr_t PlaMox_nitrogen_fixation(MoBiLE_Plant *)
Symbiotic nitrogen fixation (see Nitrogen fixation)
lerr_t PlaMox_senescence(MoBiLE_Plant *)
Aboveground and belowground senescence (see Senescence)
lerr_t PlaMox_photosynthesis(MoBiLE_Plant *)
Photosynthesis and allocation of assimilates (see Photosynthesis and growth)
Definition plamox.cpp:2231

References begin(), end(), PlaMox_abscission(), PlaMox_allocation_grass(), PlaMox_balance_check(), PlaMox_bud_burst(), PlaMox_drought(), PlaMox_exsudation(), PlaMox_growing_degree_days(), PlaMox_harvest(), PlaMox_heat_stress_limitation(), PlaMox_management(), PlaMox_nitrogen_fixation(), PlaMox_nitrogen_uptake(), PlaMox_photosynthesis(), PlaMox_plant_development_crop(), PlaMox_planting(), PlaMox_redistribution(), PlaMox_respiration(), PlaMox_senescence(), PlaMox_step_init(), PlaMox_step_out(), PlaMox_transpiration(), PlaMox_update_foliage_structure(), PlaMox_update_ground_cover(), PlaMox_update_height(), PlaMox_update_plant_list(), PlaMox_update_root_structure(), PlaMox_update_specific_leaf_area(), and PlaMox_vernalization().

Here is the call graph for this function:

◆ unregister_ports()

lerr_t ldndc::PhysiologyPlaMox::unregister_ports ( cbm::io_kcomm_t * _io_kcomm)

Member Data Documentation

◆ plamox_root_system

ldndc::growable_array< BaseRootSystemDNDC*, 1000, 1 > ldndc::PhysiologyPlaMox::plamox_root_system
private

Root system.

  • rooting depth
  • root distribution

Referenced by PhysiologyPlaMox(), PlaMox_event_harvest(), PlaMox_event_plant(), PlaMox_exsudation(), and ~PhysiologyPlaMox().