LandscapeDNDC 1.37.0
output-ggcmi-yearly.h
1
9#ifndef LM_OUTPUT_GGCMI_YEARLY_H_NEW_
10#define LM_OUTPUT_GGCMI_YEARLY_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 OutputGgcmiYearly
17#define LMOD_OUTPUT_MODULE_ID "output:ggcmi:yearly"
18#define LMOD_OUTPUT_MODULE_DESC "GGCMI Yearly Output"
19namespace ldndc {
20class substate_physiology_t;
21class substate_watercycle_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 substate_watercycle_t const * water;
57 MoBiLE_PlantVegetation * m_veg;
58
59 private:
60 ldndc::sink_handle_t m_sink;
61
62 struct output_ggcmi_yearly_acc_t
63 {
64 double nh4_throughfall;
65 double no3_throughfall;
66
67 double don_leach;
68 double no3_leach;
69 double nh4_leach;
70
71 double ch4_emis;
72 double co2_emis_auto;
73 double co2_emis_hetero;
74 double no_emis;
75 double n2o_emis;
76 double n2_emis;
77 double nh3_emis;
78 double n2_fix_plant;
79
80 double throughfall;
81 double irrigation;
82 double transpiration;
83 double wateruptake;
84 double interceptionevaporation;
85 double soilevaporation;
86 double surfacewaterevaporation;
87 double runoff;
88 double percolation;
89
90 double n_uptake;
91 double n_exp_harvest;
92 double n_fert;
93 double c_fert;
94
95 double c_litter_above;
96 double c_litter_below;
97 double n_litter_above;
98 double n_litter_below;
99
100 double ch4_leach;
101 double doc_leach;
102
103 double n_fix_algae;
104 double c_fix_algae;
105 double n_fix_bio;
106 };
107 output_ggcmi_yearly_acc_t acc;
108 void pop_accumulated_outputs();
109 void push_accumulated_outputs();
110 void accumulate_daily_outputs();
111 void update_daily_outputs();
112
113};
114} /*namespace ldndc*/
115
116
117#undef LMOD_OUTPUT_MODULE_BASE
118#undef LMOD_OUTPUT_MODULE_NAME
119#undef LMOD_OUTPUT_MODULE_ID
120#undef LMOD_OUTPUT_MODULE_DESC
121
122
123#endif /* !LM_OUTPUT_SOILCHEMISTRY_YEARLY_H_NEW_ */
Spatially explicit groundwater model.
Definition: airchemistryput.h:15