LandscapeDNDC 1.37.0
output-soilchemistry-yearly.h
1
10#ifndef LM_OUTPUT_SOILCHEMISTRY_YEARLY_H_NEW_
11#define LM_OUTPUT_SOILCHEMISTRY_YEARLY_H_NEW_
12
13#include "mbe_legacyoutputmodel.h"
14#include "state/mbe_state.h"
15
16#define LMOD_OUTPUT_MODULE_BASE MBE_LegacyOutputModel
17#define LMOD_OUTPUT_MODULE_NAME OutputSoilchemistryYearly
18#define LMOD_OUTPUT_MODULE_ID "output:soilchemistry:yearly"
19#define LMOD_OUTPUT_MODULE_DESC "Soil Chemistry Yearly Output"
20namespace ldndc {
21class substate_physiology_t;
22class LDNDC_API LMOD_OUTPUT_MODULE_NAME : public LMOD_OUTPUT_MODULE_BASE
23{
24 LMOD_EXPORT_MODULE_INFO(LMOD_OUTPUT_MODULE_NAME,LMOD_OUTPUT_MODULE_ID,LMOD_OUTPUT_MODULE_DESC);
25 public:
26 LMOD_OUTPUT_MODULE_NAME(
27 MoBiLE_State *,
28 cbm::io_kcomm_t *,
29 timemode_e _timemode);
30
31 ~LMOD_OUTPUT_MODULE_NAME();
32
33
34 lerr_t configure( ldndc::config_file_t const *);
35
36 lerr_t initialize();
37
38 lerr_t solve();
39
40 lerr_t finalize();
41
42 lerr_t wake() { return LDNDC_ERR_OK; }
43 lerr_t sleep() { return LDNDC_ERR_OK; }
44
45 private:
46 lerr_t dump_0(
47 ldndc_flt64_t *);
48
49 private:
50 cbm::io_kcomm_t * io_kcomm;
51
52 input_class_soillayers_t const * soillayers_in;
53
54 substate_physiology_t const * phys;
55 substate_soilchemistry_t const * soilchem;
56
57 private:
58 ldndc::sink_handle_t m_sink;
59
60 double c_soil_old;
61 double n_soil_old;
62
63 struct output_soilchemistry_yearly_acc_t
64 {
65 double nh4_throughfall;
66 double no3_throughfall;
67
68 double doc_leach;
69 double ch4_leach;
70
71 double don_leach;
72 double no3_leach;
73 double nh4_leach;
74
75 double ch4_emis;
76 double co2_emis_auto;
77 double co2_emis_hetero;
78
79 double no_emis;
80 double n2o_emis;
81 double n2_emis;
82 double nh3_emis;
83
84 double c_fix_algae;
85 double n_fix_algae;
86 double n_fix_bio;
87
88 double c_fertilizer;
89 double n_fertilizer;
90
91 double c_litter_above;
92 double n_litter_above;
93 double c_litter_below;
94 double n_litter_below;
95
96 double MIN;
97 double NIT;
98 double CHE;
99 double DENIT;
100
101 double n_uptake;
102
103 double radon_emis;
104 };
105 output_soilchemistry_yearly_acc_t acc;
106 void pop_accumulated_outputs();
107 void push_accumulated_outputs();
108};
109} /*namespace ldndc*/
110
111
112#undef LMOD_OUTPUT_MODULE_BASE
113#undef LMOD_OUTPUT_MODULE_NAME
114#undef LMOD_OUTPUT_MODULE_ID
115#undef LMOD_OUTPUT_MODULE_DESC
116
117
118#endif /* !LM_OUTPUT_SOILCHEMISTRY_YEARLY_H_NEW_ */
119
Spatially explicit groundwater model.
Definition: airchemistryput.h:15