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