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>

Classes

struct  plamox_plant_id_t
 Fingerprint of one plant, enough to tell whether its family flags can be reused: the object itself, its slot (family_flags is indexed by it) and its species type. The type is immutable per plant and the flags follow from it; the object pointer is part of the fingerprint because plamox_plants holds plant pointers, which must not go stale when a plant is replaced. More...
 

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 ,
  FAMILY_COFFEE = 1u << 8
}
 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.
 
bool PlaMox_season_start_due (MoBiLE_Plant *)
 Flagged season start of a perennial plant takes place now (rest phase, see Season start of perennial plants)
 
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_heat_stress_reset (size_t)
 Resets the heat-stress state of one plant (slot), at planting.
 
void PlaMox_plant_development_crop (MoBiLE_Plant *)
 Allocation fractions of crops (see Crops)
 
double PlaMox_root_drought_factor (MoBiLE_Plant *)
 Factor increasing the root allocation under drought (1: no response, see Fine roots)
 
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 and coffee)
 
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)
 
double PlaMox_juvenile_specific_leaf_area (MoBiLE_Plant *, double)
 Specific leaf area of crops during the temperature driven leaf expansion in the juvenile phase (see Temperature driven leaf expansion)
 
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_phosphorus_mark (int)
 phosphorus bookkeeping at three stages of the time step: P_MARK_PRE_UPTAKE (before nitrogen uptake: seed phosphorus, losses by management), P_MARK_UPTAKE (after nitrogen uptake: phosphorus uptake), P_MARK_END (after harvest: losses, split into litter and export)
 
double PlaMox_get_nutrient_deficiency (MoBiLE_Plant *)
 nutrient deficiency of photosynthesis and root allocation: nitrogen deficiency, with phosphorus the minimum of nitrogen and phosphorus deficiency
 
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.
 
double PlaMox_coffee_fruit_set (MoBiLE_Plant *)
 Coffee: maximum fruit mass from the shoot growth of the previous season and drought during flowering [kgDW m-2] (see Coffee)
 
double PlaMox_fruit_sink (MoBiLE_Plant *, double)
 Potential fruit mass for a grain development stage [kgDW m-2]: common fruit sink of allocation and retranslocation (see Fruit sink)
 

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)
 
bool n_deficiency_reference_optimum
 Reference foliage nitrogen concentration of the nitrogen deficiency factor of species other than rice and wheat (option ndeficiencyreference: optimum, i.e., decreasing from grain filling to maturity, or maximum, i.e., NC_FOLIAGE_MAX)
 
bool have_nitrogen_limited_growth
 Nitrogen-limited shoot growth (option nlimitedgrowth): new foliage and stems need at least their minimum nitrogen concentration, assimilates that cannot be used go to the fine roots.
 
bool have_mix_cover
 Mixed stands (option mixcover, default on): area-related bounds of a plant (minimum seed mass, M_FRUIT_OPT, minimum root mass for N uptake) are scaled by its fractional cover, so that splitting a stand into several plants does not multiply them.
 
std::vector< double > nup_scale_nh4_sl_
 Nitrogen uptake of all plants from the same soil pools of the time step (pools at the beginning of the uptake step); if the summed uptake exceeds 90 % of a pool, all plants are scaled alike (see PlaMox_nitrogen_uptake_competition)
 
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].
 
lvector_t< double > lai_juvenile
 Potential leaf area index of the temperature driven leaf expansion in the juvenile phase [m2 m-2] (see Temperature driven leaf expansion)
 
lvector_t< double > gdd_juvenile
 Growing degree days at the last update of lai_juvenile [oC].
 
lvector_t< double > dw_shoot_growth_season
 Coffee: shoot (leaf and stem) growth since the last phenology reset [kgDW m-2] (see Coffee)
 
lvector_t< double > dw_shoot_growth_last
 Coffee: shoot growth of the previous season, which carries the fruit nodes [kgDW m-2].
 
lvector_t< double > f_h2o_fruit_set_sum
 Coffee: sum of the drought index between flowering and onset of fruit filling [-].
 
lvector_t< double > f_h2o_fruit_set_cnt
 Coffee: number of time steps of f_h2o_fruit_set_sum [-].
 
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 > gdd_day_start
 Season start of perennial plants (see Season start of perennial plants): growing degree days at the start of the day, consecutive days without development, days since the season start was flagged, days since the last reset at harvest (coffee)
 
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 > leaf_respiration_vt
 Leaf dark respiration of the time step calculated by BerryBall (kgC m-2).
 
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)
 
std::vector< double > daytime_temperatures
 Daytime temperatures of the last 19 days around flowering [°C], per plant (slot s: elements s*19 .. s*19+18, newest first)
 
std::vector< double > influence_heat_daily
 Daily heat impact on grain filling of the last 19 days [-], per plant (layout as daytime_temperatures)
 
lvector_t< double > influence_heat_reduction_grainfilling
 Heat factor for grain filling (minimum of the daily heat impact) [-], per plant.
 
lvector_t< double > day_of_flowering
 Days after emergence at flowering [d] (999 before flowering), per plant.
 
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< double > p_plant_
 
std::vector< double > p_n_mark_
 
std::vector< double > p_po4_sl_
 
std::vector< double > p_up_sl_
 
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.
 
std::vector< plamox_plant_id_t > plant_list_fingerprint
 The vegetation that plamox_plants and family_flags were built from, see PlaMox_update_plant_list()
 
size_t plant_list_generation
 Generation of the species parameter database when the family flags were computed. The database may be re-read during the simulation (LK_Parameters offers an update every time step), which can change family relations.
 

Static Private Attributes

static size_t const HEAT_SERIES_DAYS = 19
 Length of the heat-stress series around flowering [d].
 

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, coff)

FAMILY_COFFEE 

family coff (coffee, perennial evergreen crop)

935 {
937 FAMILY_RICE = 1u << 0,
939 FAMILY_WHEAT = 1u << 1,
941 FAMILY_CORNS = 1u << 2,
943 FAMILY_BRASSICANAPUS = 1u << 3,
945 FAMILY_MILT = 1u << 4,
947 FAMILY_SORG = 1u << 5,
949 FAMILY_CASSAVA = 1u << 6,
951 FAMILY_PERENNIAL = 1u << 7,
953 FAMILY_COFFEE = 1u << 8
954 };
@ FAMILY_CORNS
family :corns:
Definition plamox.h:941
@ FAMILY_CASSAVA
family cassava
Definition plamox.h:949
@ FAMILY_WHEAT
family :wheat:
Definition plamox.h:939
@ FAMILY_BRASSICANAPUS
family :brassicanapus:
Definition plamox.h:943
@ FAMILY_SORG
family sorg
Definition plamox.h:947
@ FAMILY_RICE
family :rice:
Definition plamox.h:937
@ FAMILY_COFFEE
family coff (coffee, perennial evergreen crop)
Definition plamox.h:953
@ FAMILY_PERENNIAL
perennial life cycle (grass or families ment, alfa, coff)
Definition plamox.h:951
@ FAMILY_MILT
family milt
Definition plamox.h:945

◆ 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.

75 {
77 ANNUAL = 0,
84 };
@ BIENNIAL
Biennial plant (currently not used)
Definition plamox.h:79
@ PERENNIAL
Perennial plant.
Definition plamox.h:83
@ ANNUAL
Annual plant.
Definition plamox.h:77
@ PLURIENNIAL
Pluriennial plant (currently not used)
Definition plamox.h:81

Constructor & Destructor Documentation

◆ ~PhysiologyPlaMox()

ldndc::PhysiologyPlaMox::~PhysiologyPlaMox ( )

Delete allocated classes.

Delete:

  • roots system
  • nitrogen fixation
137{
138 for ( size_t r = 0; r < plamox_root_system.size(); ++r)
139 {
140 if ( plamox_root_system[r])
141 {
142 LD_Allocator->destroy( plamox_root_system[r]);
143 }
144 }
145
147}
ldndc::growable_array< BaseRootSystemDNDC *, 1000, 1 > plamox_root_system
Root system.
Definition plamox.h:199
NitrogenFixation * plamox_nitrogen_fixation
Nitrogen fixation.
Definition plamox.h:191

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).

