LandscapeDNDC 1.37.0
output-ggcmi-seasonal.h
1
9#ifndef LM_OUTPUT_GGCMI_SEASONAL_H_NEW_
10#define LM_OUTPUT_GGCMI_SEASONAL_H_NEW_
11
12#include "mbe_legacyoutputmodel.h"
13#include "state/mbe_state.h"
14
15#define LMOD_OUTPUT_MODULE_BASE MBE_LegacyOutputModel
16#define LMOD_OUTPUT_MODULE_NAME OutputGgcmiSeasonal
17#define LMOD_OUTPUT_MODULE_ID "output:ggcmi:seasonal"
18#define LMOD_OUTPUT_MODULE_DESC "GGCMI Seasonal Output"
19namespace ldndc {
20class substate_microclimate_t;
21class substate_physiology_t;
22class substate_watercycle_t;
23class LDNDC_API LMOD_OUTPUT_MODULE_NAME : public LMOD_OUTPUT_MODULE_BASE
24{
25 LMOD_EXPORT_MODULE_INFO(LMOD_OUTPUT_MODULE_NAME,LMOD_OUTPUT_MODULE_ID,LMOD_OUTPUT_MODULE_DESC);
26 public:
27 LMOD_OUTPUT_MODULE_NAME(
28 MoBiLE_State *,
29 cbm::io_kcomm_t *,
30 timemode_e _timemode);
31
32 ~LMOD_OUTPUT_MODULE_NAME();
33
34
35 lerr_t configure( ldndc::config_file_t const *);
36
37 lerr_t initialize();
38
39 lerr_t solve();
40
41 lerr_t finalize();
42
43 lerr_t wake() { return LDNDC_ERR_OK; }
44 lerr_t sleep() { return LDNDC_ERR_OK; }
45
46 private:
47 lerr_t dump_0(
48 ldndc_flt64_t *);
49
50 private:
51 cbm::io_kcomm_t * io_kcomm;
52
53 input_class_soillayers_t const * soillayers_in;
54
55 substate_physiology_t const * phys;
56 substate_soilchemistry_t const * soilchem;
57 substate_watercycle_t const * water;
58 MoBiLE_PlantVegetation * m_veg;
59
60 private:
61 ldndc::sink_handle_t m_sink;
62
63 struct output_ggcmi_daily_acc_t
64 {
65 double nh3_uptake;
66 double nh4_uptake;
67 double no3_uptake;
68 double don_uptake;
69
70 double nh4_throughfall;
71 double no3_throughfall;
72
73 double don_leach;
74 double no3_leach;
75 double nh4_leach;
76
77 double ch4_emis;
78 double co2_emis_auto;
79 double co2_emis_hetero;
80 double no_emis;
81 double n2o_emis;
82 double n2_emis;
83 double nh3_emis;
84
85 double n2_fix_algae;
86 double n2_fix_bio;
87
88 double irrigation;
89 double transpiration;
90 double wateruptake;
91 double interceptionevaporation;
92 double soilevaporation;
93 double surfacewaterevaporation;
94 double runoff;
95 double percolation;
96 };
97 output_ggcmi_daily_acc_t acc;
98 void pop_accumulated_outputs();
99 void push_accumulated_outputs();
100
101 struct output_ggcmi_seasonal_acc_t
102 {
103 double nh3_uptake;
104 double nh4_uptake;
105 double no3_uptake;
106 double don_uptake;
107
108 double nh4_throughfall;
109 double no3_throughfall;
110
111 double don_leach;
112 double no3_leach;
113 double nh4_leach;
114
115 double ch4_emis;
116 double co2_emis_auto;
117 double co2_emis_hetero;
118 double no_emis;
119 double n2o_emis;
120 double n2_emis;
121 double nh3_emis;
122
123 double n2_fix_algae;
124 double n2_fix_bio;
125 double n2_fix_plant;
126
127 double irrigation;
128 double transpiration;
129 double wateruptake;
130 double interceptionevaporation;
131 double soilevaporation;
132 double surfacewaterevaporation;
133 double runoff;
134 double percolation;
135 };
136 output_ggcmi_seasonal_acc_t acc_seas;
137
138 void reset_seasonal_outputs();
139 void update_seasonal_outputs();
140
141
142 int plant_flag;
143 int dplant_flag;
144 int planting_year;
145 int planting_yearday;
146 int anthesis_yearday;
147 int harvest_yearday;
148
149 double dvs_val;
150 double gdd_val;
151
152};
153} /*namespace ldndc*/
154
155
156#undef LMOD_OUTPUT_MODULE_BASE
157#undef LMOD_OUTPUT_MODULE_NAME
158#undef LMOD_OUTPUT_MODULE_ID
159#undef LMOD_OUTPUT_MODULE_DESC
160
161
162#endif /* !LM_OUTPUT_SOILCHEMISTRY_DAILY_H_ */
Spatially explicit groundwater model.
Definition: airchemistryput.h:15