8#ifndef LM_PHYSIOLOGY_PNET_H_
9#define LM_PHYSIOLOGY_PNET_H_
12#include "mbe_legacymodel.h"
13#include "state/mbe_state.h"
15#include "physiology/ld_plantfunctions.h"
16#include "physiology/ld_treedyn.h"
18#include <logging/cbm_logging.h>
22extern cbm::logger_t * PhysiologyPNETLogger;
34 LMOD_EXPORT_MODULE_INFO(
PhysiologyPNET,
"physiology:pnet",
"Physiology PNET");
54 static const double C;
57 static const double K;
60 static const double P;
63 static const double BETA;
66 static const double TEQ;
69 static const double TRANGE;
86 lerr_t register_ports( cbm::io_kcomm_t * );
87 lerr_t unregister_ports( cbm::io_kcomm_t * );
89 lerr_t configure( ldndc::config_file_t
const *);
95 lerr_t finalize() {
return LDNDC_ERR_OK; }
105 lerr_t
sleep() {
return LDNDC_ERR_OK; }
106 lerr_t wake() {
return LDNDC_ERR_OK; }
108 cbm::string_t branchfraction_opt;
109 cbm::string_t crownlength_opt;
110 bool competition_opt;
115 cbm::io_kcomm_t * io_kcomm;
117 input_class_soillayers_t
const & sl_;
118 input_class_setup_t
const & m_setup;
119 input_class_siteparameters_t
const * m_sipar;
120 input_class_species_t
const * m_species;
122 substate_airchemistry_t
const & ac_;
123 substate_microclimate_t
const & mc_;
124 substate_physiology_t & ph_;
125 substate_soilchemistry_t & sc_;
126 substate_watercycle_t & wc_;
128 MoBiLE_PlantVegetation * m_veg;
130 LD_PlantFunctions m_pf;
131 TreeDynamics m_treedyn;
133 SubscribedEvent<LD_EventHandlerQueue> m_HarvestEvents;
134 SubscribedEvent<LD_EventHandlerQueue> m_PlantEvents;
136 lvector_t< double > no3_sl;
137 lvector_t< double > nh4_sl;
142 double accumulated_transpiration_old;
144 unsigned int year_start_, year_end_;
146 lvector_t< double > LayerGrossPsn;
147 template <
typename _E >
148 struct scalar_with_array_look_and_feel_t
151 _E & operator=( _E
const & _value)
152 { this->value = _value;
return this->value; }
153 _E & operator[](
size_t)
154 {
return this->value; }
155 _E & operator[]( MoBiLE_Plant *)
156 {
return this->value; }
160 scalar_with_array_look_and_feel_t< double > mFolOld_vt;
161 scalar_with_array_look_and_feel_t< double > mFrtOld_vt;
162 scalar_with_array_look_and_feel_t< double > mBudOld_vt;
163 scalar_with_array_look_and_feel_t< double > mSapOld_vt;
164 scalar_with_array_look_and_feel_t< double > mCorOld_vt;
166 lvector_t< double > mBudLoss_vt;
167 lvector_t< double > mSapLoss_vt;
185 double CanopyGrossPsn;
189 double CanopyGrossPsnMo;
212 double PosCBalMassTot;
213 double PosCBalMassIx;
229 void balance_check( MoBiLE_Plant *p,
unsigned int _i);
239 void update_nitrogen_concentration( MoBiLE_Plant *);
244 void YearlyReset( MoBiLE_Plant *);
257 void Photosyn( MoBiLE_Plant *);
267 void AllocateYr( MoBiLE_Plant *);
272 void N_uptake( MoBiLE_Plant *,
double &);
277 void Update( MoBiLE_Plant *,
double ,
double );
282 void TransformPhysiology( MoBiLE_Plant *);
284 lerr_t CalcVegStructure();
289 size_t get_na_max_pnet();
Vegetation model PNET.
Definition: pnet.h:33
lerr_t sleep()
Definition: pnet.h:105
void AllocateMo(MoBiLE_Plant *)
static const double C
Definition: pnet.h:54
static const double NUPTAIR
Definition: pnet.h:72
static const double TMIN_NUP
Definition: pnet.h:39
static const double SRATEMAX
Definition: pnet.h:51
static const double GROWMAX
Definition: pnet.h:75
static const double TMAX_NUP
Definition: pnet.h:42
static const double KM_NO3
Definition: pnet.h:45
static const double KM_NH4
Definition: pnet.h:48
Spatially explicit groundwater model.
Definition: airchemistryput.h:15