156{
157 /* logger stream */
158 std::string loggerstream = get_option< char const * >( "loggerstream", "null");
159 loggerstream = cbm::format_expand( loggerstream);
160 PhysiologyPlaMoxLogger->initialize( loggerstream.c_str(), _cf->log_level());
161
162 /* option npot: potential nitrogen supply (see plamox_options in doc/userguide.dox) */
163 have_automatic_nitrogen = get_option< bool >( "npot", false);
165 {
166 KLOGINFO_TO( PhysiologyPlaMoxLogger, "PlaMox runs in potential nitrogen mode!");
167 }
168
169 /* option transpirationmethod */
170 cbm::string_t transpiration_method = get_option< char const * >("transpirationmethod", "wateruseefficiency");
171 if ( transpiration_method == "wateruseefficiency")
172 {
173 wc_.transpiration_method = static_cast<lflags_t>(substate_watercycle_t::WATERUSEEFFICIENCY);
174 KLOGINFO_TO( PhysiologyPlaMoxLogger,
175 "Transpiration estimated via carbon assimilation and water use efficiency!");
176 }
177 else
178 {
179 wc_.transpiration_method = static_cast<lflags_t>(substate_watercycle_t::POTENTIALTRANSPIRATION);
180 KLOGINFO_TO( PhysiologyPlaMoxLogger,
181 "Transpiration estimated via stomatal conductance and vapour pressure deficit!");
182 }
183
184 /* option droughtstress */
185 have_drought_stress = get_option< bool >( "droughtstress", true);
187 {
188 KLOGINFO_TO( PhysiologyPlaMoxLogger, "PlaMox runs not considering drought stress!");
189 }
190 /* option heatstress */
191 have_heat_stress = get_option< bool >("heatstress", true);
192 if (!have_heat_stress)
193 {
194 KLOGINFO_TO(PhysiologyPlaMoxLogger, "PlaMox runs not considering heat stress!");
195 }
196
197 /* option droughtstressmethod */
198 droughtstress_method = get_option< char const * >( "droughtstressmethod", "rootweighted");
199 if ( droughtstress_method == "uniform")
200 {
201 KLOGINFO_TO( PhysiologyPlaMoxLogger,
202 "Drought stress estimated from water availability in the rooted zone!");
203 }
204 else
205 {
206 KLOGINFO_TO( PhysiologyPlaMoxLogger,
207 "Drought stress estimated from water availability in the rooted zone ",
208 "weighted by fine roots distribution!");
209 }
210
211 plamox_berryball.stomatalconductance_method = leuning_1995_b;
212 /* PlaMox has no carbon reserves: leaf dark respiration is not limited by them */
213 plamox_berryball.rd_reserve_limitation = false;
214
215 /* option c4photosynthesis: photosynthesis method of C4 plants (see @ref berryball_c4) */
216 cbm::string_t c4_photosynthesis = get_option< char const * >( "c4photosynthesis", "collatz_1992");
217 if ( c4_photosynthesis == "legacy")
218 {
219 plamox_berryball.c4_photosynthesis_method = c4_photosynthesis_legacy;
220 KLOGINFO_TO( PhysiologyPlaMoxLogger, "C4 photosynthesis with the legacy method of BerryBall!");
221 }
222 else if ( c4_photosynthesis == "collatz_1992")
223 {
224 plamox_berryball.c4_photosynthesis_method = c4_photosynthesis_collatz_1992;
225 KLOGINFO_TO( PhysiologyPlaMoxLogger, "C4 photosynthesis according to Collatz et al. (1992)!");
226 }
227 else
228 {
229 KLOGERROR( "PlaMox: unknown value of option c4photosynthesis \"", c4_photosynthesis,
230 "\" (collatz_1992, legacy)");
231 return LDNDC_ERR_FAIL;
232 }
233
234 /* option ndeficiencyreference: reference of the nitrogen deficiency (see @ref plamox_common_nitrogen_deficiency) */
235 cbm::string_t n_deficiency_reference = get_option< char const * >( "ndeficiencyreference", "optimum");
236 if ( n_deficiency_reference == "optimum")
237 {
239 }
240 else if ( n_deficiency_reference == "maximum")
241 {
243 KLOGINFO_TO( PhysiologyPlaMoxLogger, "Nitrogen deficiency relative to NC_FOLIAGE_MAX!");
244 }
245 else
246 {
247 KLOGERROR( "PlaMox: unknown value of option ndeficiencyreference \"", n_deficiency_reference,
248 "\" (optimum, maximum)");
249 return LDNDC_ERR_FAIL;
250 }
251
252 /* option nlimitedgrowth: nitrogen-limited shoot growth (see @ref plamox_allocation_nitrogen_limitation) */
253 have_nitrogen_limited_growth = get_option< bool >( "nlimitedgrowth", false);
255 {
256 KLOGINFO_TO( PhysiologyPlaMoxLogger, "PlaMox with nitrogen-limited shoot growth!");
257 }
258
259 /* option for mixed stands (see plamox.h) */
260 have_mix_cover = get_option< bool >( "mixcover", true);
261
262 /* option plantfamilies */
263 cbm::string_t plantfamilylist = get_option< char const * >( "plantfamilies", "crops grass");
264 plantfamilies = plantfamilylist.split( ' ');
265 plantfamily_tags.clear();
266 for ( size_t i = 0; i < plantfamilies.size(); ++i)
267 {
268 cbm::string_t family = ":";
269 family << plantfamilies[i] <<":";
270 plantfamily_tags.push_back( family.c_str());
271 }
272
273 return LDNDC_ERR_OK;
274}
bool have_automatic_nitrogen
Potential nitrogen mode (option npot): demand not covered by uptake is supplied directly.
Definition plamox.h:335
std::vector< std::string > plantfamily_tags
Family tags (":family:") of the plant families handled by PlaMox.
Definition plamox.h:931
bool n_deficiency_reference_optimum
Reference foliage nitrogen concentration of the nitrogen deficiency factor of species other than rice...
Definition plamox.h:235
BerryBall plamox_berryball
Photosynthesis.
Definition plamox.h:185
bool have_nitrogen_limited_growth
Nitrogen-limited shoot growth (option nlimitedgrowth): new foliage and stems need at least their mini...
Definition plamox.h:242
substate_watercycle_t & wc_
Water cycle state (soil water, ice, transpiration)
Definition plamox.h:150
bool have_drought_stress
Consider drought stress yes/no.
Definition plamox.h:218
bool have_heat_stress
Consider heat stress yes/no.
Definition plamox.h:223
cbm::string_t droughtstress_method
Drought stress method (option droughtstressmethod: rootweighted or uniform)
Definition plamox.h:228
cbm::string_t::cbmstring_array_t plantfamilies
Plant families that are considered by PlaMox.
Definition plamox.h:270
bool have_mix_cover
Mixed stands (option mixcover, default on): area-related bounds of a plant (minimum seed mass,...
Definition plamox.h:251
cbm::logger_t * PhysiologyPlaMoxLogger
Logger of PlaMox.
Definition plamox-setting.cpp:31
@ c4_photosynthesis_collatz_1992
Definition berryball.h:35
@ c4_photosynthesis_legacy
Definition berryball.h:33

References ldndc::c4_photosynthesis_collatz_1992, ldndc::c4_photosynthesis_legacy, droughtstress_method, have_automatic_nitrogen, have_drought_stress, have_heat_stress, have_mix_cover, have_nitrogen_limited_growth, n_deficiency_reference_optimum, 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).

284{
285 /* check for proper time resolution */
286 if ( lclock()->time_resolution() < 2)
287 {
288 KLOGERROR( "module \"", name(), "\" requires higher time resolution!\nchosen time resolution: ",
289 lclock()->time_resolution()," required time resolution: >1");
290 return LDNDC_ERR_OBJECT_INIT_FAILED;
291 }
292
293 /* optional remote sensing input (e.g., leaf area index) */
294 cbm::source_descriptor_t rm_source_info;
295 lid_t rm_id = io_kcomm->get_input_class_source_info< remotesensing::input_class_remotesensing_t >( &rm_source_info);
296 if ( rm_id != invalid_lid)
297 {
298 rm_ = io_kcomm->acquire_input< remotesensing::input_class_remotesensing_t >( &rm_source_info);
299 }
300 else
301 {
302 rm_ = NULL;
303 }
304
305 return LDNDC_ERR_OK;
306}
remotesensing::input_class_remotesensing_t const * rm_
Optional remote sensing input (leaf area index)
Definition plamox.h:135
cbm::io_kcomm_t * io_kcomm
Input/output communicator.
Definition plamox.h:119

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.

387{
388 double tot_c( - timestep_c_assi
389 + sc_.accumulated_c_litter_stubble
390 + ph_.accumulated_c_export_harvest
391 + ph_.accumulated_c_export_grazing
392 + sc_.accumulated_c_litter_above
393 + sc_.accumulated_c_litter_below_sl.sum()
394 + sc_.accumulated_c_root_exsudates_sl.sum());
396 - m_pf.accumulated_n_uptake()
397 + sc_.accumulated_n_litter_stubble
398 + ph_.accumulated_n_export_harvest
399 + ph_.accumulated_n_export_grazing
400 + sc_.accumulated_n_litter_above
401 + sc_.accumulated_n_litter_below_sl.sum());
402
403 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
404 {
405 MoBiLE_Plant *p = *vt;
406 tot_c += p->total_biomass() * cbm::CCDM + p->rGro + p->rRes + p->rTra;
407
408 tot_n += p->total_nitrogen() - p->n2_fixation;
409 }
410 if ( _stage == ON_ENTRY)
411 {
412 tot_c_ = tot_c;
413 tot_n_ = tot_n;
414 }
415 else if ( _stage == ON_EXIT)
416 {
417 double difference( tot_c_ - tot_c);
418 if ( cbm::flt_greater( std::abs( difference), cbm::DIFFMAX))
419 {
420 KLOGWARN("C-Leak: difference is ", difference * cbm::M2_IN_HA, " kg C ha-1");
421 }
422
423 difference = tot_n_ - tot_n;
424 if ( cbm::flt_greater( std::abs( difference), cbm::DIFFMAX))
425 {
426 KLOGWARN("N-Leak: difference is ", difference * cbm::M2_IN_HA, " kg N ha-1");
427 }
428 }
429 else
430 {
431 KLOGFATAL( "[BUG] Unknown stage for Balance Check");
432 }
433}
PlaMoxIterator end()
End of the plants handled by PlaMox.
Definition plamox-setting.cpp:553
double automatic_nitrogen_uptake
Nitrogen supplied in the potential nitrogen mode in the time step [kgN m-2].
Definition plamox.h:341
substate_soilchemistry_t & sc_
Soil chemistry state (nitrogen, carbon, litter, oxygen)
Definition plamox.h:148
double tot_c_
Carbon balance at the beginning of the time step [kgC m-2].
Definition plamox.h:351
substate_physiology_t & ph_
Physiology state (canopy layers, nitrogen uptake, exports)
Definition plamox.h:146
double timestep_c_assi
Carbon assimilated (and added at planting) in the time step [kgC m-2].
Definition plamox.h:356
LD_PlantFunctions m_pf
All kind of plant related functions.
Definition plamox.h:205
std::vector< MoBiLE_Plant * >::iterator PlaMoxIterator
Iterator over all plants whose family is handled by PlaMox (model option plantfamilies),...
Definition plamox.h:917
PlaMoxIterator begin()
First plant handled by PlaMox.
Definition plamox-setting.cpp:548
double n_at_planting
Nitrogen added with the initial biomass at planting in the time step [kgN m-2].
Definition plamox.h:362
double tot_n_
Nitrogen balance at the beginning of the time step [kgN m-2].
Definition plamox.h:353

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).

