LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
ld_enhanced_efficiency_nitrogen_fertilizers.h
1/*
2 * SPDX-FileCopyrightText: Karlsruhe Institute of Technology (KIT)
3 * SPDX-License-Identifier: LicenseRef-LandscapeDNDC
4 * This file is part of LandscapeDNDC. See LICENSE.
5 */
14
15#ifndef LD_ENHANCEDEFFICIENCYNITROGENFERTILIZERS_H_
16#define LD_ENHANCEDEFFICIENCYNITROGENFERTILIZERS_H_
17
18#include "ldndc.h"
19#include "state/mbe_state.h"
20#include <string>
21
22namespace ldndc {
23
24class LDNDC_API ControlledReleaseNitrogenFertilizer
25{
26 static const double T_REF;
27
28public:
29 ControlledReleaseNitrogenFertilizer( double /* controlled release q10 */,
30 double /* controlled release lag period */,
31 double /* controlled release t80 */,
32 double /* controlled release wfps factor */);
33 ~ControlledReleaseNitrogenFertilizer();
34
35 /**********************/
36 /* controlled release */
37 /**********************/
38
39 double const EEF_CONTROLLED_RELEASE_Q10;
40 double const EEF_CONTROLLED_RELEASE_LAG_PERIOD;
41 double const EEF_CONTROLLED_RELEASE_T80;
42 double const EEF_CONTROLLED_RELEASE_WFPS_FACTOR;
43
44 struct crnf_fertilizer
45 {
46 crnf_fertilizer( double /* amount */);
47 ~crnf_fertilizer();
48
49 double n_crnf;
50 double n_crnf_start;
51
52 //
53 double t_eff_crnf;
54 };
55
56 std::vector< crnf_fertilizer > crnf;
57
58public:
59 lerr_t
60 add_crnf( double /* amount */);
61
62 lerr_t
63 update_crnf( double /* water filled pore space */,
64 double /* temperature */,
65 double /* scaling due to time resolution */,
66 double /* scaling due to vertical distribution */);
67
68 double
69 get_crnf_teff_mean();
70
71 double
72 get_crnf_release( double /* amount */);
73
74 double
75 get_crnf_release_fraction( double);
76
77 double
78 get_crnf_release_fraction_mean();
79
81 double
82 get_crnf_sum() const;
83
87 lerr_t
88 release_coated_nh4( lvector_t< double > & /* coated N surface water */,
89 lvector_t< double > & /* NH4 surface water */,
90 size_t /* number of surface water layers */,
91 lvector_t< double > & /* coated N soil */,
92 lvector_t< double > & /* NH4 soil */,
93 size_t /* number of soil layers */,
94 lvector_t< double > const & /* soil water content */,
95 lvector_t< double > const & /* porosity */,
96 lvector_t< double > const & /* soil temperature */,
97 double /* scaling due to time resolution */);
98
99};
100
101
107class LDNDC_API NitrogenTransformationInhibitors
108{
109public:
110 enum { NI_DCD = 0, NI_DMPP = 1, NI_NITRAPYRIN = 2, NI_TYPE_CNT = 3 };
111 struct parameters_t
112 {
113 double ni_max; /* maximum reduction of nitrification [-] */
114 double ni_q10; /* temperature coefficient of the decay [-] */
115 double ni_halflife[NI_TYPE_CNT]; /* half-life at 20 oC [d] */
116 double ni_kmm[NI_TYPE_CNT]; /* half-saturation concentration [kg m-3] */
117 double ni_dose[NI_TYPE_CNT]; /* default dose [kg (kg fertilizer N)-1] */
118 double ui_max;
119 double ui_q10;
120 double ui_halflife;
121 double ui_kmm;
122 double ui_dose;
123 };
124
125 NitrogenTransformationInhibitors( parameters_t const &);
126
128 static int ni_type_index( std::string const &);
130 lerr_t set_ni_type( std::string const &);
131 int ni_type() const { return ni_type_; }
133 static int ui_type_index( std::string const &);
134
136 double default_ni_dose( int _ni_type) const { return p_.ni_dose[_ni_type]; }
137 double default_ui_dose() const { return p_.ui_dose; }
138
139 double decay_factor_ni( double /* temperature [oC] */, double /* time step [d] */) const;
140 double decay_factor_ui( double /* temperature [oC] */, double /* time step [d] */) const;
141
143 double nitrification_inhibition( double /* ni */, double /* h */) const;
144 double urease_inhibition( double /* ui */, double /* h */) const;
145
147 void decay( double & /* ni */, double & /* ui */, double /* h */, double /* temperature */, double /* time step [d] */) const;
148
149private:
150 parameters_t const p_;
151 int ni_type_;
152};
153
154}
155
156#endif /* !LD_ENHANCEDEFFICIENCYNITROGENFERTILIZERS_H_ */
157
lerr_t set_ni_type(std::string const &)
Definition ld_enhanced_efficiency_nitrogen_fertilizers.cpp:307
static int ni_type_index(std::string const &)
Definition ld_enhanced_efficiency_nitrogen_fertilizers.cpp:285
static int ui_type_index(std::string const &)
Definition ld_enhanced_efficiency_nitrogen_fertilizers.cpp:297
double default_ni_dose(int _ni_type) const
Definition ld_enhanced_efficiency_nitrogen_fertilizers.h:136
Spatially explicit groundwater model.
Definition airchemistryput.h:21