iLand
soil.h
Go to the documentation of this file.
1/********************************************************************************************
2** iLand - an individual based forest landscape and disturbance model
3** http://iland-model.org
4** Copyright (C) 2009- Werner Rammer, Rupert Seidl
5**
6** This program is free software: you can redistribute it and/or modify
7** it under the terms of the GNU General Public License as published by
8** the Free Software Foundation, either version 3 of the License, or
9** (at your option) any later version.
10**
11** This program is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14** GNU General Public License for more details.
15**
16** You should have received a copy of the GNU General Public License
17** along with this program. If not, see <http://www.gnu.org/licenses/>.
18********************************************************************************************/
19
20#ifndef SOIL_H
21#define SOIL_H
22
23#include "snag.h"
24struct SoilParams; // forward
25class ResourceUnit; // forward
26class SoilInputOut; // forward
27
28class Soil
29{
30public:
31 // lifecycle
32 Soil(ResourceUnit *ru=0);
34 void setInitialState(const CNPool &young_labile_kg_ha, const CNPool &young_refractory_kg_ha, const CNPair &SOM_kg_ha, double young_labile_aboveground_frac, double young_refractory_aboveground_frac);
35
36 // actions
37 void setSoilInput(const CNPool &labile_input_kg_ha, const CNPool &refractory_input_kg_ha, double labile_aboveground_C, double refractory_aboveground_C);
38 void setClimateFactor(const double climate_factor_re) { mRE = climate_factor_re; }
39 void newYear();
40 void calculateYear();
41
46 void disturbance(double DWDfrac, double litterFrac, double soilFrac);
51 void disturbanceBiomass(double DWD_kg_ha, double litter_kg_ha, double soil_kg_ha);
52
53 // access
54 const CNPool &youngLabile() const { return mYL;}
55 const CNPool &youngRefractory() const { return mYR;}
56 const CNPair &oldOrganicMatter() const { return mSOM;}
57 double youngLabileAbovegroundFraction() const { return mYLaboveground_frac; }
58 double youngRefractoryAbovegroundFraction() const { return mYRaboveground_frac; }
59 double availableNitrogen() const { return mAvailableNitrogen; }
60 double totalCarbon() const;
61
62 const CNPair &fluxToAtmosphere() const { return mTotalToAtmosphere; }
63 const CNPair &fluxToDisturbance() const { return mTotalToDisturbance; }
64
65 QList<QVariant> debugList();
66private:
67 ResourceUnit *mRU;
68 void fetchParameters();
69 static SoilParams *mParams; // static container for parameters
70 // variables
71 double mRE;
72 double mAvailableNitrogen;
73 double mAvailableNitrogenFromLabile;
74 double mAvailableNitrogenFromRefractory;
75 double mKyl;
76 double mKyr;
77 double mKo;
78 double mH;
79
80 CNPool mInputLab;
81 CNPool mInputRef;
82 // state variables
83 CNPool mYL;
84 CNPool mYR;
85 CNPair mSOM;
86 // aboveground fraction (=fraction of the pool content for which the source is AG biomass (leafs, branches, stems)
87 double mYLaboveground_frac;
88 double mYRaboveground_frac;
89
90 CNPair mTotalToDisturbance;
91 CNPair mTotalToAtmosphere;
92
93 static double mNitrogenDeposition;
94 friend class Snapshot;
95 friend class SoilInputOut;
96};
97
98#endif // SOIL_H
CNPair stores a duple of carbon and nitrogen (kg/ha) use addBiomass(biomass, cnratio) to add biomass;...
Definition: snag.h:31
CNPool provides (in addition to CNPair) also a weighted parameter value (e.g.
Definition: snag.h:59
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
way to save/load the current state of the model to a database.
Definition: snapshot.h:35
implementation of the ICBM/2N soil carbon and nitrogen dynamics model.
Definition: soil.h:29
Soil(ResourceUnit *ru=0)
Definition: soil.cpp:73
void calculateYear()
main calculation function: calculates the update of state variables
Definition: soil.cpp:177
const CNPool & youngRefractory() const
young refractory matter (t/ha)
Definition: soil.h:55
const CNPair & oldOrganicMatter() const
old matter (SOM) (t/ha)
Definition: soil.h:56
void newYear()
reset of counters
Definition: soil.cpp:87
QList< QVariant > debugList()
return a debug output
Definition: soil.cpp:285
double youngLabileAbovegroundFraction() const
fraction (0..1) of aboveground biomass in litter layer (yL), source is foliage
Definition: soil.h:57
void setSoilInput(const CNPool &labile_input_kg_ha, const CNPool &refractory_input_kg_ha, double labile_aboveground_C, double refractory_aboveground_C)
provide values for input pools
Definition: soil.cpp:125
void setInitialState(const CNPool &young_labile_kg_ha, const CNPool &young_refractory_kg_ha, const CNPair &SOM_kg_ha, double young_labile_aboveground_frac, double young_refractory_aboveground_frac)
set initial pool contents
Definition: soil.cpp:94
double youngRefractoryAbovegroundFraction() const
fraction (0..1) of aboveground biomass in woody litter layer (yR), source=branches,...
Definition: soil.h:58
void setClimateFactor(const double climate_factor_re)
set the climate decomposition factor for the current year
Definition: soil.h:38
double totalCarbon() const
total soil carbon t/ha (result is per ha, not the real area)
Definition: soil.cpp:352
void disturbanceBiomass(double DWD_kg_ha, double litter_kg_ha, double soil_kg_ha)
remove biomass from the soil layer (e.g.
Definition: soil.cpp:334
const CNPool & youngLabile() const
young labile matter (t/ha)
Definition: soil.h:54
double availableNitrogen() const
return available Nitrogen (kg/ha*yr)
Definition: soil.h:59
void disturbance(double DWDfrac, double litterFrac, double soilFrac)
remove part of the biomass (e.g.
Definition: soil.cpp:301
const CNPair & fluxToDisturbance() const
total flux due to disturbance events (e.g. fire) kg/ha
Definition: soil.h:63
const CNPair & fluxToAtmosphere() const
total flux due to heterotrophic respiration kg/ha
Definition: soil.h:62
Definition: soilinputout.h:6