LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
ld_oryza2000_state.h
1
8
9#ifndef ORYZA2000_STATE_H_
10#define ORYZA2000_STATE_H_
11
12#include "ld_kernel.h"
13#include "oryza2000/ld_oryza2000_table.h"
14#include "physiology/photofarquhar/berryball.h"
15
16#include <containers/cbm_vector.h>
17#include <input/soillayers/soillayers.h>
18
19
20namespace ldndc {
21
22class LDNDC_API Oryza2000State
23{
24public:
25
26 Oryza2000State(
27 cbm::io_kcomm_t *,
28 double,
29 size_t);
30
31 ~Oryza2000State();
32
33 lerr_t initialize( cbm::io_kcomm_t *);
34
35#ifdef _HAVE_SERIALIZE
36public:
37 int create_checkpoint( cbm::io_kcomm_t *)
38 { return -1; }
39 int restore_checkpoint( cbm::io_kcomm_t *, ldate_t const *)
40 { return -1; }
41#endif
42#ifdef _LDNDC_HAVE_ONLINECONTROL
43public:
44 int process_request( lreply_t * /*reply*/,
45 lrequest_t const * /*request*/)
46 { return -1; }
47#endif
48
49private:
50
51
52
53
54 void reset();
55
56
57private:
58 /* hide or implement */
59 Oryza2000State( Oryza2000State const &);
60 Oryza2000State & operator=( Oryza2000State const &);
61
62
63public:
64
70 lerr_t
71 Oryza_check_for_negative_value(
72 size_t /* id */,
73 char const * /*name*/);
74
75#define SWISLA_SIZE 40
76 char * swisla; //Switch to select method of imposed SLA calculation
77
78 /* state variables */
79
80 double wlvg; //Dry weight of green leaves (ka ha-1)
81 double wlvd; //Dry weight of dead leaves (ka ha-1)
82 double wsts; //Dry weight of structural stems (ka ha-1)
83 double wstr; //Dry weight of stem reserves (ka ha-1)
84
85 double wso; //Dry weight of storage organs (ka ha-1)
86 double wrt; //Dry weight of roots (kg ha-1)
87 double wst; //Dry weight of stems (kg ha-1)
88 double wlv; //Dry weight of leaves (kg ha-1)
89
90 double wag; //Total aboveground green dry matter (kg DM ha-1)
91 double wagt; //Total aboveground dry matter (kg DM ha-1)
92 double tdrw; //Total aboveground and belowground dry biomass (kg ha-1)
93 double wrr; //Dry weight of rough rice (final yield) (kg ha-1)
94
95 double pwrr; //Potential weight of rough rice (kg ha-1)
96
97 double ngr; //Number of grains (no. ha-1)
98 double ngrm2; //Number of grains (no. m-2)
99 double nsp; //Number of spikelets (no. ha-1)
100 double nspm2; //Number of spikelets (no. m-2)
101
102 size_t dae; //Days after emergence (d)
103 size_t sbdur; //Seedbed duration (d)
104
105 double tslv; //Temperature sum for leaf area development (oC)
106 double tnass; //Total net CO2 assimilation (kg CO2 ha−1)
107
108 double lai; //Leaf area index (m2 m-2)
109
110 double tshckd; //Transplanting shock for phenol. development (oCd)
111 double tshckl; //Transplanting shock for leaf area development (oCd)
112
113 double hu; //Daily heat units effective for phenological development (oC d-1)
114 double hulv; //Daily heat units effective for leaf area development (oC d-1)
115
116 double ncold; //Number of cold days (-)
117 double zrt; //Root length or rooting deth (m)
118
119 double dldr; //Death rate of leaves caused by drought (kg DM ha−1 d−1)
120 double dldrt; //Total death rate of leaves caused by drought (kg DM ha−1 d−1)
121
122 double keep; //Variable to temporarily store value of LDSTRS (-)
123
124 bool dleaf; //Control variable for start of leaf senescence by drought (kg DM ha−1 d−1)
125 bool drout; //Control variable indicating drought/no drought (-)
126 bool grains; //Logical parameter indicating whether grains are formed (-)
127
128 /* state variables read from input on demand */
129
130 double lape; //Leaf area per plant at emergence (m-2 pl-1)
131 double dvsi; //Initial value of development stage of crop ()
132 double wlvgi; //Initial dry weight of leaves (kg ha-1)
133 double wlvgit; //Temporary storage variable of WLVG
134 double wrti; //Initial dry weight of roots (kg ha-1)
135 double wsoi; //Initial dry weight of storage organs (kg ha-1)
136 double wsti; //Initial dry weight of stems (kg ha-1)
137 double zrti; //Initial root length/depth at emergence (m)
138 double zrttr; //Root length/depth at transplanting (m)
139
140 /* crop parameters */
141
142 int idoy; //Time of simulation (d)
143 double time; //Time of simulation (d)
144 double tblv; //Base temperature for juvenile leaf area growth (oC)
145
146 double dvs; //development stage of the crop (-)
147 double dvr; //development rate of the crop (d-1)
148 double dvrj; //development rate juvenile ((oCd)-1)
149 double dvri; //development rate, photoperiod-sensitive phase ((oCd)-1)
150 double dvrp; //development rate, PI phase ((oCd)-1)
151 double dvrr; //development rate, reproductive phase ((oCd)-1)
152
153
154 double mopp; //maximum optimum photoperiod (h)
155 double ppse; //photoperiod sensitivity (h-1)
156
157 double shckd; //delay parameter in phenology ((oCd)(oCd)-1)
158
159 int cropsta; //crop stage (-): 0=before sowing; 1=sowing; 2=seedbed; 3=transplanting; 4=main growth period
160
161 OryzaTable flvtb;
162 OryzaTable slatb;
163
164 double ts; //temperature sum (oCd)
165
166 double ldstrs; //leaf death stress factor (-)
167 double lestrs; //leaf expansion stress factor (-)
168 double lrstrs; //leaf rolling stress factor (-)
169
170 double nh; //number of hills
171 double nplsb; //number of plants in seedbed
172 double nplds; //number of plants direct-seeded in main field
173
174 /* climate */
175 double tmax; //maximum daily temperature
176 double tmin; //minimum daily temperature
177 double tav; //average daily temperature
178
179 double tbd; //Base temperature for development [oC]
180 double tod; //Optimum temperature for development [oC]
181 double tmd; //Mean daily temperature [oC]
182
183 double coldmin; //lower temperature threshold for growth
184
185 double nflvi; //Initial nitrogen fraction in the leaves (g N m-2 leaf)
186 double nflv; //nitrogen fraction in the leaves (g N m-2 leaf)
187 double knf; //extinction coefficient of nitrogen profile in canopy
188 double redft;
189
190 OryzaTable nminsottb; //Table of minimum N fraction in storage organs as function of N in crop till flowering
191
192 OryzaTable nmaxlttb;
193
194 OryzaTable nminlttb;
195
196 OryzaTable nsllvttb;
197
198 double frpar; //fraction of total shortwave irradiation that is photosynthetically active (-)
199 double cslv; //scattering coefficient of leaves for PAR
200
201 double ecpdf;
202 double gai; //green area index (ha leaf-1 ha-1 ground)
203
204 double co2;
205 double co2ref;
206
207 OryzaTable efftb;
208 OryzaTable ssgatb;
209 OryzaTable kdftb;
210 OryzaTable redftt;
211 OryzaTable knftb; //KNF (extinction coefficient of N profile in canopy) as function of development stage (DVS)
212
213
214 OryzaTable nflvtb;
215 OryzaTable fshtb;
216 OryzaTable drlvt;
217
218 double scp; //scattering coefficient of leaves for photosynthetically active radiation (-)
219 double dpar;
220
221 double dtr; //daily total global radiation (J m-2 d-1)
222
223 double alai;
224 double sai;
225
226 double ts_dtga;
227 double d_dtga; //daily total gross CO2 assimilation of crop (kg CO2 ha-1 d-1)
228 double c_root_turnover;
229 double c_root_exsudation;
230
231 double rnstrs; //reduction factor on relative leaf growth rate caused by N stress (-)
232 double pcew; //effect of drought stress on daily gpp; reduction in potential transpiration rate
233 double cpew;
234
235 double frt; //fraction of total dry matter allocated to roots
236 double fsh; //fraction of total dry matter allocated to shoots
237 OryzaTable fhstb;
238
239
240 double flv; //fraction of shoot dry matter allocated to leaves
241 double fst; //fration of shoot dry matter allocated to stems
242 OryzaTable fsttb;
243 double fso; //fration of shoot dry matter allocated to storage organs
244 OryzaTable fsotb;
245
246 double ggr;
247
248 double llv; //loss rate of leaf weight (kg DM ha-1 d-1)
249 double nsllv; //nitrogen stress factor that accelerates leaf death (-)
250
251 double lstr; //loss rate of stem reserves (kg DM ha−1 d−1)
252 double tclstr; //time coefficient for loss of stem reserves (d-1)
253
254 double q10;
255 double tref;
256 double mainlv; //Maintenance respiration coefficient of leaves (kg CH2O kg−1 DM d−1)
257 double mainst; //Maintenance respiration coefficient of stems (kg CH2O kg−1 DM d−1)
258 double mainso; //Maintenance respiration coefficient of stems (kg CH2O kg−1 DM d−1)
259 double mainrt; //Maintenance respiration coefficient of stems (kg CH2O kg−1 DM d−1)
260 double teff;
261 double mndvs;
262
263 double fstr;
264
265 double crglv; //Carbohydrate requirement for leaf dry matter production (kg CH2O kg−1 DM)
266 double crgst; //Carbohydrate requirement for stem dry matter production (kg CH2O kg−1 DM)
267 double crgstr; //Carbohydrate requirement for stem reserves production (kg CH2O kg−1 DM)
268 double crgso; //Carbohydrate requirement for storage organ dry matter production (kg CH2O kg−1 DM)
269 double crgrt; //carbohydrate requirement for root dry matter production (kg CH2O kg−1 DM)
270
271 double lrstr; //fraction of allocated stem reserves that is available for growth (-)
272 double fcstr; //mass fraction of carbon in stem reserves (kg C kg−1 DM)
273 double ngcr; //net growth rate of crop, including translocation (kg ha−1 d−1)
274
275 double plant_count; //number of plants (-)
276
277 double grt; //growth rate of roots (kg ha-1 d-1)
278 double glv; //growth rate of leaves (kg ha-1 d-1)
279
280 double rwlvg; //growth rate of green leaves (kg ha-1 d-1)
281 double gst;
282 double gstr;
283 double rwstr;
284 double gso; //growth rate of storage organs (kg DM ha-1 d-1)
285
286 double sf2;
287 double sf1;
288 double spgf; //Spikelet growth factor (no. kg-1)
289
290
291 double gnsp; //Rate of increase in spikelet number (no. ha-1 d-1)
292 double gngr; //Rate of increase in grain number (no. ha-1 d-1)
293
294 double sla; //Specific leaf area (ha leaf kg−1 leaf)
295 double asla;
296 double bsla;
297 double csla;
298 double dsla;
299
300 double slamax;
301
302 double rgrlmx;
303 double rgrlmn;
304
305 double shckl;
306
307 double glai; //growth rate of leaf area index (ha ha-1 d-1)
308 double rgrl; //Relative growth rate for leaf development
309
310 double coldtt;
311
312 double co2rt; //CO2 production factor for growth of roots (kg CO2 kg-1 DM-1)
313 double co2so; //CO2 production factor for growth of storage organs (kg CO2 kg-1 DM-1)
314 double co2st; //CO2 production factor for growth of stems (kg CO2 kg-1 DM-1)
315 double co2str; //CO2 production factor for growth of stem reserves (kg CO2 kg-1 DM-1)
316
317 double co2lv;
318
319 double coldead;
320
321 double ctrans; //carbon losses at transplanting (kg C ha-1)
322 double fcso;
323 double fclv; //mass fraction of carbon in leaves (kg C kg-1 DM-1)
324 double fcst; //mass fraction of carbon in stems (kg C kg-1 DM-1)
325 double fcrt; //mass fraction of carbon in roots (kg C kg-1 DM-1)
326 double gzrt;
327 double gcr; //gross growth rate of crop (kg DM ha-1 d-1)
328 double ntfert;
329
330 double rgcr_rt; //growth respiration rate of roots (kg CO2 ha-1 d-1)
331 double rgcr; //growth respiration rate of crop (kg CO2 ha-1 d-1)
332 double rmcr_rt; //maintenance respiration rate of roots (kg CH2O ha-1 d-1)
333 double rmcr_lv; //maintenance respiration rate of leaves (kg CH2O ha-1 d-1)
334 double rmcr_so; //maintenance respiration rate of storage organs (kg CH2O ha-1 d-1)
335 double rmcr_st; //maintenance respiration rate of stem (kg CH2O ha-1 d-1)
336
337 //total maintenance respiration rate of crop (kg CH2O ha-1 d-1)
338 double rmcr() const { return rmcr_lv + rmcr_rt + rmcr_so + rmcr_st; };
339
340 double ulls; //Upper limit leaf rolling (kPa)
341 double llls; //Lower limit leaf rolling (kPa)
342 double uldl; //Upper limit death of leaves (kPa)
343 double lldl; //Lower limit death of leaves (kPa)
344 double ulle; //Upper limit leaf expansion (kPa)
345 double llle; //Lower limit leaf expansion (kPa)
346 double ulrt; //Upper limit relative transpiration reduction (kPa)
347 double llrt; //Lower limit relative transpiration reduction (kPa)
348
349 double nmaxup; //Maximum daily N uptake (kg N ha-1 d-1)
350 double rfnlv; //Residual N fraction of leaves (kg N kg-1 leaves)
351 double fntrt; //Fraction N translocation from roots, as (additonal) fraction of total N translocation from stems and leaves (-)
352 double rfnst; //Residual N fraction of stems (kg N kg-1 stems)
353 double tcntrf; //Time coefficient for N translocation to grains (d)
354
355 double fnlvi; //Initial leaf N fraction (on weight basis: kg N kg-1 leaf)
356
357 double nmaxso; //Maximum N concentration in storage organs (kg N kg-1)
358
359 double pltr;
360 double rtnass; //Net rate of total CO2 assimilation by crop (kg CO2 ha-1 d-1)
361
362 double tfert;
363 double tklt; //Thickness of combined soil layers (m)
364 double wgrmx; //Maximum individual grain weight (kg grain-1)
365 double zrtmcw;
366 double zrtm; //Maximum root length/depth (m)
367 double zrtmcd; //Maximum root length/depth as crop characteristic under drought (m)
368 double zrtms; //Maximum depth that roots can penetrate into soil (m)
369
370 soillayers::input_class_soillayers_t const & sl_;
371
372 lvector_t< double > tkl_sl;
373 lvector_t< double > mskpa_sl;
374 lvector_t< double > trr_sl;
375 lvector_t< double > trwl_sl;
376 lvector_t< double > wc_sl;
377 lvector_t< double > poro_sl;
378 lvector_t< double > wcwp_sl;
379
380 BerryBall m_photo;
381
382 double surface_water;
383 double potentialevapotranspiration;
384 double potentialtranspiration;
385 double potentialevaporation;
386
387 double *vcAct25_fl;
388 double *jAct25_fl;
389 double *rdAct25_fl;
390 double *sla_fl;
391
392 double *vpd_fl;
393 double *rh_fl;
394 double *temp_fl;
395 double *parsun_fl;
396 double *parshd_fl;
397 double *tFol_fl;
398 double *co2_concentration_fl;
399 double *sunlitfoliagefraction_fl;
400 double *carbonuptake_fl;
401
402 size_t nb_foliagelayers;
403 double airpressure;
404
405 double f_h2o;
406 double f_fac;
407 double mFol;
408 double height_max;
409
410 double CWP_REF;
411 double PSI_REF;
412 double PSI_EXP;
413 double RPMIN;
414
415 double KC25;
416 double AEKC;
417 double AEVO;
418 double KO25;
419 double AEKO;
420 double AEVC;
421 double QVOVC;
422 double GSMIN;
423 double GSMAX;
424 double SLOPE_GSA;
425 double AERD;
426 double SDJ;
427 double HDJ;
428 double THETA;
429 double AEJM;
430 double QJVC;
431 bool C4_TYPE;
432
433 double TOFRTBAS;
434 double DOC_RESP_RATIO;
435
436public:
437 double inline fFol_fl( size_t ){ return 1.0 / nb_foliagelayers; };
438 double inline lai_fl( size_t _fl){ return this->lai * this->fFol_fl(_fl); };
439};
440
441} /* namespace ldndc */
442
443#endif /* !ORYZA2000_STATE_H_ */
444
Spatially explicit groundwater model.
Definition airchemistryput.h:15