1070{
1071 if ( plamox_root_system[_vt->slot] == NULL)
1072 {
1073 KLOGERROR( "[BUG] ", "root_system is NULL when not expected \"",_vt->name(),"\"!");
1074 return LDNDC_ERR_RUNTIME_ERROR;
1075 }
1076
1077 bool const mulching = _attributes.get( "/mulching", false);
1078
1079 double const export_root = _attributes.get( "/fraction-export-rootwood", 0.0);
1080 double const rootlitter_c( (1.0 - export_root) * _vt->mFrt * cbm::CCDM);
1081 double const rootlitter_n( (1.0 - export_root) * _vt->n_frt());
1082 double const root_c_export( export_root * _vt->mFrt * cbm::CCDM);
1083 double const root_n_export( export_root * _vt->mFrt * _vt->ncFrt);
1084
1085 double const straw_c( (_vt->mFol + _vt->dw_dfol + _vt->dw_lst+ _vt->dw_dst) * cbm::CCDM);
1086 double const straw_n( _vt->n_fol() + _vt->n_dfol + _vt->n_lst + _vt->n_dst);
1087
1088 /* TUBER grasses and TUBER cover crops keep their storage (mBud) below ground: it is
1089 * neither exported as fruit nor put on the surface, but becomes root litter */
1090 bool const bud_below( (*_vt)->TUBER() &&
1091 (_vt->is_covercrop || (_vt->groupId() == SPECIES_GROUP_GRASS)));
1092 double const budlitter_c( bud_below ? _vt->mBud * cbm::CCDM : 0.0);
1093 double const budlitter_n( bud_below ? _vt->n_bud() : 0.0);
1094
1095 double const fru_c( bud_below ? 0.0 : _vt->mBud * cbm::CCDM);
1096 double const fru_n( bud_below ? 0.0 : _vt->n_bud());
1097
1098 double fru_c_export( 0.0);
1099 double fru_n_export( 0.0);
1100
1101 double straw_c_export( 0.0);
1102 double straw_n_export( 0.0);
1103
1104 double mulching_c( 0.0);
1105 double mulching_n( 0.0);
1106
1107 double stubble_c( 0.0);
1108 double stubble_n( 0.0);
1109
1110 double gdd_sum( _vt->growing_degree_days );
1111 double dvs_flush( _vt->dvsFlush );
1112
1113 double const height( _attributes.get( "/height", invalid_flt));
1114 double remains_relative( _attributes.get( "/remains_relative", invalid_flt));
1115 double remains_absolute( _attributes.get( "/remains_absolute", invalid_flt));
1116 if( cbm::is_valid( remains_absolute))
1117 {
1118 remains_absolute *= cbm::HA_IN_M2;
1119 }
1120
1121 if ( !cbm::flt_greater_equal_zero( remains_relative)
1122 && !cbm::flt_greater_equal_zero( remains_absolute)
1123 && !cbm::flt_greater_equal_zero( height))
1124 {
1125 if ( _vt->is_covercrop)
1126 {
1127 remains_relative = 1.0;
1128 }
1129 else
1130 {
1131 KLOGWARN( "harvest event attribute \"remains_relative\" and \"remains_absolute\" and \"height\" not set;",
1132 " \"remains_relative\" set to zero and used [species=", _vt->name(),"]");
1133 remains_relative = 0.0;
1134 }
1135 }
1136 else if ( (cbm::flt_greater_equal_zero( remains_relative) ||
1137 cbm::flt_greater_equal_zero( remains_absolute))
1138 && cbm::flt_greater_equal_zero( height))
1139 {
1140 KLOGWARN( "harvest event attribute \"remains_(relative/absolute)\" and \"height\" both set;"
1141 " attribute \"remains_relative\" used [species=", _vt->name(),"]");
1142 }
1143
1144 if ( cbm::flt_greater_equal_zero( remains_relative))
1145 {
1146 /* no op */
1147 }
1148 else if ( cbm::flt_greater_equal_zero( remains_absolute))
1149 {
1150 double const straw_dw( _vt->mFol + _vt->dw_dfol + _vt->dw_lst+ _vt->dw_dst);
1151 /* no straw: nothing to remove */
1152 remains_relative = cbm::flt_greater_zero( straw_dw) ?
1153 cbm::bound( 0.0, remains_absolute / straw_dw, 1.0) : 1.0;
1154 }
1155 else if ( cbm::flt_equal_zero( height))
1156 {
1157 remains_relative = 0.0;
1158 }
1159 else if ( cbm::flt_greater_zero( height))
1160 {
1161 double h_cum( 0.0);
1162 double remains_relative_fol = 0.0;
1163 for ( int fl = 0; fl < m_setup->canopylayers(); ++fl)
1164 {
1165 remains_relative_fol += _vt->fFol_fl[fl];
1166 h_cum += ph_.h_fl[fl];
1167 if ( cbm::flt_greater_equal( h_cum, height))
1168 {
1169 break;
1170 }
1171 }
1172
1173 h_cum = 0.0;
1174 double remains_relative_lst = 0.0;
1175 double remains_relative_lst_total = 0.0;
1176 for ( int fl = 0; fl < m_setup->canopylayers(); ++fl)
1177 {
1178 //lst decreases with height
1179 remains_relative_lst_total += pow( cbm::bound_min( 0.0, _vt->height_max - h_cum), 0.3);
1180 if ( cbm::flt_less_equal( h_cum, height))
1181 {
1182 remains_relative_lst += pow( cbm::bound_min( 0.0, _vt->height_max - h_cum), 0.3);
1183 }
1184 h_cum += ph_.h_fl[fl];
1185 }
1186 /* a plant without height lies completely below the cutting height */
1187 remains_relative_lst = cbm::flt_greater_zero( remains_relative_lst_total) ?
1188 remains_relative_lst / remains_relative_lst_total : 1.0;
1189
1190 double const straw_dw( _vt->mFol + _vt->dw_dfol + _vt->dw_lst+ _vt->dw_dst);
1191 remains_relative = cbm::flt_greater_zero( straw_dw) ?
1192 (remains_relative_fol * (_vt->mFol + _vt->dw_dfol) +
1193 remains_relative_lst * (_vt->dw_lst+ _vt->dw_dst)) / straw_dw : 1.0;
1194 }
1195 else
1196 {
1197 KLOGERROR( "[BUG] ", "harvest event attribute \"remains_relative\" and \"height\" are invalid [species=", _vt->name(),"]");
1198 return LDNDC_ERR_FAIL;
1199 }
1200
1201 /* remains_relative > 1 would give a negative export */
1202 remains_relative = cbm::bound( 0.0, remains_relative, 1.0);
1203
1204 stubble_c += remains_relative * straw_c;
1205 stubble_n += remains_relative * straw_n;
1206 if ( mulching)
1207 {
1208 mulching_c += (1.0-remains_relative) * straw_c;
1209 mulching_n += (1.0-remains_relative) * straw_n;
1210 }
1211 else
1212 {
1213 straw_c_export += (1.0-remains_relative) * straw_c;
1214 straw_n_export += (1.0-remains_relative) * straw_n;
1215 }
1216
1217 if ( _vt->is_covercrop)
1218 {
1219 stubble_c += remains_relative * fru_c;
1220 stubble_n += remains_relative * fru_n;
1221 if ( mulching)
1222 {
1223 mulching_c += (1.0-remains_relative) * fru_c;
1224 mulching_n += (1.0-remains_relative) * fru_n;
1225 }
1226 else
1227 {
1228 stubble_c += (1.0-remains_relative) * fru_c;
1229 stubble_n += (1.0-remains_relative) * fru_n;
1230 }
1231 }
1232 else
1233 {
1234 fru_c_export = fru_c;
1235 fru_n_export = fru_n;
1236 }
1237
1238 //export
1239 c_total_exported += straw_c_export + fru_c_export + root_c_export;
1240 c_fruit_exported += fru_c_export;
1241 n_total_exported += straw_n_export + fru_n_export + root_n_export;
1242 n_fruit_exported += fru_n_export;
1243
1244 ph_.accumulated_c_export_harvest += straw_c_export + fru_c_export + root_c_export;
1245 ph_.accumulated_n_export_harvest += straw_n_export + fru_n_export + root_n_export;
1246
1247 ph_.accumulated_c_fru_export_harvest += fru_c_export;
1248 ph_.accumulated_n_fru_export_harvest += fru_n_export;
1249
1250 //stubble litter
1251 sc_.c_stubble_lit3 += stubble_c * (*_vt)->LIGNIN();
1252 sc_.c_stubble_lit2 += stubble_c * (*_vt)->CELLULOSE();
1253 sc_.c_stubble_lit1 += stubble_c * (1.0 - (*_vt)->LIGNIN() - (*_vt)->CELLULOSE());
1254 sc_.accumulated_c_litter_stubble += stubble_c;
1255
1256 sc_.n_stubble_lit3 += stubble_n * (*_vt)->LIGNIN();
1257 sc_.n_stubble_lit2 += stubble_n * (*_vt)->CELLULOSE();
1258 sc_.n_stubble_lit1 += stubble_n * (1.0 - (*_vt)->LIGNIN() - (*_vt)->CELLULOSE());
1259 sc_.accumulated_n_litter_stubble += stubble_n;
1260
1261 //raw litter
1262 sc_.c_raw_lit_1_above += mulching_c * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN());
1263 sc_.c_raw_lit_2_above += mulching_c * (*_vt)->CELLULOSE();
1264 sc_.c_raw_lit_3_above += mulching_c * (*_vt)->LIGNIN();
1265 sc_.accumulated_c_litter_above += mulching_c;
1266
1267 sc_.n_raw_lit_1_above += mulching_n * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN());
1268 sc_.n_raw_lit_2_above += mulching_n * (*_vt)->CELLULOSE();
1269 sc_.n_raw_lit_3_above += mulching_n * (*_vt)->LIGNIN();
1270 sc_.accumulated_n_litter_above += mulching_n;
1271
1272 //root litter
1273 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
1274 {
1275 double const dw_rootlitter( rootlitter_c / cbm::CCDM * _vt->fFrt_sl[sl]);
1276 double const n_rootlitter( dw_rootlitter * _vt->ncFrt);
1277
1278 sc_.c_raw_lit_1_sl[sl] += dw_rootlitter * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN()) * cbm::CCDM;
1279 sc_.c_raw_lit_2_sl[sl] += dw_rootlitter * (*_vt)->CELLULOSE() * cbm::CCDM;
1280 sc_.c_raw_lit_3_sl[sl] += dw_rootlitter * (*_vt)->LIGNIN() * cbm::CCDM;
1281 sc_.accumulated_c_litter_below_sl[sl] += dw_rootlitter * cbm::CCDM;
1282
1283 sc_.n_raw_lit_1_sl[sl] += n_rootlitter * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN());
1284 sc_.n_raw_lit_2_sl[sl] += n_rootlitter * (*_vt)->CELLULOSE();
1285 sc_.n_raw_lit_3_sl[sl] += n_rootlitter * (*_vt)->LIGNIN();
1286 sc_.accumulated_n_litter_below_sl[sl] += n_rootlitter;
1287 }
1288
1289 /* belowground storage of TUBER grasses and cover crops, distributed like the fine roots */
1290 if ( cbm::flt_greater_zero( budlitter_c))
1291 {
1292 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
1293 {
1294 double const c_lit( budlitter_c * _vt->fFrt_sl[sl]);
1295 double const n_lit( budlitter_n * _vt->fFrt_sl[sl]);
1296
1297 sc_.c_raw_lit_1_sl[sl] += c_lit * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN());
1298 sc_.c_raw_lit_2_sl[sl] += c_lit * (*_vt)->CELLULOSE();
1299 sc_.c_raw_lit_3_sl[sl] += c_lit * (*_vt)->LIGNIN();
1300 sc_.accumulated_c_litter_below_sl[sl] += c_lit;
1301
1302 sc_.n_raw_lit_1_sl[sl] += n_lit * (1.0 - (*_vt)->CELLULOSE() - (*_vt)->LIGNIN());
1303 sc_.n_raw_lit_2_sl[sl] += n_lit * (*_vt)->CELLULOSE();
1304 sc_.n_raw_lit_3_sl[sl] += n_lit * (*_vt)->LIGNIN();
1305 sc_.accumulated_n_litter_below_sl[sl] += n_lit;
1306 }
1307 }
1308
1309 cbm::state_scratch_t * mcom = io_kcomm->get_scratch();
1310 std::string mcom_key;
1311
1312 char const * species_name = _attributes.get( "/name", "?");
1313
1314 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:daysOnField", species_name);
1315 mcom->set( mcom_key.c_str(), (double)((lclock()->seconds() - seconds_crop_planting[_vt->slot]) / cbm::SEC_IN_DAY));
1316
1317 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:gddsum", species_name);
1318 mcom->set( mcom_key.c_str(), gdd_sum);
1319
1320 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:dvsflush", species_name);
1321 mcom->set( mcom_key.c_str(), dvs_flush);
1322
1323 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_fru", species_name);
1324 mcom->set( mcom_key.c_str(), fru_c);
1325
1326 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_fru_export", species_name);
1327 mcom->set( mcom_key.c_str(), fru_c_export);
1328
1329 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_fru", species_name);
1330 mcom->set( mcom_key.c_str(), fru_n);
1331
1332 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_fru_export", species_name);
1333 mcom->set( mcom_key.c_str(), fru_n_export);
1334
1335 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_straw", species_name);
1336 mcom->set( mcom_key.c_str(), straw_c);
1337
1338 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_straw_export", species_name);
1339 mcom->set( mcom_key.c_str(), straw_c_export);
1340
1341 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_straw", species_name);
1342 mcom->set( mcom_key.c_str(), straw_n);
1343
1344 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_straw_export", species_name);
1345 mcom->set( mcom_key.c_str(), straw_n_export);
1346
1347 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_stubble", species_name);
1348 mcom->set( mcom_key.c_str(), stubble_c);
1349
1350 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_stubble", species_name);
1351 mcom->set( mcom_key.c_str(), stubble_n);
1352
1353 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:c_frt", species_name);
1354 mcom->set( mcom_key.c_str(), rootlitter_c);
1355
1356 cbm::state_scratch_t::make_item_key( &mcom_key, "harvest:%s:n_frt", species_name);
1357 mcom->set( mcom_key.c_str(), rootlitter_n);
1358
1359 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
1360 {
1361 _vt->fFrt_sl[sl] = 0.0;
1362 _vt->rootlength_sl[sl] = 0.0;
1363 _vt->hypoxia_sl[sl] = 0.0;
1364 }
1365
1366 cbm::invalidate( root_q_vt_[_vt->slot]);
1367 _vt->rooting_depth = 0.0;
1368
1369 days_after_emergence[_vt->slot] = -1;
1370
1371 dw_retranslocation_stem[_vt->slot] = 0.0;
1372 dw_retranslocation_foliage[_vt->slot] = 0.0;
1373
1374 dw_fol_old[_vt->slot] = 0.0;
1375 lai_dynamic[_vt->slot] = 0.0;
1376 lai_juvenile[_vt->slot] = 0.0;
1377 dw_shoot_growth_season[_vt->slot] = 0.0;
1378 dw_shoot_growth_last[_vt->slot] = 0.0;
1379 f_h2o_fruit_set_sum[_vt->slot] = 0.0;
1380 f_h2o_fruit_set_cnt[_vt->slot] = 0.0;
1381 gdd_juvenile[_vt->slot] = 0.0;
1382
1383 _vt->mFol = 0.0;
1384 _vt->dw_dfol = 0.0;
1385 _vt->ncFol = 0.0;
1386 _vt->n_dfol = 0.0;
1387
1388 _vt->dw_lst = 0.0;
1389 _vt->n_lst = 0.0;
1390
1391 _vt->dw_dst = 0.0;
1392 _vt->n_dst = 0.0;
1393
1394 _vt->mBud = 0.0;
1395 _vt->mBudStart = 0.0;
1396 _vt->ncBud = 0.0;
1397
1398 _vt->mFrt = 0.0;
1399 _vt->ncFrt = 0.0;
1400
1401 _vt->dEmerg = -1;
1402 _vt->growing_degree_days = 0.0;
1403 _vt->dvsMort = 0.0;
1404 _vt->dvsFlush = 0.0;
1405 _vt->dvsFlushOld = 0.0;
1406
1407 n_plant[_vt->slot] = 0.0;
1408 _vt->a_fix_n = 0.0;
1409
1410 _vt->height_max = 0.0;
1411 _vt->height_at_canopy_start = 0.0;
1412
1413 _vt->f_area = 0.0;
1414 for ( int fl = 0; fl < m_setup->canopylayers(); ++fl)
1415 {
1416 _vt->fFol_fl[fl] = 0.0;
1417 _vt->lai_fl[fl] = 0.0;
1418 }
1419
1420 _vt->f_fac = 0.0;
1421 chill_units[_vt->slot] = 0.0;
1422 _vt->chill_factor = 1.0;
1423
1424 yearly_cuts[_vt->slot] = 0;
1425
1426 allocation_factor_leafs[_vt->slot] = 0.0;
1427 allocation_factor_stems[_vt->slot] = 0.0;
1428 allocation_factor_fruit[_vt->slot] = 0.0;
1429 allocation_factor_roots[_vt->slot] = 0.0;
1430
1431 m_fruit_maximum[_vt->slot] = -1.0;
1432 spikelets_sterility[_vt->slot] = 0.0;
1433 hypoxia[_vt->slot] = 0.0;
1434
1435 LD_Allocator->destroy( plamox_root_system[_vt->slot]);
1436 plamox_root_system[_vt->slot] = NULL;
1437
1438 return LDNDC_ERR_OK;
1439}
lvector_t< double > dw_fol_old
Foliage mass at the beginning of the time step [kgDW m-2].
Definition plamox.h:302
lvector_t< double > lai_juvenile
Potential leaf area index of the temperature driven leaf expansion in the juvenile phase [m2 m-2] (se...
Definition plamox.h:307
lvector_t< double > allocation_factor_stems
Allocation factor of daily assimilated carbon to stem growth [-].
Definition plamox.h:412
lvector_t< double > f_h2o_fruit_set_sum
Coffee: sum of the drought index between flowering and onset of fruit filling [-].
Definition plamox.h:316
lvector_t< long long int > seconds_crop_planting
Time of planting [s].
Definition plamox.h:284
lvector_t< double > dw_retranslocation_foliage
Foliage mass available for retranslocation to the fruit [kgDW m-2].
Definition plamox.h:300
lvector_t< double > allocation_factor_fruit
Allocation factor of daily assimilated carbon to fruit growth [-].
Definition plamox.h:418
input_class_soillayers_t const & sl_
Soil layers input.
Definition plamox.h:127
lvector_t< double > lai_dynamic
Leaf area index used with remote sensing input [m2 m-2].
Definition plamox.h:304
lvector_t< double > f_h2o_fruit_set_cnt
Coffee: number of time steps of f_h2o_fruit_set_sum [-].
Definition plamox.h:318
double c_total_exported
Carbon exported with harvest in the time step, including roots [kgC m-2].
Definition plamox.h:518
lvector_t< double > dw_shoot_growth_last
Coffee: shoot growth of the previous season, which carries the fruit nodes [kgDW m-2].
Definition plamox.h:314
lvector_t< double > dw_retranslocation_stem
Stem mass available for retranslocation to the fruit [kgDW m-2].
Definition plamox.h:298
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:459
lvector_t< double > dw_shoot_growth_season
Coffee: shoot (leaf and stem) growth since the last phenology reset [kgDW m-2] (see Coffee)
Definition plamox.h:312
lvector_t< double > allocation_factor_roots
Allocation factor of daily assimilated carbon to root growth [-].
Definition plamox.h:424
double c_fruit_exported
Carbon exported with the fruit in the time step [kgC m-2].
Definition plamox.h:520
lvector_t< double > spikelets_sterility
Spikelet sterility caused by oxygen deficiency [-].
Definition plamox.h:465
lvector_t< double > n_plant
Total plant nitrogen including dead foliage and stems [kgN m-2].
Definition plamox.h:400
double n_total_exported
Nitrogen exported with harvest in the time step, including roots [kgN m-2].
Definition plamox.h:522
lvector_t< double > allocation_factor_leafs
Allocation factor of daily assimilated carbon to leaf growth [-].
Definition plamox.h:406
double n_fruit_exported
Nitrogen exported with the fruit in the time step [kgN m-2].
Definition plamox.h:524
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:479
lvector_t< double > hypoxia
Hypoxia index of the root system [-] (0: no stress, 1: no oxygen)
Definition plamox.h:290
input_class_setup_t const * m_setup
Setup input (e.g., canopy layers, latitude)
Definition plamox.h:125
lvector_t< double > chill_units
Accumulated chilling units for vernalization;.
Definition plamox.h:452
lvector_t< int > days_after_emergence
Days after emergence [d] (-1 before emergence)
Definition plamox.h:293
lvector_t< int > yearly_cuts
Number of cutting events in the current year.
Definition plamox.h:377
lvector_t< double > gdd_juvenile
Growing degree days at the last update of lai_juvenile [oC].
Definition plamox.h:309

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, dw_shoot_growth_last, dw_shoot_growth_season, f_h2o_fruit_set_cnt, f_h2o_fruit_set_sum, gdd_juvenile, hypoxia, io_kcomm, lai_dynamic, lai_juvenile, 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).

