LandscapeDNDC 1.37.0
psim.h
1
10#ifndef LM_PHYSIOLOGY_GROWTHPSIM_H_
11#define LM_PHYSIOLOGY_GROWTHPSIM_H_
12
13#include "mbe_legacymodel.h"
14#include "state/mbe_state.h"
15#include "ld_shared.h"
16
17#include "physiology/ld_nitrogenfixation.h"
18#include "physiology/ld_plantfunctions.h"
19#include "physiology/ld_rootsystem.h"
20#include "physiology/ld_treedyn.h"
21#include "physiology/photofarquhar/berryball.h"
22
23#include "eventhandler/graze/graze.h"
24#include "eventhandler/cut/cut.h"
25
26namespace ldndc {
27
28extern cbm::logger_t * PhysiologyGrowthPSIMLogger;
29
38class LDNDC_API PhysiologyGrowthPSIM : public MBE_LegacyModel
39{
40 LMOD_EXPORT_MODULE_INFO(PhysiologyGrowthPSIM,"physiology:psim","Physiology GrowthPSIM");
41
42 public:
44 static const unsigned int IMAX_W;
46 static const double C1;
48 static const double CCOMNOX;
50 static const double CSATNH3;
52 static const double CSATNOX;
54 static const double EPOTNOX;
56 static const double FRFRT;
58 static const double FMIN;
60 static const double KMMM;
62 static const double PAMM;
64 static const double PGDD;
66 static const double PMIN;
68 static const double PNIT;
70 static const double PPHLOE;
72 static const double PREDFRT;
74 static const double PREDSAP;
76 static const double PTW;
78 static const double TAU;
80 static const double TGLIM;
82 static const double TRMAX;
84 static const double TRMIN;
86 static const double TROPT;
88 static const double UPOTNH3;
89
90 public:
92 MoBiLE_State *,
93 ::cbm::io_kcomm_t *,
94 timemode_e);
95
97
98 lerr_t configure( ::ldndc::config_file_t const *);
99 lerr_t register_ports( cbm::io_kcomm_t *);
100 lerr_t initialize();
101
102 lerr_t solve();
103 lerr_t unregister_ports( cbm::io_kcomm_t *);
104 lerr_t finalize() { return LDNDC_ERR_OK; }
105
106 lerr_t sleep();
107 lerr_t wake();
108
113 cbm::string_t branchfraction_opt;
114
119 cbm::string_t crownlength_opt;
120
126 bool rootgrowth_opt;
127
128 double clumping_factor;
129
134 cbm::string_t timemode_opt;
135
141 double target_biomass;
142 int target_treenumber;
143
144
145 bool have_forest_structure();
146
147 protected:
148
152 lerr_t PSIM_ResizeVegetationVectors();
153
157 lerr_t PSIM_StepInit();
158
162 lerr_t PSIM_PlantingEvent();
163
167 lerr_t PSIM_HydraulicConductance();
168
172 lerr_t PSIM_Photosynthesis();
173
177 lerr_t PSIM_Potentialtranspiration();
178
179 lerr_t PSIM_ResetFlushing();
180
181 lerr_t PSIM_ResetPhenology( MoBiLE_Plant *);
182
183 lerr_t PSIM_Reset( MoBiLE_Plant *);
184
185 lerr_t PSIM_ResetBiomassFromLastYear();
186
187 lerr_t PSIM_UpdateNitrogenConc();
188
189 lerr_t PSIM_AgriculturalManagement();
190
191 lerr_t PSIM_BudBurst();
192
193 lerr_t PSIM_Senescence();
194
195 lerr_t PSIM_CarAllocation();
196
197 lerr_t PSIM_SoilCarbonRelease();
198
199 lerr_t PSIM_NitAllocation();
200
201 lerr_t PSIM_Respiration();
202
203 lerr_t PSIM_NitrogenFixation();
204
205 lerr_t PSIM_NitrogenUptake();
206
207 lerr_t PSIM_BiomassUpdate();
208
209 lerr_t PSIM_PhotosynthesisRates();
210
211 lerr_t PSIM_DroughtStress();
212
213 lerr_t PSIM_NitrogenBalance();
214
215 lerr_t PSIM_VegStructure();
216
217 lerr_t PSIM_BalanceCheck(size_t);
218
219 bool subdaily_timemode();
220
221 lerr_t PSIM_Harvest();
222
223 lerr_t PSIM_StepOut();
224
225 private:
226
227 MoBiLE_State * m_state;
228 cbm::io_kcomm_t * io_kcomm;
229
230 input_class_climate_t const & cl_;
231 input_class_soillayers_t const & sl_;
232 input_class_setup_t const * m_setup;
233 input_class_siteparameters_t const * m_sipar;
234 input_class_species_t const * m_species;
235
236 substate_airchemistry_t & ac_;
237 substate_microclimate_t & mc_;
238 substate_physiology_t & ph_;
239 substate_soilchemistry_t & sc_;
240 substate_watercycle_t & wc_;
241
242 MoBiLE_PlantVegetation * m_veg;
243
244 NitrogenFixation *NitrogenFixation_;
245
246 SubscribedEvent<LD_EventHandlerQueue> m_PlantEvents;
247 SubscribedEvent<LD_EventHandlerQueue> m_HarvestEvents;
248
249 lvector_t< bool > additional_season; //set to true if additional growing season within the current phenological year is possible
250 lvector_t< unsigned int > phenological_year; //stores year of start of current growing season
251 lvector_t< int > foliage_age_of_start_senescence; // age of foliage in days at which leaves start to shed
252
253 lvector_t< double > carbonuptake_vt;
254
255 lvector_t< int > days_since_emergence;
256 std::vector< std::vector< int > > foliage_age_na;
257
258 lvector_t< double > temp_sl;
259 lvector_t< double > ts_temp_fl;
260
261 lvector_t< double > no_concentration_fl;
262 lvector_t< double > no2_concentration_fl;
263 lvector_t< double > nh3_concentration_fl;
264
265 //lvector_t< double > xylem_resistance_smoothed_vt;
266 lvector_t< double > xylem_resistance_smoothed_old_vt;
267 lvector_t< double > psidecline_cum_vt;
268 lvector_t< double > psidecline_daycum_vt;
269 lvector_t< double > rehydrationindex_cum_vt;
270
271 lvector_t< double > mSapOld_vt;
272 lvector_t< double > mCorOld_vt;
273
274 lvector_t< double > qsaparea_vt;
275 lvector_t< double > fsub_vt;
276
277 lvector_t< double > mSapOpt_vt;
278 lvector_t< double > mBudLoss_vt;
279 lvector_t< double > mSapLoss_vt;
280 lvector_t< double > ncFolOpt;
281 lvector_t< double > ncBudOpt;
282 lvector_t< double > ts_leaftemp_vt;
283 lvector_t< double > nd_leaftemp_vt;
284 lvector_t< double > nDem_vt;
285 lvector_t< double > nFol_vt;
286 lvector_t< double > nFrt_vt;
287 lvector_t< double > nSap_vt;
288 lvector_t< double > nCor_vt;
289 lvector_t< double > nBud_vt;
290 lvector_t< double > cNOx_fl;
291
292 lvector_t< double > uptNH4Max_vt;
293 lvector_t< double > uptNO3Max_vt;
294 lvector_t< double > uptDONMax_vt;
295 lvector_t< double > uptNWetMax_vt;
296 lvector_t< double > uptNWet_vt;
297 lvector_t< double > uptNTot_vt;
298 std::vector< std::vector< double > > uptNH4Max_vtsl;
299 std::vector< std::vector< double > > uptNO3Max_vtsl;
300 std::vector< std::vector< double > > uptDONMax_vtsl;
301
302 lvector_t< double > rFolOld_vt;
303 lvector_t< double > rBudOld_vt;
304 lvector_t< double > rSapOld_vt;
305 lvector_t< double > rFrtOld_vt;
306 lvector_t< double > rTraOld_vt;
307 lvector_t< double > exsuLossOld_vt;
308
309 lvector_t< double > uptNH4_vt;
310 lvector_t< double > uptNO3_vt;
311 lvector_t< double > uptNH3_vt;
312 lvector_t< double > uptDON_vt;
313
314 lvector_t< double > uptNH4Old_vt;
315 lvector_t< double > uptNO3Old_vt;
316 lvector_t< double > uptNH3Old_vt;
317 lvector_t< double > uptDONOld_vt;
318
319 lvector_t< double > uptN2Old_vt;
320 lvector_t< double > uptNOxOld_vt;
321
322 lvector_t< double > n_bud_to_fol_vt;
323
324 lvector_t< double > n_sap_to_cor_vt;
325 lvector_t< double > n_bud_to_cor_vt;
326 lvector_t< double > n_fol_to_cor_vt;
327 lvector_t< double > n_frt_to_cor_vt;
328
329 lvector_t< double > n_sap_to_litter_vt;
330
331 lvector_t< double > n_sap_to_redistribute_vt;
332 lvector_t< double > n_bud_to_redistribute_vt;
333 lvector_t< double > n_fol_to_redistribute_vt;
334 lvector_t< double > n_frt_to_redistribute_vt;
335
336 lvector_t< double > n_sap_gain_vt;
337 lvector_t< double > n_bud_gain_vt;
338 lvector_t< double > n_fol_gain_vt;
339 lvector_t< double > n_frt_gain_vt;
340
341 lvector_t< double > nh3_uptake_fl;
342 lvector_t< double > nox_uptake_fl;
343
344 double mFol_emergence;
345 double accumulated_wateruptake_old;
346 double accumulated_potentialtranspiration_old;
347
348 double plant_waterdeficit_old;
349 double psi_deficit_old;
350
351 double tot_c;
352 double tot_n;
353
354 bool daytime;
355 double SIM_DAY_FRACTION;
356
357 size_t fl_cnt_;
358
359 LD_PlantFunctions m_pf;
360 TreeDynamics m_treedyn;
361
362 lvector_t< double > no3_sl;
363 lvector_t< double > nh4_sl;
364 lvector_t< double > don_sl;
365
366 EventHandlerGraze m_eventgraze;
367 EventHandlerCut m_eventcut;
368
369 BerryBall m_photo;
370
377 std::map< int, RootSystemDNDC > root_system;
378};
379} /*namespace ldndc*/
380
381#endif /* !LM_PHYSIOLOGY_GROWTHPSIM_H_ */
382
Vegetation model GrowthPSIM.
Definition: psim.h:39
cbm::string_t branchfraction_opt
...
Definition: psim.h:113
cbm::string_t crownlength_opt
...
Definition: psim.h:119
static const double TROPT
Definition: psim.h:86
static const double CCOMNOX
Definition: psim.h:48
static const double PREDFRT
Definition: psim.h:72
static const double PNIT
Definition: psim.h:68
static const double TAU
Definition: psim.h:78
static const double PMIN
Definition: psim.h:66
static const double CSATNOX
Definition: psim.h:52
static const double PAMM
Definition: psim.h:62
static const double C1
Definition: psim.h:46
static const double FRFRT
Definition: psim.h:56
static const double PTW
Definition: psim.h:76
static const double KMMM
Definition: psim.h:60
int stand_structure_opt
...
Definition: psim.h:140
static const double PREDSAP
Definition: psim.h:74
static const double EPOTNOX
Definition: psim.h:54
static const double TRMAX
Definition: psim.h:82
static const double UPOTNH3
Definition: psim.h:88
static const double TGLIM
Definition: psim.h:80
cbm::string_t timemode_opt
...
Definition: psim.h:134
std::map< int, RootSystemDNDC > root_system
Root system.
Definition: psim.h:377
static const double CSATNH3
Definition: psim.h:50
static const unsigned int IMAX_W
Definition: psim.h:44
static const double FMIN
Definition: psim.h:58
static const double PPHLOE
Definition: psim.h:70
static const double PGDD
Definition: psim.h:64
bool competition_opt
...
Definition: psim.h:125
static const double TRMIN
Definition: psim.h:84
Spatially explicit groundwater model.
Definition: airchemistryput.h:15