LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
oryza2000.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 LM_ORYZA2000_H_
16#define LM_ORYZA2000_H_
17
18#include "mbe_legacymodel.h"
19#include "state/mbe_state.h"
20#include "ld_shared.h"
21#include "ld_eventqueue.h"
22
23#include <containers/lgrowarray.h>
24
25#include <string>
26
27namespace ldndc {
28 class Oryza2000Engine;
29 class Oryza2000State;
30}
31
32namespace ldndc {
33
34extern cbm::logger_t * PhysiologyOryza2000Logger;
35
37class LDNDC_API PhysiologyOryza2000 : public MBE_LegacyModel
38{
39 LMOD_EXPORT_MODULE_INFO(PhysiologyOryza2000,"physiology:oryza2000","Physiology ORYZA2000");
40 public:
41 PhysiologyOryza2000( MoBiLE_State *,
42 cbm::io_kcomm_t *, timemode_e);
43
44 ~PhysiologyOryza2000();
45
46 lerr_t configure( ldndc::config_file_t const *);
47 lerr_t register_ports( cbm::io_kcomm_t *);
48 lerr_t initialize();
49
50 lerr_t read();
51 lerr_t solve();
52 lerr_t integrate();
53 lerr_t write();
54
55 lerr_t unregister_ports( cbm::io_kcomm_t *);
56 lerr_t finalize();
57
58 lerr_t sleep()
59 { return LDNDC_ERR_OK; }
60 lerr_t wake()
61 { return LDNDC_ERR_OK; }
62
63 private:
64 MoBiLE_State * m_state;
65 cbm::io_kcomm_t * m_iokcomm;
66
67 timemode_e const timemode;
68
69 /* required input classes */
70 input_class_setup_t const * m_setup;
71 input_class_soillayers_t const * m_soillayers;
72 input_class_climate_t const * m_climate;
73
74 /* required state components */
75 substate_microclimate_t * mc;
76 substate_airchemistry_t * ac;
77 substate_watercycle_t * wc;
78 substate_physiology_t * ph;
79 substate_soilchemistry_t * sc;
80
81 MoBiLE_PlantVegetation * m_veg;
82
83 EventQueue m_HarvestEvents;
84 ldndc::EventHandle m_HarvestHandle;
85 EventQueue m_PlantEvents;
86 ldndc::EventHandle m_PlantHandle;
87
88 ldndc::growable_array < BaseRootSystemDNDC*, 1000, 1 > root_system;
89
90 /* ORYZA2000 crop growth engine (former kernel "Oryza2000") */
91 Oryza2000Engine * oryza2000_engine;
92
93 /* port "MaturityStatus" (farmsystem), published only if PlaMox,
94 * which publishes the same port, is not in the module list */
95 PublishedField<double> m_MaturityStatus;
96
97 bool ncrop_potential;
98 bool wcrop_potential;
99 bool farquhar;
100 bool root_turnover;
101
102 /* option "dvsfraction": dvsFlush = ORYZA dvs/2 in [0,1] (as other
103 * physiology modules and event time windows), default since
104 * 2026-11-13; "no" (legacy): dvsFlush = ORYZA dvs in [0,2] */
105 bool dvs_fraction;
106 /* option "penmanvp": actual vapour pressure in Penman ET (see
107 * Oryza2000Engine::penman_actual_vapour_pressure) */
108 bool penman_vp;
109 /* option "cropfile": ORYZA2000 crop file used for all rice
110 * plantings without entry in setup section <Oryza2000Reader> */
111 std::string m_cropfile;
112
118 lerr_t Oryza2000PhysiologyCropFile( Oryza2000State * /* oryza state */,
119 char const * /* cultivar (longname) */);
120
121 double accumulated_potentialtranspiration_old;
122
123 lerr_t Oryza2000PhysiologyReceiveState(
124 Oryza2000State * /* oryza state */);
125
126 lerr_t Oryza2000PhysiologySendState(
127 Oryza2000State * /* oryza state */);
128
129 lerr_t Oryza2000PhysiologyPlant( Oryza2000State * /* oryza state */);
130
131 lerr_t Oryza2000PhysiologyHarvest();
132};
133} /*namespace ldndc*/
134
135#endif /* !LM_ORYZA2000_H_ */
Spatially explicit groundwater model.
Definition airchemistryput.h:21
Interface of the fine root system of a plant: rooting depth, distribution of fine root mass and lengt...
Definition ld_rootsystem.h:34