659{
660 species_t const * sp = NULL;
661 if ( m_species)
662 {
663 sp = m_species->get_species( _vt->cname());
664 }
665
666 /* heat history of a previous crop in this slot must not cap this one; the heat state of
667 * the other plants of a mixed stand is not touched */
668 PlaMox_heat_stress_reset( _vt->slot);
669 _vt->f_heat_gf = 1.0;
670
671 seconds_crop_planting[_vt->slot] = lclock()->seconds();
672 fractional_cover[_vt->slot] = _attributes.get( "/fractional-cover", 1.0);
673
674 //Scale growing degree days
675 //Currently only used by FarmSystem to dynamically adjust species
676 //over larger regions and/or time periods
677 double gdd_maturity_target( _attributes.get( "/gdd-maturity-target", -1.0));
678 if ( cbm::flt_less( gdd_maturity_target, 0.0) &&
679 (std::strstr( _vt->cname(), "GDD-MATURITY-TARGET") != NULL) &&
680 gdd_target.find( _vt->cname()) != gdd_target.end())
681 {
682 gdd_maturity_target = gdd_target[_vt->cname()];
683 }
684
685 if ( cbm::flt_greater_zero( gdd_maturity_target) &&
686 cbm::flt_greater_zero( (*_vt)->GDD_MATURITY()))
687 {
688 double const scale_gdd( gdd_maturity_target / (*_vt)->GDD_MATURITY());
689 MoBiLE_PlantParameters p_parameters = (*m_speciesparameters)[_vt->ctype()];
690 p_parameters.GDD_EMERGENCE_UPDATE( (*_vt)->GDD_EMERGENCE() * scale_gdd);
691 p_parameters.GDD_STEM_ELONGATION_UPDATE( (*_vt)->GDD_STEM_ELONGATION() * scale_gdd);
692 p_parameters.GDD_FLOWERING_UPDATE( (*_vt)->GDD_FLOWERING() * scale_gdd);
693 p_parameters.GDD_GRAIN_FILLING_UPDATE( (*_vt)->GDD_GRAIN_FILLING() * scale_gdd);
694 p_parameters.GDD_ROOTS_GROWN_UPDATE( (*_vt)->GDD_ROOTS_GROWN() * scale_gdd);
695 p_parameters.GDD_MATURITY_UPDATE( gdd_maturity_target);
696 _vt->switchparameters( p_parameters);
697 }
698
699 _vt->is_covercrop = _attributes.get( "/cover-crop", false);
700 //_vt->f_fac = (*_vt)->FFACMAX();
701
702 //amount of seeds
703 /* mixed stands: the minimum seed mass refers to a full stand */
704 double const initial_biomass( cbm::bound_min( have_mix_cover ? 10.0 * fractional_cover[_vt->slot] : 10.0,
705 cbm::flt_greater_zero( _attributes.get( "/initial-biomass", 0.0)) ?
706 _attributes.get( "/initial-biomass", 0.0) :
707 (*_vt)->SEED_RATE()) * cbm::HA_IN_M2);
708
709 location[_vt->slot] = _attributes.get( "/location", "?");
710
711 dw_retranslocation_stem[_vt->slot] = 0.0;
712 dw_retranslocation_foliage[_vt->slot] = 0.0;
713
714 dw_fol_old[_vt->slot] = 0.0;
715 lai_dynamic[_vt->slot] = 0.0;
716 lai_juvenile[_vt->slot] = 0.0;
717 dw_shoot_growth_season[_vt->slot] = 0.0;
718 dw_shoot_growth_last[_vt->slot] = 0.0;
719 f_h2o_fruit_set_sum[_vt->slot] = 0.0;
720 f_h2o_fruit_set_cnt[_vt->slot] = 0.0;
721 gdd_juvenile[_vt->slot] = 0.0;
722
723 //plant gets biomass by species initializer
724 //store and substract later according amounts of C and N
725 //for balance check at day of planting
726 double const plant_n_old( _vt->total_nitrogen());
727 double const plant_c_old( _vt->total_biomass() * cbm::CCDM);
728
729 _vt->height_max = 0.0;
730 _vt->height_at_canopy_start = 0.0;
731
732 chill_units[_vt->slot] = 0.0;
733 _vt->chill_factor = 1.0;
734
735 _vt->f_heat_daily = 1.0;
736
737 if ( cbm::flt_greater_zero( (*_vt)->M_FRUIT_OPT()))
738 {
739 /* M_FRUIT_OPT [kgDW m-2] refers to a full stand */
740 m_fruit_maximum[_vt->slot] = (*_vt)->M_FRUIT_OPT() * (have_mix_cover ? fractional_cover[_vt->slot] : 1.0);
741 }
742 else
743 {
744 m_fruit_maximum[_vt->slot] = -1.0;
745 }
746 spikelets_sterility[_vt->slot] = 0.0;
747
748 dw_shoot_growth_season[_vt->slot] = 0.0;
749 dw_shoot_growth_last[_vt->slot] = 0.0;
750 f_h2o_fruit_set_sum[_vt->slot] = 0.0;
751 f_h2o_fruit_set_cnt[_vt->slot] = 0.0;
752
753 if ( m_veg->is_family( _vt, ":rice:"))
754 {
755 nc_fol_opt[_vt->slot] = 0.5 * ((*_vt)->NC_FOLIAGE_MAX() + (*_vt)->NC_FOLIAGE_MIN());
756 }
757 else if ( m_veg->is_family( _vt, ":wheat:"))
758 {
759 nc_fol_opt[_vt->slot] = 0.5 * ((*_vt)->NC_FOLIAGE_MAX() + (*_vt)->NC_FOLIAGE_MIN());
760 }
761 else
762 {
763 nc_fol_opt[_vt->slot] = (*_vt)->NC_FOLIAGE_MAX();
764 }
765
766 gdd_grain_filling[_vt->slot] = (*_vt)->GDD_GRAIN();
767
768 hypoxia[_vt->slot] = 0.0;
769 transplanting_shock_vt[_vt->slot] = 0.0;
770
772
773 if ( cbm::is_equal( _vt->group().c_str(), "crop"))
774 {
775 lerr_t rc_plant = m_pf.initialize_crop( _vt, sp ? sp->crop() : NULL);
776 if ( rc_plant)
777 {
778 KLOGERROR( "crop initialization failed [species=", _vt->name(),"]");
779 return LDNDC_ERR_FAIL;
780 }
781
782 /* 16: allocation fractions must form a partition, and development needs a maturity */
783 double const ff( (*_vt)->FRACTION_FRUIT());
784 double const fr( (*_vt)->FRACTION_ROOT());
785 double const ffol( cbm::bound_min( 0.0, (*_vt)->FRACTION_FOLIAGE()));
786 if ( cbm::flt_greater( ff + fr + ffol, 1.0) || !cbm::flt_less( ff, 1.0) ||
787 cbm::flt_greater( fr / (1.0 - ff), 1.0))
788 {
789 KLOGERROR( "inconsistent allocation fractions FRACTION_FRUIT=", ff, " FRACTION_ROOT=", fr,
790 " FRACTION_FOLIAGE=", ffol, " (need sum <= 1 and FRACTION_ROOT <= 1-FRACTION_FRUIT) [species=", _vt->name(),"]");
791 return LDNDC_ERR_FAIL;
792 }
793 if ( !cbm::flt_greater_zero( (*_vt)->GDD_MATURITY()))
794 {
795 KLOGERROR( "GDD_MATURITY must be > 0 for crops [species=", _vt->name(),"]");
796 return LDNDC_ERR_FAIL;
797 }
798
799 /* only considered for rice so far */
800 int const seedbedduration( _attributes.get( "/seedbed-duration", 0));
801 if ( seedbedduration > 0)
802 {
803 double const mean_gdd( cbm::bound_max(mc_.nd_airtemperature - (*_vt)->GDD_BASE_TEMPERATURE(), (*_vt)->GDD_MAX_TEMPERATURE()));
804 _vt->growing_degree_days = seedbedduration * mean_gdd;
805 _vt->dvsFlush = _vt->growing_degree_days / (*_vt)->GDD_MATURITY();
806 transplanting_shock_vt[_vt->slot] = 1.0;
807 days_after_emergence[_vt->slot] = 0;
808 }
809 else
810 {
811 _vt->growing_degree_days = 0.0;
812 _vt->dvsFlush = 0.0;
813 }
814
815 allocation_factor_roots[_vt->slot] = (*_vt)->FRACTION_ROOT();
816 allocation_factor_leafs[_vt->slot] = 1.0 - (*_vt)->FRACTION_ROOT();
817 allocation_factor_stems[_vt->slot] = 0.0;
818 allocation_factor_fruit[_vt->slot] = 0.0;
819
820 _vt->ncFrt = (*_vt)->NC_FINEROOTS_MAX();
821 _vt->ncFol = (*_vt)->NC_FOLIAGE_MAX();
822 _vt->n_lst = 0.0;
823 _vt->ncBud = 0.0;
824 _vt->ncSap = 0.0;
825 _vt->ncCor = 0.0;
826
827 if ( cbm::flt_greater_zero( (*_vt)->GDD_AUTOTROPHY()))
828 {
829 _vt->mFol = 0.01 * initial_biomass;
830 _vt->mFrt = initial_biomass - _vt->mFol;
831 _vt->dw_lst = 0.0;
832 _vt->mBud = 0.0;
833 _vt->mSap = 0.0;
834 _vt->mCor = 0.0;
835
836 //assuming a constant value of 50% of seeds being respired and 50% being allocated to leaves
837 double const leaves_from_seed( 0.5 * 0.5);;
838 lai_min[_vt->slot] = 0.001;
839 lai_min_at_tillering[_vt->slot] = cbm::bound_min( lai_min[_vt->slot],
840 leaves_from_seed * initial_biomass * (*_vt)->SLAMAX());
841 }
842 else
843 {
844 double const fraction_root_start( cbm::flt_greater_zero( (*_vt)->FRACTION_ROOT_START()) ?
845 (*_vt)->FRACTION_ROOT_START() :
846 (*_vt)->FRACTION_ROOT());
847 double const initial_foliage_biomass_max( 0.02);
848 _vt->mFol = cbm::bound_max( (1.0 - fraction_root_start) * initial_biomass,
849 initial_foliage_biomass_max);
850
851 _vt->mFrt = cbm::bound_min( 0.0, initial_biomass - _vt->mFol);
852 _vt->dw_lst = 0.0;
853 _vt->mBud = 0.0;
854 _vt->mSap = 0.0;
855 _vt->mCor = 0.0;
856
857 lai_min[_vt->slot] = 0.01;
858 lai_min_at_tillering[_vt->slot] = 0.01;
859 }
860
861 n_plant[_vt->slot] = _vt->total_nitrogen();
863
864 n_at_planting += (n_plant[_vt->slot] - plant_n_old);
865 timestep_c_assi += (initial_biomass * cbm::CCDM - plant_c_old);
866 }
867 else if ( cbm::is_equal( _vt->cgroup(), "grass"))
868 {
869 lerr_t rc_plant = m_pf.initialize_grass( _vt, sp ? sp->grass() : NULL);
870 if ( rc_plant)
871 {
872 KLOGERROR( "grass initialization failed [species=", _vt->name(),"]");
873 return LDNDC_ERR_FAIL;
874 }
875
876 if ( lclock()->seconds() > cbm::SEC_IN_DAY)
877 {
879 }
880
881 /* set to fixed value */
882 lai_min[_vt->slot] = 0.1;
883 lai_min_at_tillering[_vt->slot] = 0.1;
884
885 allocation_factor_roots[_vt->slot] = (*_vt)->FRACTION_ROOT();
886 allocation_factor_fruit[_vt->slot] = (*_vt)->FRACTION_FRUIT();
887 allocation_factor_leafs[_vt->slot] = (*_vt)->FRACTION_FOLIAGE();
888 allocation_factor_stems[_vt->slot] = (1.0 - allocation_factor_leafs[_vt->slot] - allocation_factor_roots[_vt->slot] - allocation_factor_fruit[_vt->slot]);
889
890 _vt->mFrt = allocation_factor_roots[_vt->slot] * initial_biomass;
891 _vt->mFol = allocation_factor_leafs[_vt->slot] * initial_biomass;
892 _vt->dw_lst = allocation_factor_stems[_vt->slot] * initial_biomass;
893 _vt->mBud = allocation_factor_fruit[_vt->slot] * initial_biomass;
894
895 _vt->ncFrt = (*_vt)->NC_FINEROOTS_MAX();
896 _vt->ncFol = (*_vt)->NC_FOLIAGE_MAX();
897 _vt->n_lst = (*_vt)->NC_STRUCTURAL_TISSUE_MAX() * _vt->dw_lst;
898 _vt->ncBud = (*_vt)->NC_FRUIT_MAX();
899
900 n_plant[_vt->slot] = _vt->total_nitrogen();
901
903
904 n_at_planting += (n_plant[_vt->slot] - plant_n_old);
905 timestep_c_assi += (initial_biomass * cbm::CCDM - plant_c_old);
906 }
907 else
908 {
909 KLOGERROR( "I do not handle this group of species ",
910 "[species=\"",_vt->name(),"\",group=",_vt->group(),"]");
911 return LDNDC_ERR_RUNTIME_ERROR;
912 }
913
914 // currently no concept for free available carbon
915 _vt->f_fac = 0.0;
916
917 // initialize root system
918 if (plamox_root_system.size() <= _vt->slot)
919 {
920 plamox_root_system.resize(_vt->slot+1);
921 }
922
923 if ( plamox_root_system[_vt->slot])
924 {
925 /* root system left over from a plant that was removed without PlaMox
926 * harvest (should not happen; safeguard against leaking it) */
927 KLOGWARN( "Replacing existing root system [species=", _vt->name(),"]");
928 LD_Allocator->destroy( plamox_root_system[_vt->slot]);
929 plamox_root_system[_vt->slot] = NULL;
930 }
931 plamox_root_system[_vt->slot] = LD_Allocator->construct_args< RootSystemDNDC >( 1, m_state, io_kcomm);
932 if ( !plamox_root_system[_vt->slot])
933 {
934 KLOGERROR( "Failed to allocate root-system object");
935 return LDNDC_ERR_NOMEM;
936 }
937
938 double const seed_depth = _attributes.get( "/seed-depth", 0.05);
939 root_q_vt_[_vt->slot] = sl_.soil_layer_cnt();
940 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
941 {
942 if (cbm::flt_greater( sc_.depth_sl[sl], seed_depth))
943 {
944 root_q_vt_[_vt->slot] = sl+1;
945 break;
946 }
947 }
948
949 PlaMox_update_root_structure( _vt, _vt->mFrt);
950
951 return LDNDC_ERR_OK;
952}
input_class_species_t const * m_species
Species input.
Definition plamox.h:129
MoBiLE_State * m_state
Model state.
Definition plamox.h:117
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:325
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...
void PlaMox_heat_stress_reset(size_t)
Resets the heat-stress state of one plant (slot), at planting.
Definition plamox.cpp:4491
lvector_t< double > transplanting_shock_vt
Transplanting shock [-] (1 at transplanting, decreasing by 0.1 per day)
Definition plamox.h:371
lvector_t< double > nc_fol_opt
Reference foliage nitrogen concentration of the nitrogen deficiency factor [kgN kgDW-1].
Definition plamox.h:472
void PlaMox_update_nitrogen_concentrations(MoBiLE_Plant *)
Distributes the plant nitrogen among the living compartments (see Nitrogen distribution)
Definition plamox.cpp:4315
lerr_t PlaMox_reset_phenology(MoBiLE_Plant *)
Resets the phenological state of a plant.
Definition plamox.cpp:480
lvector_t< double > fractional_cover
Density of seeded plants with regard to optimum (full area) seeding (-).
Definition plamox.h:440
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:432
lvector_t< std::string > location
Location of the plant for location-specific nitrogen supply.
Definition plamox.h:296
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:287
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:434
substate_microclimate_t & mc_
Microclimate state (temperature, radiation, vapour pressure deficit)
Definition plamox.h:144
MoBiLE_PlantVegetation * m_veg
Vegetation (all plants)
Definition plamox.h:138

