LandscapeDNDC 1.37.0
cmfcolumn-config.h
1
2#ifndef LM_CMFCOLUMN_CONFIG_H_
3#define LM_CMFCOLUMN_CONFIG_H_
4
5#include <string/cbm_string.h>
6#include <features/cmf-config.h>
7
8//#define CMFCOLUMN_HAVE_LATERAL
9
10/* if set, flux_sl is set to 0 to suppress
11 * solute transport by LDNDC even if we
12 * have no CMF solutes. if CMF solutes are
13 * given, flux_sl is 0 by definition.
14 */
15//#define CMFCOLUMN_HAVE_FLUX
16
17/* if set, use the concept of integratables
18 * to get fluxes between nodes
19 */
20#define CMFCOLUMN_HAVE_INTEGRATABLES
21#ifdef CMFCOLUMN_HAVE_INTEGRATABLES
22# include "watercycle/cmfcolumn/cmfcolumn-fluxes.h"
23#endif
24
25/* select available solute transport mechanisms */
26#define CMFCOLUMN_HAVE_TRANSPORT_NONE
27//#define CMFCOLUMN_HAVE_TRANSPORT_WATERFLUX
28#define CMFCOLUMN_HAVE_TRANSPORT_COUPLED
29
30/* if set, consider transport of solutes
31 * on via surface flow (bulk)
32 */
33//#define CMFCOLUMN_HAVE_SURFACETRANSPORT
34
35/* if set, attempt to check balance for
36 * solutes
37 */
38//#define CMFCOLUMN_HAVE_SOLUTEBALANCES
39
40/* if set, store lateral discharge of solutes
41 * and water in scratch for output
42 *
43 * NOTE
44 * this destroys the stream discharge of
45 * the actual outlet connection
46 */
47//#define CMFCOLUMN_HAVE_NEIGHBORSDISCHARGE
48//#define CMFCOLUMN_HAVE_NEIGHBORSDISCHARGE_FILTER
49#ifdef CMFCOLUMN_HAVE_NEIGHBORSDISCHARGE_FILTER
50/* select a filter (hacky) */
51# define CMFCOLUMN_HAVE_NEIGHBORSDISCHARGE_FILTER_GRID
52#endif
53
54#define CMFCOLUMN_dailythroughfall "a"
55#define CMFCOLUMN_dailyrainfall "b"
56#define CMFCOLUMN_dailyinfiltration "c"
57#define CMFCOLUMN_dailyexfiltration "d"
58#define CMFCOLUMN_dailyevaporation "e"
59#define CMFCOLUMN_dailytranspiration "f"
60#define CMFCOLUMN_dailycanopyevaporation "g"
61#define CMFCOLUMN_dailysurfacewaterevaporation "h"
62#define CMFCOLUMN_dailysoilevaporation "i"
63#define CMFCOLUMN_dailysurfacesnowevaporation "j"
64#define CMFCOLUMN_dailystreamdischarge "k"
65#define CMFCOLUMN_dailygroundwaterdischarge "l"
66#define CMFCOLUMN_dailyrunoff "m"
67
68struct CMFConfig
69{
70 CMFConfig() :
71 solutes_names( ""), first_layer_connected( 0)
72 {
73 this->comp.models = cmf_config::models::UNKNOWN;
74
75 this->flags.have_streamdischarge = 0;
76 this->flags.have_groundwaterdischarge = 0;
77 this->flags.have_outlets = 0;
78 this->flags.have_snow = 0;
79 this->flags.have_ice = 0;
80 this->flags.have_infiltration = 0;
81 this->flags.have_canopy = 0;
82 this->flags.have_evapotranspiration = 0;
83 this->flags.have_surfacewaterevaporation = 0;
84 this->flags.have_soilevaporation = 0;
85 this->flags.have_snowevaporation = 0;
86 this->flags.have_surfacerunoff = 0;
87 this->flags.have_rainthroughfall = 0;
88 this->flags.have_canopythroughfall = 0;
89 this->flags.have_lateral = 0;
90
91#ifdef CMFCOLUMN_HAVE_INTEGRATABLES
92 this->flags.have_integratables = 1;
93#else
94 this->flags.have_integratables = 0;
95#endif
96 this->flags.bad = 0;
97
98 }
99 union cmf_model_configuration
100 {
101 struct
102 {
103 cmf_config::watertransport::model_e watertransport;
104 cmf_config::solutestransport::model_e solutestransport;
105 cmf_config::infiltration::model_e infiltration;
106 cmf_config::surfacerunoff::model_e surfacerunoff;
107 cmf_config::evapotranspiration::model_e evapotranspiration;
108 } model;
109 unsigned int models;
110 } comp;
111
112 cbm::string_t solutes_names;
113
114 size_t first_layer_connected;
115
116 struct runoff_t
117 {
118 double puddle_depth;
119 } runoff;
120 struct streamdischarge_t
121 {
122 double upper, lower;
123 double flowwidth;
124 double potential;
125 } m_streamdischarge;
126 struct groundwaterdischarge_t
127 {
128 double potential;
129 } m_groundwaterdischarge;
130 struct
131 {
132 bool have_streamdischarge:1;
133 bool have_groundwaterdischarge:1;
134 bool have_outlets:1;
135 bool have_snow:1;
136 bool have_ice:1;
137 bool have_infiltration:1;
138 bool have_canopy:1;
139 bool have_evapotranspiration:1;
140 bool have_surfacewaterevaporation:1;
141 bool have_soilevaporation:1;
142 bool have_snowevaporation:1;
143 bool have_surfacerunoff:1;
144 bool have_rainthroughfall:1;
145 bool have_canopythroughfall:1;
146 bool have_lateral:1;
147 bool have_integratables:1;
148
149 bool bad:1;
150 } flags;
151};
152
153namespace cmf
154{
155 class project;
156 namespace atmosphere
157 {
158 class ConstantRainSource;
159 }
160 namespace math
161 {
162 class Integrator;
163 }
164 namespace upslope
165 {
166 class Cell;
167 namespace ET
168 {
169 class ShuttleworthWallace;
170 }
171 }
172 namespace water
173 {
174 class flux_connection;
175 class flux_node;
176 class DirichletBoundary;
177 }
178}
179
180#ifdef CMFCOLUMN_HAVE_LATERAL
181# include <kernel/kcomm.h>
182#endif
183
184struct CMFObjects
185{
186 CMFObjects() :
187 project( NULL), cell( NULL), rainsource( NULL),
188 et( NULL), integrator( NULL),
189 groundwater( NULL), stream( NULL), surfacerunoff( NULL)
190 { }
191
192 cmf::project * project;
193#ifdef LDNDC_MPI
194 std::shared_ptr< cmf::upslope::Cell > cell;
195#else
196 cmf::upslope::Cell * cell;
197#endif
198
199 std::shared_ptr< cmf::atmosphere::ConstantRainSource > rainsource;
200 std::shared_ptr< cmf::upslope::ET::ShuttleworthWallace > et;
201
202 cmf::math::Integrator * integrator;
203
204 std::shared_ptr< cmf::water::DirichletBoundary > groundwater;
205 std::shared_ptr< cmf::water::DirichletBoundary > stream;
206 std::shared_ptr< cmf::water::flux_connection > surfacerunoff;
207
208#ifdef CMFCOLUMN_HAVE_LATERAL
209 lcomponent_t projectowner;
210#endif
211};
212
213
214#endif /* !LM_CMFCOLUMN_CONFIG_H_ */