LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
graze.h
1
2#ifndef LM_EVENTHANDLER_GRAZE_H_
3#define LM_EVENTHANDLER_GRAZE_H_
4
5#include "mbe_legacymodel.h"
6#include "state/mbe_state.h"
7
8#include "ld_eventqueue.h"
9#include "ld_isotopes.h"
10
11namespace ldndc {
12
13 namespace event {
14 class EventGraze; }
15
16class LDNDC_API EventHandlerGraze : public MBE_LegacyModel
17{
18 LMOD_EXPORT_MODULE_INFO(EventHandlerGraze,"eventhandler:graze","EventHandler Graze");
19 public:
20 EventHandlerGraze( MoBiLE_State *,
21 cbm::io_kcomm_t *, timemode_e);
22 ~EventHandlerGraze();
23
24 lerr_t configure( ldndc::config_file_t const *) { return LDNDC_ERR_OK; }
25 lerr_t register_ports( cbm::io_kcomm_t *);
26 lerr_t initialize() { return LDNDC_ERR_OK; }
27
28 lerr_t solve();
29 lerr_t unregister_ports( cbm::io_kcomm_t *);
30 lerr_t finalize() { return LDNDC_ERR_OK; }
31
32 lerr_t wake() { return LDNDC_ERR_OK; }
33 lerr_t sleep() { return LDNDC_ERR_OK; }
34
35 public:
36
51 lerr_t event_graze_physiology( MoBiLE_Plant *);
52
53 lerr_t update_available_freshfood_c(
54 MoBiLE_PlantVegetation *,
55 species_groups_selector_t const &);
56
57 void reset_daily_food_consumption();
58
59 private:
60 cbm::io_kcomm_t * io_kcomm;
61
62 input_class_soillayers_t const * sl_;
63 input_class_siteparameters_t const & sipar_;
64 substate_microclimate_t const & mc_;
65 substate_physiology_t * ph_;
66 substate_soilchemistry_t & sc_;
67
68 EventQueue m_GrazeEvents;
69 CBM_Handle m_GrazeHandle;
70
71 double total_available_freshfood_c;
72 double day_food_consume_c;
73
74 private:
75
76 double get_available_freshfood_c( MoBiLE_Plant *);
77 double get_available_freshfood_c_crop( MoBiLE_Plant *);
78 double get_available_freshfood_c_wood( MoBiLE_Plant *);
79 double get_available_freshfood_c_grass( MoBiLE_Plant *);
80
81 double get_total_freshfood_c( MoBiLE_Plant *);
82 double get_total_freshfood_c_crop( MoBiLE_Plant *);
83 double get_total_freshfood_c_wood( MoBiLE_Plant *);
84 double get_total_freshfood_c_grass( MoBiLE_Plant *);
85
86 lerr_t handle_graze( MoBiLE_Plant *,
87 ldndc::EventAttributes const &);
88
89 void update_biomass_after_graze_(
90 double * /*biomass dry weight*/,
91 double * /*total loss carbon*/, double * /*total loss nitrogen*/,
92 double /*loss carbon*/, double /*n/c ratio*/);
93
94 Isotopes isotope;
95};
96
97} /*namespace ldndc*/
98
99#endif /* !LM_EVENTHANDLER_GRAZE_H_ */
100
Spatially explicit groundwater model.
Definition airchemistryput.h:15