LandscapeDNDC 1.37.0
output-watercycle-daily.h
1
10#ifndef LM_OUTPUT_WATERCYCLE_DAILY_H_NEW_
11#define LM_OUTPUT_WATERCYCLE_DAILY_H_NEW_
12
13#include "mbe_legacyoutputmodel.h"
14#include "state/mbe_state.h"
15
16/* if defined, watercycle daily output exhibits request API */
17//#define OutputWatercycleDaily_HAVE_request_api
18#ifdef OutputWatercycleDaily_HAVE_request_api
19# include "kernel/kcomm.h"
20struct lmessage_t;
21struct lreply_t;
22#endif
23
24
25#define LMOD_OUTPUT_MODULE_BASE MBE_LegacyOutputModel
26#define LMOD_OUTPUT_MODULE_NAME OutputWatercycleDaily
27#define LMOD_OUTPUT_MODULE_ID "output:watercycle:daily"
28#define LMOD_OUTPUT_MODULE_DESC "Water Cycle Daily Output"
29
30namespace ldndc {
31class substate_microclimate_t;
32class substate_physiology_t;
33class substate_soilchemistry_t;
34class substate_watercycle_t;
35
36extern cbm::logger_t * OutputWatercycleDailyLogger;
37
38class LDNDC_API LMOD_OUTPUT_MODULE_NAME : public LMOD_OUTPUT_MODULE_BASE
39{
40 LMOD_EXPORT_MODULE_INFO(LMOD_OUTPUT_MODULE_NAME,LMOD_OUTPUT_MODULE_ID,LMOD_OUTPUT_MODULE_DESC);
41
42 public:
43 LMOD_OUTPUT_MODULE_NAME(
44 MoBiLE_State *,
45 cbm::io_kcomm_t *,
46 timemode_e _timemode);
47
48 ~LMOD_OUTPUT_MODULE_NAME();
49
50
51 lerr_t configure( ldndc::config_file_t const *);
52
53 lerr_t initialize();
54
55 lerr_t solve();
56
57 lerr_t finalize();
58
59 lerr_t wake() { return LDNDC_ERR_OK; }
60 lerr_t sleep() { return LDNDC_ERR_OK; }
61
62 private:
63 lerr_t execute();
64 lerr_t dump_0(
65 ldndc_flt64_t *);
66
67 private:
68 cbm::io_kcomm_t * io_kcomm;
69#ifdef OutputWatercycleDaily_HAVE_request_api
70 ldndc::kcomm_t kcomm;
71 public:
72 lerr_t process_message( lmessage_t const *, lreply_t *);
73 private:
74#endif
75 input_class_soillayers_t const * soillayers_in;
76 input_class_setup_t const * setup_;
77 input_class_groundwater_t const * m_groundwater;
78 substate_microclimate_t const * microclim;
79 substate_physiology_t const * phys;
80 substate_soilchemistry_t const * soilchem;
81 substate_watercycle_t const * water;
82
83 MoBiLE_PlantVegetation * m_veg;
84
85 private:
86 ldndc::sink_handle_t m_sink;
87
88 /* configuration options: */
89 struct conf_t
90 {
91 bool bypass_mobile:1;
92 };
93 struct conf_t rc;
94
95 /* configure format of water content output: water filled pore space / water content */
96 bool format_wfps;
97
98 struct output_watercycle_daily_acc_t
99 {
100 double irrigation;
101 double automatic_irrigation;
102 double reservoir_irrigation;
103 double ggcmi_irrigation;
104
105 double throughfall;
106 double potentialevaporation;
107 double potentialtranspiration;
108 double transpiration;
109 double wateruptake;
110 double interceptionevaporation;
111 double soilevaporation;
112 double surfacewaterevaporation;
113 double runoff;
114 double percolation;
115
116 double surface_waterflux;
117 double groundwateraccess;
118 double groundwaterloss;
119 double capillaryrise;
120 };
121 output_watercycle_daily_acc_t acc;
122 void pop_accumulated_outputs();
123 void push_accumulated_outputs();
124};
125} /*namespace ldndc*/
126
127
128#undef LMOD_OUTPUT_MODULE_BASE
129#undef LMOD_OUTPUT_MODULE_NAME
130#undef LMOD_OUTPUT_MODULE_ID
131#undef LMOD_OUTPUT_MODULE_DESC
132
133
134#endif /* !LM_OUTPUT_WATERCYCLE_DAILY_H_NEW_ */
Spatially explicit groundwater model.
Definition: airchemistryput.h:15