References allocation_factor_fruit, allocation_factor_leafs, allocation_factor_roots, allocation_factor_stems, chill_units, days_after_emergence, dw_fol_old, dw_retranslocation_foliage, dw_retranslocation_stem, dw_shoot_growth_last, dw_shoot_growth_season, f_h2o_fruit_set_cnt, f_h2o_fruit_set_sum, fractional_cover, gdd_grain_filling, gdd_juvenile, gdd_target, have_mix_cover, hypoxia, io_kcomm, lai_dynamic, lai_juvenile, 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_heat_stress_reset(), 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))
4439{
4440 return cbm::bound_min( 0.0, 1.0 - hypoxia[_vt->slot] * (*_vt)->HYPOXIA());
4441}

References hypoxia.

Referenced by PlaMox_get_age_factor().

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).

965{
966 EventAttributes const * ev_harv = NULL;
967 while (( ev_harv = this->m_HarvestEvents.pop()) != NULL)
968 {
969 char const * p_name = ev_harv->get( "/name", "?");
970 MoBiLE_Plant * vt = m_veg->get_plant( p_name);
971 if ( !vt)
972 {
973 /* skip only this event; returning here would drop all remaining
974 * harvest events of the time step */
975 KLOGWARN( "Harvest event for unknown plant ignored [species=", p_name,"]");
976 continue;
977 }
978
979 for ( size_t i = 0; i < this->plantfamily_tags.size(); ++i)
980 {
981 char const * family = this->plantfamily_tags[i].c_str();
982 if ( this->m_veg->is_family( vt->ctype(), family)
983 || cbm::is_equal( vt->cname(), family))
984 {
985 if ( cbm::flt_less( vt->growing_degree_days, 0.95 * (*vt)->GDD_MATURITY()) ||
986 cbm::flt_greater( vt->growing_degree_days, 1.1 * (*vt)->GDD_MATURITY()))
987 {
988 if ( gdd_target.find( vt->cname()) == gdd_target.end())
989 {
990 gdd_target.insert( { vt->cname(), 0.95 * vt->growing_degree_days});
991 }
992 else
993 {
994 gdd_target[vt->cname()] = 0.95 * vt->growing_degree_days;
995 }
996 }
997 lerr_t rc_harv = PlaMox_event_harvest( vt, *ev_harv);
998 if ( rc_harv)
999 {
1000 KLOGERROR( "Handling harvest event failed [species=", vt->name(),"]");
1001 return LDNDC_ERR_FAIL;
1002 }
1003 // TODO delete plant..
1004 }
1005 }
1006 }
1007 return LDNDC_ERR_OK;
1008}
lerr_t PlaMox_event_harvest(MoBiLE_Plant *, EventAttributes const &)
Harvests a plant (see Harvest)
Definition plamox.cpp:1067
SubscribedEvent< LD_EventHandlerQueue > m_HarvestEvents
Harvest events.
Definition plamox.h:154

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).

