LandscapeDNDC 1.37.0
Loading...
Searching...
No Matches
mycofon.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 */
6#ifndef M1D_MOD_PHYSIOLOGY_MYCOFON_H
7#define M1D_MOD_PHYSIOLOGY_MYCOFON_H
8
9#include <string>
10
11#include "physiologymodule.h"
12
13
14/*
15 * Definition of the PhysiologyMYCOFON model
16 */
17class PhysiologyMYCOFON : public PhysiologyModule {
18 public:
20 PhysiologyMYCOFON(ModelCore & modelCore, unsigned int timeInterval) : PhysiologyModule(modelCore,timeInterval),
21 modelCore_(modelCore),
22 time_(modelCore.getLandscape().getTime()),
23 si_(modelCore.getInput().getSite()),
24 sppar_(modelCore.getInput().getParameter().getSpeciesPar()),
25 sipar_(modelCore.getInput().getParameter().getSitePar()),
26 ac_(modelCore.getSubstates().getAc()),
27 mc_(modelCore.getSubstates().getMc()),
28 sc_(modelCore.getSubstates().getSc()),
29 wc_(modelCore.getSubstates().getWc()),
30 ph_(const_cast<Physiology &>(modelCore.getSubstates().getPh())),
31 vs_(modelCore.getSubstates().getVs())
32
33 {
34 this->setName("PhysiologyMYCOFON");
35 }
36
37 ~PhysiologyMYCOFON() {
38
39 }
40
41 // IMPORTANT: THIS is empty cause the major ph module has already done the init process
42 void initialize(){
43 }
44
45
46 void solve(){
47 this->run_();
48 }
49
50
51private:
52 ModelCore & modelCore_;
53 Timer & time_;
54 Site & si_;
55 SpeciesPar & sppar_;
56 SitePar & sipar_;
57
58 AirChemistry const & ac_;
59 MicroClimate const & mc_;
60 SoilChemistry const & sc_;
61 WaterCycle const & wc_;
62 Physiology & ph_;
63 VegStructure const & vs_;
64
65
66 // declaration of module specific parameters
67 static const double CCDMmyc; // relative carbon content of fungal dry matter == plant carbon concentration (IMPORTANT FOR OTHER MODULES)
68 static const double NCFUNGOPT; // optimum fungal NC ratio
69 static const double MYC_M; // ratio between fungal mycelium and mantle+hartig net biomass
70 static const double NTORmyc; // fraction of fungal N potentially transferred to the root(taken from N pool)
71 static const double PAMMmyc; // respiration costs for NH4 uptake
72 static const double PNITmyc; // respiration costs for NO3 uptake
73 static const double PORGmyc; // respiration costs for org.N uptake
74 static const double FYIELDmyc; // fraction of growth respiration relative to gross assimilation
75 static const double KM20myc; // maintenance coefficient at reference temperature
76 static const double CSUBmyc; // ( fFac =0.15 * 0.45) substrate concentration (kg C / kgDM) taken from PSIM
77 static const double TMINmyc; // minimum temperature for maintanence respiration
78 static const double TMAXmyc; // maximum temperature for maintanence respiration
79 static const double TREFmyc; // reference temperature for maintanence respiration
80 static const double KMMMmyc; // Michaelis Menten constant
81 static const double DR_MYCmyc; // turnover rate of mycelium 1/d
82 static const double DR_Mmyc;// turnover rate of mantle and hartig net
83 static const double NH4UPTmyc; // NH4 uptake fungus kg-N kgdw-1 d-1 nach: Plassard 1991 19-600�mol gdw-1 h-1, mean 300, 0.15=400
84 static const double NO3UPTmyc; // NO3 uptake fungus kg-N kgdw-1 d-1 nach: Plassard 1991 40 �mol gdw-1 h-1
85 static const double DONUPTmyc; // DON uptake fungus kg-N kgdw-1 d-1 (estimated by Glutamine)
86 static const double RSMAX; // maximum fraction of root stored C transferred to fungus
87 static const double NLIM;
88 static const double TLIM;
89 static const double RNLIM;
90 static const double MAXUPT;
91 static const double FCSTOR; // 0.11--> 52mg, 0.2 --> 90mg. mobile C storage: between 15 and 90 mg(Carbohydrate) groot-1 according to A.Polle
92 static const double COVOPT;
93
94 // local variables exchanged between functions
96 double nMyc;
97 double factallo;
98 double fsupplyMax;
99 double NCfung;
100 double soilDON_m2;
101 double soilNH4_m2;
102 double soilNO3_m2;
103 double soilN_m2;
104 double uptNH4_f;
105 double uptNO3_f;
106 double uptDON_f;
107 double dntot;
108
109 // variables derived from general available variables from other modules
110 double mFrtSum,temp;
111 // averaged species parameter (weighted by fine root biomass)
112 double CFCROPT,NCROOTOPT;
113 // general available parameters defined inside the module
115
116 // functions
117 void MycInitial();
118
119 void MycNAllocation();
120
121 void MycCAllocation();
122
123 inline double Max(double x, double y){
124 return (x > y) ? x : y;
125 }
126
127 inline double Min(double x, double y){
128 return (x > y) ? y : x;
129 }
130
131 inline double Sqr(double x){
132 return x * x;
133 }
134
135 void run_();
136
137};
138
139#endif // M1D_MOD_PHYSIOLOGY_MYCOFON_H
140
141