LandscapeDNDC 1.37.0
soilchemistry-deconit.h
1
2
3#ifndef LM_SOILCHEMISTRY_DECONIT_H_
4#define LM_SOILCHEMISTRY_DECONIT_H_
5
6#include "mbe_legacymodel.h"
7#include "state/mbe_state.h"
8
9#include "eventhandler/fertilize/fertilize.h"
10#include "eventhandler/till/till.h"
11
12#include <input/event/events.h>
13
14namespace ldndc {
15
16class LDNDC_API SoilChemistryDECONIT : public MBE_LegacyModel
17{
18 LMOD_EXPORT_MODULE_INFO(SoilChemistryDECONIT,"soilchemistry:deconit","Soilchemistry DECONIT");
19 public:
20 SoilChemistryDECONIT(
21 MoBiLE_State *,
22 cbm::io_kcomm_t *,
23 timemode_e);
24
25 ~SoilChemistryDECONIT();
26
27 lerr_t configure( ldndc::config_file_t const *);
28
29 lerr_t register_ports( cbm::io_kcomm_t *);
30 lerr_t initialize();
31
32 lerr_t solve();
33
34 lerr_t unregister_ports( cbm::io_kcomm_t *);
35 lerr_t finalize() { return LDNDC_ERR_OK; }
36
37 lerr_t sleep() { return LDNDC_ERR_OK; }
38 lerr_t wake() { return LDNDC_ERR_OK; }
39
40 private:
41 input_class_siteparameters_t const & sipar_;
42 input_class_soillayers_t const & sl_;
43
44 substate_surfacebulk_t & sb_;
45 substate_airchemistry_t & ac_;
46 substate_microclimate_t & mc_;
47 substate_physiology_t & ph_;
48 substate_soilchemistry_t & sc_;
49 substate_watercycle_t & wc_;
50
51 MoBiLE_PlantVegetation * m_veg;
52
53 timemode_e const timemode_;
54
55 EventHandlerFertilize m_eventfertilize;
56
57 EventQueue m_TillEvents;
58 CBM_Handle m_TillHandle;
59
60 lvector_t< double > addC_lit1_Frt_sl;
61 lvector_t< double > addC_lit2_Frt_sl;
62 lvector_t< double > addC_lit3_Frt_sl;
63
64 lvector_t< double > addC_lit1_Fol_sl;
65 lvector_t< double > addC_lit2_Fol_sl;
66 lvector_t< double > addC_lit3_Fol_sl;
67
68 lvector_t< double > fact_m;
69 lvector_t< double > fact_t;
70 lvector_t< double > fact_tm;
71
72 lvector_t< double > fact_carbonQuality;
73
74 lvector_t< double > fdeniFROST_sl;
75 lvector_t< double > fdeni;
76 lvector_t< double > sumHeterotrophs;
77
78 lvector_t< double > const &mc_temp_sl;
79
80 double *waterflux_sl;
81 double *accumulated_waterflux_old_sl;
82
83 double tot_c_balance_1;
84 double tot_n_balance_1;
85
86 double K_LITTER_TYPE; // Decomposition reduction factor for coniferous. [-]
87 double ts_scale;
88
89 double DECONIT_Fact_T(size_t);
90 double DECONIT_Fact_M(size_t);
91
92 double DECONIT_afgen(
93 const double ,
94 const double ,
95 const double ,
96 const double );
97
98
99 void DECONIT_GasSpecDiffusion(
100 const int sl, // Soil layer counter (-)
101 double &chem_sl, // Concentration in the current soil layer (kgNm-2)
102 double &chem_last_sl); // Concentration in a deeper soil layer (kgNm-2)
103
104 lerr_t DECONIT_step_init();
105
106 void DECONIT_AnaerobicVolumeFraction();
107
108 void DECONIT_EmpiricalAnaerobicVolumeFraction();
109
110 lerr_t DECONIT_fertilize();
111 lerr_t DECONIT_manure();
112 lerr_t DECONIT_till();
113 lerr_t DECONIT_urea_hydrolysis();
114
115 void DECONIT_ArahVintenAnaerobicVolumeFraction();
116
117 void DECONIT_DenitrifierFraction();
118
119 void DECONIT_MicrobialGrowth();
120
121 void DECONIT_Denitrification();
122
123 void DECONIT_UpwardDiffusion();
124
125 void DECONIT_Leaching();
126
127 void DECONIT_MicrobialDecay();
128
129 void DECONIT_Chemodenitrification();
130
131 void DECONIT_CalcRootResp();
132
133 void DECONIT_AllocLitter();
134
135 void DECONIT_Decomposition();
136
137 void DECONIT_Fragmentation();
138
139 void DECONIT_UpdateTempMoist();
140
141 double DECONIT_get_wfps(
142 size_t /* soil layer */);
143
147 lerr_t
148 DECONIT_balance_check(
149 unsigned int);
150
154 double
155 DECONIT_get_c_tot();
156
160 double
161 DECONIT_get_n_tot();
162
163 lerr_t DECONIT_CHECK_FOR_NEGATIVE_VALUE(
164 char const * /* position */);
165};
166
167} /*namespace ldndc*/
168
169#endif /* LM_SOILCHEMISTRY_DECONIT_H_ */
170
Spatially explicit groundwater model.
Definition: airchemistryput.h:15