1469{
1470 lvector_t< double > agb_vt( m_veg->slot_cnt(), 0.0);
1471 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
1472 {
1473 MoBiLE_Plant *p = (*vt);
1474 agb_vt[p->slot] = p->aboveground_biomass();
1475 }
1476
1477 lerr_t rc_ff = m_eventgraze.update_available_freshfood_c( m_veg, species_groups_select_t< species::grass >());
1478 if ( rc_ff) { return rc_ff; }
1479
1480 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
1481 {
1482 MoBiLE_Plant *p = (*vt);
1483 if ( p->group() == "grass")
1484 {
1485 lerr_t rc_graze = m_eventgraze.event_graze_physiology( p);
1486 if ( rc_graze == LDNDC_ERR_EVENT_MATCH)
1487 {
1488 n_plant[p->slot] = p->total_nitrogen();
1489 }
1490 }
1491 }
1492
1493 lerr_t rc_cut = m_eventcut.event_cut_physiology(
1494 m_veg,
1495 species_groups_select_t< species::grass, species::crop >());
1496 if ( rc_cut == LDNDC_ERR_EVENT_MATCH)
1497 {
1498 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
1499 {
1500 MoBiLE_Plant *p = (*vt);
1501 yearly_cuts[p->slot] += 1;
1502 n_plant[p->slot] = p->total_nitrogen();
1503
1504 if ( (*p)->RATOON())
1505 {
1507 }
1508 /* coffee: the harvest of mature fruit starts the next season (see @ref plamox_season_start) */
1509 else if ( PlaMox_is_family( p, FAMILY_COFFEE) && cbm::flt_greater( p->dvsMort, 0.99))
1510 {
1512 days_since_harvest_reset[p->slot] = 0;
1513 }
1514 }
1515 }
1516
1517 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
1518 {
1519 MoBiLE_Plant *p = (*vt);
1520 if ( cbm::flt_less( p->aboveground_biomass(), agb_vt[p->slot]))
1521 {
1522 double const scale( p->aboveground_biomass() / agb_vt[p->slot]);
1523 p->dvsFlush *= scale;
1524 p->dvsFlushOld *= scale;
1525 }
1526 }
1527
1528 return LDNDC_ERR_OK;
1529}
EventHandlerCut m_eventcut
Cutting event handler.
Definition plamox.h:179
EventHandlerGraze m_eventgraze
Grazing event handler.
Definition plamox.h:177
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)
Definition plamox.h:1007

References begin(), end(), FAMILY_COFFEE, m_eventcut, m_eventgraze, m_veg, n_plant, PlaMox_is_family(), 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)
4284{
4285 return ( _vt->mFol * PlaMox_get_foliage_nitrogen_concentration( _vt)
4286 + _vt->dw_lst * (*_vt)->NC_STRUCTURAL_TISSUE_MAX()
4287 + _vt->mFrt * (*_vt)->NC_FINEROOTS_MAX()
4288 + _vt->mBud * (*_vt)->NC_FRUIT_MAX());
4289}
double PlaMox_get_foliage_nitrogen_concentration(MoBiLE_Plant *)
Optimum foliage nitrogen concentration [kgN kgDW-1] (see Optimum foliage nitrogen concentration)
Definition plamox.cpp:4806

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).

534{
535 EventAttributes const * ev_plant = NULL;
536 while ((ev_plant = this->m_PlantEvents.pop()) != NULL)
537 {
538 char const * p_name = ev_plant->get( "/name", "?");
539 char const * p_type = ev_plant->get( "/type", "?");
540 char const * p_group = ev_plant->get( "/group", "?");
541 if ( !m_state->vegetation.have_plant( p_name))
542 {
543 species_t const * p = NULL;
544 if ( m_species)
545 { p = m_species->get_species( p_name); }
546
547 MoBiLE_PlantParameters p_parameters;
548 if ( p)
549 { p_parameters = p->get_parameters(); }
550 else if ( m_speciesparameters) /* assume event was not provided via input */
551 { p_parameters = (*m_speciesparameters)[p_type]; }
552 else
553 { /* no parameters.. */ }
554
555 MoBiLE_PlantSettings plant_settings( static_cast< unsigned int >(m_setup->canopylayers()),
556 p_name, p_type, p_group, &p_parameters);
557 plant_settings.nb_soillayers = sl_.soil_layer_cnt();
558
559 MoBiLE_Plant * plant = this->m_state->vegetation.new_plant( &plant_settings);
560 if ( plant)
561 {
562 plant->initialize();
563 }
564 else
565 {
566 KLOGERROR( "Species creation failed [species=", p->name(),"]");
567 return LDNDC_ERR_FAIL;
568 }
569 }
570
572
573 MoBiLE_Plant * vt = m_veg->get_plant( ev_plant->get( "/name", "?"));
574 if ( !vt){ return LDNDC_ERR_RUNTIME_ERROR; }
575
576 for (size_t i = 0; i < this->plantfamily_tags.size(); ++i)
577 {
578 char const * family = this->plantfamily_tags[i].c_str();
579 if ( this->m_veg->is_family( vt->ctype(), family)
580 || cbm::is_equal( vt->cname(), family))
581 {
582 lerr_t rc_plant = PlaMox_event_plant( vt, *ev_plant);
583 if ( rc_plant)
584 {
585 KLOGERROR( "Handling plant event failed [species=", vt->name(),"]");
586 return LDNDC_ERR_FAIL;
587 }
588 }
589 }
590 }
591
592 return LDNDC_ERR_OK;
593}
SubscribedEvent< LD_EventHandlerQueue > m_PlantEvents
Planting events.
Definition plamox.h:156
lerr_t PlaMox_step_resize()
resize plant species vector
Definition plamox-setting.cpp:484
input_class_speciesparameters_t const * m_speciesparameters
Species parameters input.
Definition plamox.h:131
lerr_t PlaMox_event_plant(MoBiLE_Plant *, EventAttributes const &)
Initializes a newly planted plant (see Planting)
Definition plamox.cpp:656

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, number of cuts in the current year and the fruit sink of the season (spikelet sterility, heat damage around flowering, maximum fruit mass). Used at planting, at the beginning of a new year for perennial plants and after cutting of ratoon species.

481{
482 _p->a_fix_n = 0.0;
483 _p->growing_degree_days = 0.0;
484 _p->dEmerg = -1;
485 _p->dvsMort = 0.0;
486 _p->dvsFlush = 0.0;
487 _p->dvsFlushOld = 0.0;
488 _p->mFol_na[0] = 0.0;
489 _p->mFol_na[1] = _p->mFol;
490
491 days_after_emergence[_p->slot] = -1;
492 yearly_cuts[_p->slot] = 0;
493 reset_phenology[_p->slot] = false;
494 gdd_day_start[_p->slot] = 0.0;
495 days_since_flag[_p->slot] = 0;
496
497 /* fruit sink of the season (see @ref plamox_fruit_sink): sterility and heat damage of the
498 * last season must not carry over to the next season of a perennial or ratoon plant */
499 spikelets_sterility[_p->slot] = 0.0;
500 m_fruit_maximum[_p->slot] = cbm::flt_greater_zero( (*_p)->M_FRUIT_OPT()) ?
501 (*_p)->M_FRUIT_OPT() * (have_mix_cover ? fractional_cover[_p->slot] : 1.0) : -1.0;
502 PlaMox_heat_stress_reset( _p->slot);
503 _p->f_heat_gf = 1.0;
504
505 /* coffee: the shoot growth of the ending season carries the fruit nodes of the next season */
506 dw_shoot_growth_last[_p->slot] = dw_shoot_growth_season[_p->slot];
507 dw_shoot_growth_season[_p->slot] = 0.0;
508 f_h2o_fruit_set_sum[_p->slot] = 0.0;
509 f_h2o_fruit_set_cnt[_p->slot] = 0.0;
510
511 return LDNDC_ERR_OK;
512}
lvector_t< bool > reset_phenology
Phenology of a perennial plant is reset as soon as MOS > 0.99.
Definition plamox.h:383
lvector_t< double > gdd_day_start
Season start of perennial plants (see Season start of perennial plants): growing degree days at the s...
Definition plamox.h:391

References days_after_emergence, dw_shoot_growth_last, dw_shoot_growth_season, f_h2o_fruit_set_cnt, f_h2o_fruit_set_sum, fractional_cover, gdd_day_start, have_mix_cover, m_fruit_maximum, PlaMox_heat_stress_reset(), reset_phenology, spikelets_sterility, and yearly_cuts.

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

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

◆ PlaMox_root_drought_factor()

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

Factor increasing the root allocation under drought (1: no response, see Fine roots)

Factor increasing the root allocation under drought (functional balance, see Fine roots); 1 if FRACTION_ROOT_DROUGHT = 0.

1814{
1815 if ( ! cbm::flt_greater_zero( (*_vt)->FRACTION_ROOT_DROUGHT()))
1816 {
1817 return 1.0;
1818 }
1819 double const fh2o_ref( cbm::flt_greater_zero( (*_vt)->H2OREF_LEAF_GROWTH()) ?
1820 (*_vt)->H2OREF_LEAF_GROWTH() : (*_vt)->H2OREF_A());
1821 return 1.0 + (*_vt)->FRACTION_ROOT_DROUGHT() * (1.0 - DroughtStress::linear_threshold( _vt->f_h2o, fh2o_ref));
1822}

Referenced by PlaMox_plant_development_crop().

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).
197{
200
201 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
202 {
203 MoBiLE_Plant *p = (*vt);
204
205 /* n_plant equals the plant pools at the end of every PlaMox step; if another module
206 * changed the pools in between (e.g. fire in spitfire), take them over, otherwise the
207 * removed nitrogen would be redistributed into the remaining tissue */
208 double const n_pools( p->total_nitrogen());
209 if ( std::fabs( n_pools - n_plant[p->slot]) > 1.0e-9 * cbm::bound_min( 1.0e-6, n_pools))
210 {
211 n_plant[p->slot] = n_pools;
212 }
213
214 /* reset */
215 for ( int fl = 0; fl < m_setup->canopylayers(); ++fl)
216 {
217 p->vcAct25_fl[fl] = 0.0;
218 p->jAct25_fl[fl] = 0.0;
219 p->rdAct25_fl[fl] = 0.0;
220 }
221 }
222
223 timestep_c_assi = 0.0;
225 n_at_planting = 0.0;
226
227 c_total_exported = 0.0;
228 c_fruit_exported = 0.0;
229 n_total_exported = 0.0;
230 n_fruit_exported = 0.0;
231
232
233
234 if ( lclock()->subday() == 1)
235 {
236 m_eventgraze.reset_daily_food_consumption();
237
238 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
239 {
240 MoBiLE_Plant *p = (*vt);
241 if ( days_after_emergence[p->slot] >= 0)
242 {
243 days_after_emergence[p->slot] += 1;
244 }
245
246 /* season start of perennials: development of the past day (see @ref plamox_season_start) */
248 {
249 double const gdd_day( p->growing_degree_days - gdd_day_start[p->slot]);
250 rest_days[p->slot] = cbm::flt_less( gdd_day, 1.0) ? rest_days[p->slot] + 1 : 0;
251 if ( reset_phenology[p->slot])
252 {
253 days_since_flag[p->slot] += 1;
254 }
255 if ( days_since_harvest_reset[p->slot] < 9999)
256 {
257 days_since_harvest_reset[p->slot] += 1;
258 }
259 gdd_day_start[p->slot] = p->growing_degree_days;
260 }
261 }
262 }
263
264 if ( MoBiLE_IsBeginningOfYear( lclock(), m_setup->latitude()))
265 {
266 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
267 {
268 MoBiLE_Plant *p = (*vt);
269 /* ratoon species start their season at the cut, coffee at the harvest
270 * (calendar only if no harvest reset took place within the last year) */
272 && (lclock()->seconds() > seconds_crop_planting[p->slot]) //avoid reset directly after planting at start of year
273 && !(*p)->RATOON()
274 && !( PlaMox_is_family( p, FAMILY_COFFEE) && (days_since_harvest_reset[p->slot] < 365)))
275 {
276 reset_phenology[p->slot] = true;
277 days_since_flag[p->slot] = 0;
278 }
279 }
280 }
281
282 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
283 {
284 MoBiLE_Plant *p = (*vt);
285 if ( reset_phenology[p->slot]
286 && cbm::flt_greater(p->dvsMort, 0.99)
288 {
290 }
291 dw_fol_old[p->slot] = p->mFol;
292 }
293
294 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
295 {
296 nh4_sl[sl] = sc_.nh4_sl[sl];
297 don_sl[sl] = sc_.don_sl[sl];
298 no3_sl[sl] = sc_.no3_sl[sl] + sc_.an_no3_sl[sl];
299 }
300
301 return LDNDC_ERR_OK;
302}
bool PlaMox_season_start_due(MoBiLE_Plant *)
Flagged season start of a perennial plant takes place now (rest phase, see Season start of perennial ...
Definition plamox.cpp:454
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:4829
lvector_t< double > don_sl
Soil DON available for uptake in the time step [kgN m-2].
Definition plamox.h:212
lvector_t< double > no3_sl
Soil nitrate (aerobic + anaerobic) available for uptake in the time step [kgN m-2].
Definition plamox.h:208
lvector_t< double > nh4_sl
Soil ammonium available for uptake in the time step [kgN m-2].
Definition plamox.h:210
void PlaMox_update_plant_list()
Updates the list of plants handled by PlaMox and their family flags.
Definition plamox-setting.cpp:558

References ANNUAL, automatic_nitrogen_uptake, begin(), c_fruit_exported, c_total_exported, days_after_emergence, don_sl, dw_fol_old, end(), FAMILY_COFFEE, gdd_day_start, m_eventgraze, m_setup, n_at_planting, n_fruit_exported, n_plant, n_total_exported, nh4_sl, no3_sl, PlaMox_get_life_cycle(), PlaMox_is_family(), PlaMox_reset_phenology(), PlaMox_season_start_due(), 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.
319{
320 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
321 {
322 MoBiLE_Plant *p = (*vt);
323 hypoxia[p->slot] = 0.0;
324 /* reset all layers: without belowground respiration there is no O2 demand,
325 * a value of the last respiring step must not keep killing roots */
326 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
327 {
328 p->hypoxia_sl[sl] = 0.0;
329 }
330 if ( cbm::flt_greater_zero( p->belowground_respiration()) &&
331 cbm::flt_greater_zero( m_veg->dw_frt()) &&
332 cbm::flt_greater_zero( p->mFrt) &&
333 cbm::is_valid( root_q_vt_[p->slot]) &&
334 cbm::flt_equal_zero( p->root_tc))
335 {
336 hypoxia[p->slot] = 0.0;
337 // O2 demand [kgO2 m-2] of belowground respiration [kgC m-2] (1 mol O2 per mol C)
338 double const o2_demand( p->belowground_respiration() * 2.0 * cbm::MO / cbm::MC);
339 for (size_t sl = 0; sl < root_q_vt_[p->slot]; sl++)
340 {
341 // calc available o2 in this soil layer for this species
342 double const v_pores( sc_.h_sl[sl] * sc_.poro_sl[sl]);
343 double const v_water( wc_.wc_sl[sl] / cbm::DWAT * sc_.h_sl[sl]);
344 double const v_ice( wc_.ice_sl[sl] / cbm::DICE * sc_.h_sl[sl]);
345 double const v_air( cbm::bound_min( 0.0, v_pores - v_water - v_ice));
346 double const o2( sc_.o2_sl[sl] * v_air /
347 ((mc_.temp_sl[sl] + cbm::D_IN_K) * (cbm::RGAS / (2.0 * cbm::MO * cbm::KG_IN_G) * cbm::PA_IN_BAR)));
348 // scale to root mass of species in relation to total root mass of all species per soil layer
349 // calc o2 demand of this species in this soil layer
350 double const o2_demand_sl( p->fFrt_sl[sl] * o2_demand);
351 double const o2_avail( o2 * (p->fFrt_sl[sl] * p->mFrt) / m_veg->mfrt_sl( sl));
352
353 if ( cbm::flt_greater( o2_demand_sl, o2_avail))
354 {
355 // 1 is full stress (no o2 avail), 0 is no stress (demand can be fullfiled)
356 // The value for the whole root system is weighed by the fine root distribution.
357 p->hypoxia_sl[sl] = cbm::bound( 0.0, 1.0 - o2_avail / o2_demand_sl, 1.0);
358 hypoxia[p->slot] += p->fFrt_sl[sl] * p->hypoxia_sl[sl];
359 }
360 else
361 {
362 p->hypoxia_sl[sl] = 0.0;
363 }
364 }
365 }
366 }
367
368 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
369 {
370 MoBiLE_Plant *p = (*vt);
371 p->dvsFlushOld = p->dvsFlush;
372 }
373
374 double agb( 0.0);
375 double dvs( 0.0);
376 double gdd( 0.0);
377 double dEmerg_send(0.0);
378 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
379 {
380 MoBiLE_Plant *p = *vt;
381 agb += p->aboveground_biomass();
382 dvs += p->dvsFlush;
383 gdd += p->growing_degree_days;
384 dEmerg_send += p->dEmerg;
385 }
386
387 for ( size_t sl = 0; sl < sl_.soil_layer_cnt(); ++sl)
388 {
389 if ( cbm::flt_greater_zero( nh4_sl[sl]))
390 {
391 sc_.nh4_sl[sl] = nh4_sl[sl];
392 }
393 else { sc_.nh4_sl[sl] = 0.0; }
394
395 if ( cbm::flt_greater_zero( don_sl[sl]))
396 {
397 sc_.don_sl[sl] = don_sl[sl];
398 }
399 else { sc_.don_sl[sl] = 0.0; }
400
401 double const no3_tot( sc_.no3_sl[sl] + sc_.an_no3_sl[sl]);
402 if ( cbm::flt_greater_zero( no3_tot))
403 {
404 sc_.no3_sl[sl] = sc_.no3_sl[sl] / no3_tot * no3_sl[sl];
405 sc_.an_no3_sl[sl] = no3_sl[sl] - sc_.no3_sl[sl];
406 }
407 else
408 {
409 sc_.no3_sl[sl] = no3_sl[sl] * (1.0 - sc_.anvf_sl[sl]);
410 sc_.an_no3_sl[sl] = no3_sl[sl] - sc_.no3_sl[sl];
411 }
412 }
413
414 aboveground_biomass.send( agb);
415 maturity_status.send( dvs);
417 dEmerg.send(dEmerg_send);
418
423
424
425 return LDNDC_ERR_OK;
426}
PublishedField< double > dEmerg
Published field: sum of the days of emergence of all plants.
Definition plamox.h:165
PublishedField< double > maturity_status
Published field: sum of the development stages of all plants [-].
Definition plamox.h:161
PublishedField< double > growing_degree_days_maturity
Published field: sum of the growing degree days of all plants [°C d].
Definition plamox.h:163
PublishedField< double > nitrogen_plant_biomass_fruit_exported_from_field
Published field: nitrogen exported with the fruit [kgN m-2].
Definition plamox.h:174
PublishedField< double > carbon_plant_biomass_total_exported_from_field
Published field: carbon exported with harvest [kgC m-2].
Definition plamox.h:168
PublishedField< double > nitrogen_plant_biomass_total_exported_from_field
Published field: nitrogen exported with harvest [kgN m-2].
Definition plamox.h:172
PublishedField< double > carbon_plant_biomass_fruit_exported_from_field
Published field: carbon exported with the fruit [kgC m-2].
Definition plamox.h:170
PublishedField< double > aboveground_biomass
Published field: aboveground biomass of all plants [kgDW m-2].
Definition plamox.h:159

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).

4029{
4030 size_t const fl_cnt( _vt->nb_foliagelayers());
4031
4032 double sla_cum( 0.0);
4033 for (size_t fl = 0; fl < fl_cnt; ++fl)
4034 {
4035 sla_cum += _vt->sla_fl[fl];
4036 }
4037
4038 /* Foliage biomass for lai calculation has lower boundary ensuring: lai >= lai_min */
4039 double mFol_lai( cbm::bound_min( lai_min[_vt->slot] / (*_vt)->SLAMAX(),
4040 _vt->mFol));
4041
4042 if ( rm_ && cbm::is_valid( rm_->lai_subday( lclock_ref())))
4043 {
4044 lai_dynamic[_vt->slot] = rm_->lai_subday( lclock_ref());
4045 }
4046 else
4047 {
4048 lai_dynamic[_vt->slot] = cbm::bound_min( lai_min[_vt->slot],
4049 lai_dynamic[_vt->slot] + (_vt->mFol - dw_fol_old[_vt->slot]) * _vt->sla_fl[fl_cnt-1]);
4050 }
4051
4052 if (cbm::flt_greater_zero( transplanting_shock_vt[_vt->slot]))
4053 {
4054 mFol_lai = mFol_lai * cbm::bound_min( 0.01, 1.0 - transplanting_shock_vt[_vt->slot]);
4055 }
4056
4057 if ( cbm::flt_greater_zero( sla_cum))
4058 {
4059 DroughtStress droughtstress;
4060 droughtstress.fh2o_ref = (*_vt)->H2OREF_LEAF_GROWTH();
4061
4062 //use dynamic lai only if remote sensing input is available
4063 if ( rm_)
4064 {
4065 for (size_t fl = 0; fl < fl_cnt; ++fl)
4066 {
4067 _vt->fFol_fl[fl] = _vt->sla_fl[fl] / sla_cum;
4068 _vt->lai_fl[fl] = lai_dynamic[_vt->slot] * _vt->fFol_fl[fl] * droughtstress.linear_threshold( _vt->f_h2o);
4069 }
4070 }
4071 else
4072 {
4073 for (size_t fl = 0; fl < fl_cnt; ++fl)
4074 {
4075 _vt->fFol_fl[fl] = _vt->sla_fl[fl] / sla_cum;
4076 _vt->lai_fl[fl] = mFol_lai * _vt->fFol_fl[fl] * _vt->sla_fl[fl] * droughtstress.linear_threshold( _vt->f_h2o);
4077 }
4078 }
4079
4080 for (int fl = fl_cnt; fl < m_setup->canopylayers(); ++fl)
4081 {
4082 _vt->fFol_fl[fl] = 0.0;
4083 _vt->lai_fl[fl] = 0.0;
4084 _vt->sla_fl[fl] = 0.0;
4085 }
4086 }
4087 else
4088 {
4089 for (int fl = 0; fl < m_setup->canopylayers(); ++fl)
4090 {
4091 _vt->fFol_fl[fl] = 0.0;
4092 _vt->lai_fl[fl] = 0.0;
4093 _vt->sla_fl[fl] = 0.0;
4094 }
4095 }
4096}

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.

317{
318 lerr_t rc = LDNDC_ERR_OK;
319
320 aboveground_biomass.publish( "AbovegroundBiomass", "kg/m2", _io_kcomm);
321 maturity_status.publish( "MaturityStatus", "-", _io_kcomm);
322 growing_degree_days_maturity.publish( "GrowingDegreeDays", "-", _io_kcomm);
323 dEmerg.publish("dEmerg_send", "-", _io_kcomm);
324
325 carbon_plant_biomass_total_exported_from_field.publish( "carbon_plant_biomass_total_exported_from_field", "kg/m2", _io_kcomm);
326 carbon_plant_biomass_fruit_exported_from_field.publish( "carbon_plant_biomass_fruit_exported_from_field", "kg/m2", _io_kcomm);
327 nitrogen_plant_biomass_total_exported_from_field.publish( "nitrogen_plant_biomass_total_exported_from_field", "kg/m2", _io_kcomm);
328 nitrogen_plant_biomass_fruit_exported_from_field.publish( "nitrogen_plant_biomass_fruit_exported_from_field", "kg/m2", _io_kcomm);
329
330 rc = m_eventcut.register_ports( _io_kcomm);
331 if ( rc)
332 { return LDNDC_ERR_FAIL; }
333
334 rc = m_eventgraze.register_ports( _io_kcomm);
335 if ( rc)
336 { return LDNDC_ERR_FAIL; }
337
338 int rc_harvest = this->m_HarvestEvents.subscribe( "harvest", _io_kcomm);
339 if ( rc_harvest != LD_PortOk)
340 { return LDNDC_ERR_FAIL; }
341
342 int rc_plant = this->m_PlantEvents.subscribe( "plant", _io_kcomm);
343 if ( rc_plant != LD_PortOk)
344 { return LDNDC_ERR_FAIL; }
345
346 return rc;
347}

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.

44{
45 /* Pre-time step setting */
46 (void)PlaMox_step_init();
47 /* phosphorus only if the soil chemistry module simulates it */
48 have_p_ = ( sc_.p_active > 0.5);
49
50 /* Begin balance check */
51 PlaMox_balance_check( ON_ENTRY);
52
53 /* Grazing and Cutting */
54 lerr_t rc = PlaMox_management();
55 if ( rc) { return rc; }
56
57 /* Planting */
58 rc = PlaMox_planting();
59 if ( rc) { return rc; }
61
62 /* Vernalization */
63 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
64 {
65 MoBiLE_Plant *p = *vt;
68 }
69
70 /* Plant development
71 * determines how much C is given to which plant part in photosynthesis (C allocation) */
72 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
73 {
74 MoBiLE_Plant *p = *vt;
75 if ( cbm::flt_greater_zero( (*p)->GDD_FLOWERING()))
76 {
78 }
79
80 if ( p->group() == "crop")
81 {
83 }
84 else if ( p->group() == "grass")
85 {
87 }
88 }
89
90 /* Photosynthesis activity and carbon allocation
91 * The C is translated into biomass via CCDM. */
92 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
93 {
94 MoBiLE_Plant *p = *vt;
95
96 // here some mass is added to _vt->mFrt! but the root length is not increased
97 lerr_t rc_photosynthesis = PlaMox_photosynthesis( p);
98
99 if ( rc_photosynthesis)
100 {
101 KLOGERROR( "Photosynthesis calculation failed [species=", p->name(),"]");
102 return LDNDC_ERR_FAIL;
103 }
104
105 /* root growth */
106 PlaMox_update_root_structure( p, p->dcFrt/cbm::CCDM);
107
108 if ( p->group() == "grass")
109 {
111 }
112
114 }
115
116 /* Nitrogen uptake/fixation */
117 if ( have_p_) { PlaMox_phosphorus_mark( P_MARK_PRE_UPTAKE); }
118 PlaMox_nitrogen_uptake_competition();
119 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
120 {
121 MoBiLE_Plant *p = *vt;
122
124
126
127 }
128 if ( have_p_) { PlaMox_phosphorus_mark( P_MARK_UPTAKE); }
129
130 /* C-losses (respiration, exudation and senescence */
131 for ( PlaMoxIterator vt = begin(); vt != end(); ++vt)
132 {
133 MoBiLE_Plant *p = *vt;
134
135 /* respiration */
137
138 /* exsudation */
140
141 /* senescence */
143
144 /* abscission */
146
147 /* ground coverage */
149
150 /* plant height */
152
153 /* specific leaf area */
155
156 /* leaf area index */
158
159 /* drought */
160 PlaMox_drought( p);
161
162 /* transpiration */
164
165 }
166
167 /* Harvest */
168 rc = PlaMox_harvest();
169 if ( rc) { return rc; }
170 if ( have_p_) { PlaMox_phosphorus_mark( P_MARK_END); }
171
172 /* End balance check */
173 PlaMox_balance_check( ON_EXIT);
174
175 /* Post-time step setting */
177
178 return LDNDC_ERR_OK;
179}
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:196
void PlaMox_update_specific_leaf_area(MoBiLE_Plant *)
Specific leaf area of the foliage layers (see Specific leaf area)
Definition plamox.cpp:4120
lerr_t PlaMox_abscission(MoBiLE_Plant *)
Shedding of dead foliage and stems of grass (see Abscission of grass and coffee)
Definition plamox.cpp:3686
lerr_t PlaMox_management()
Applies grazing and cutting events.
Definition plamox.cpp:1468
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:4515
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:3345
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:4028
void PlaMox_respiration(MoBiLE_Plant *)
Maintenance and growth respiration (see Respiration)
lerr_t PlaMox_harvest()
Handles all pending harvest events.
Definition plamox.cpp:964
lerr_t PlaMox_step_out()
Post-time step: oxygen deficiency, soil nitrogen and published fields.
Definition plamox.cpp:318
void PlaMox_transpiration(MoBiLE_Plant *)
Potential transpiration (see Transpiration)
Definition plamox.cpp:3806
void PlaMox_balance_check(int)
Carbon and nitrogen balance check (stage ON_ENTRY or ON_EXIT)
Definition plamox-setting.cpp:386
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:533
void PlaMox_vernalization(MoBiLE_Plant *)
Chilling units and chill factor (see Vernalization)
Definition plamox.cpp:1753
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:3767
lerr_t PlaMox_redistribution(MoBiLE_Plant *)
Retranslocation of stem and leaf mass to the fruit (see Retranslocation to the fruit)
Definition plamox.cpp:2516
lerr_t PlaMox_bud_burst(MoBiLE_Plant *)
Translocation from storage to foliage of grass (see Bud burst of grass)
Definition plamox.cpp:2391
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)
void PlaMox_phosphorus_mark(int)
phosphorus bookkeeping at three stages of the time step: P_MARK_PRE_UPTAKE (before nitrogen uptake: s...
Definition plamox-phosphorus.cpp:148

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_phosphorus_mark(), 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(), PlaMox_vernalization(), and sc_.

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

◆ p_n_mark_

std::vector< double > ldndc::PhysiologyPlaMox::p_n_mark_
private

plant nitrogen at the last bookkeeping stage [kgN m-2]

Referenced by PlaMox_phosphorus_mark().

◆ p_plant_

std::vector< double > ldndc::PhysiologyPlaMox::p_plant_
private

plant phosphorus per slot [kgP m-2]

Referenced by PlaMox_phosphorus_mark().

◆ p_po4_sl_

std::vector< double > ldndc::PhysiologyPlaMox::p_po4_sl_
private

labile phosphorus available in this time step [kgP m-2]

Referenced by PlaMox_phosphorus_mark().

◆ p_up_sl_

std::vector< double > ldndc::PhysiologyPlaMox::p_up_sl_
private

work array

◆ 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().