Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
671 | werner | 1 | /******************************************************************************************** |
2 | ** iLand - an individual based forest landscape and disturbance model |
||
3 | ** http://iland.boku.ac.at |
||
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 | |||
448 | werner | 20 | #ifndef SOIL_H |
21 | #define SOIL_H |
||
22 | |||
525 | werner | 23 | #include "snag.h" |
527 | werner | 24 | struct SoilParams; // forward |
591 | werner | 25 | class ResourceUnit; // forward |
26 | |||
448 | werner | 27 | class Soil |
28 | { |
||
29 | public: |
||
525 | werner | 30 | // lifecycle |
591 | werner | 31 | Soil(ResourceUnit *ru=0); |
525 | werner | 32 | /// set initial pool contents |
534 | werner | 33 | void setInitialState(const CNPool &young_labile_kg_ha, const CNPool &young_refractory_kg_ha, const CNPair &SOM_kg_ha); |
525 | werner | 34 | |
35 | // actions |
||
36 | void setSoilInput(const CNPool &labile_input_kg_ha, const CNPool &refractory_input_kg_ha); ///< provide values for input pools |
||
37 | void setClimateFactor(const double climate_factor_re) { mRE = climate_factor_re; } ///< set the climate decomposition factor for the current year |
||
609 | werner | 38 | void newYear(); ///< reset of counters |
526 | werner | 39 | void calculateYear(); ///< main calculation function: calculates the update of state variables |
662 | werner | 40 | |
582 | werner | 41 | /// remove part of the biomass (e.g.: due to fire). |
566 | werner | 42 | /// @param DWDfrac fraction of downed woody debris (yR) to remove (0: nothing, 1: remove 100% percent) |
43 | /// @param litterFrac fraction of litter pools (yL) to remove (0: nothing, 1: remove 100% percent) |
||
44 | /// @param soilFrac fraction of soil pool (SOM) to remove (0: nothing, 1: remove 100% percent) |
||
45 | void disturbance(double DWDfrac, double litterFrac, double soilFrac); |
||
662 | werner | 46 | /// remove biomass from the soil layer (e.g.: due to fire). |
47 | /// @param DWD_kg_ha downed woody debris (yR) to remove kg/ha |
||
48 | /// @param litter_kg_ha biomass in litter pools (yL) to remove kg/ha |
||
49 | /// @param soil_kg_ha biomass in soil pool (SOM) to remove kg/ha |
||
50 | void disturbanceBiomass(double DWD_kg_ha, double litter_kg_ha, double soil_kg_ha); |
||
525 | werner | 51 | |
52 | // access |
||
53 | const CNPool &youngLabile() const { return mYL;} ///< young labile matter (t/ha) |
||
54 | const CNPool &youngRefractory() const { return mYR;} ///< young refractory matter (t/ha) |
||
534 | werner | 55 | const CNPair &oldOrganicMatter() const { return mSOM;} ///< old matter (SOM) (t/ha) |
525 | werner | 56 | double availableNitrogen() const { return mAvailableNitrogen; } ///< return available Nitrogen (kg/ha*yr) |
609 | werner | 57 | |
58 | const CNPair &fluxToAtmosphere() const { return mTotalToAtmosphere; } ///< total flux due to heterotrophic respiration kg/ha |
||
59 | const CNPair &fluxToDisturbance() const { return mTotalToDisturbance; } ///< total flux due to disturbance events (e.g. fire) kg/ha |
||
60 | |||
525 | werner | 61 | QList<QVariant> debugList(); ///< return a debug output |
62 | private: |
||
591 | werner | 63 | ResourceUnit *mRU; ///< link to containing resource unit |
527 | werner | 64 | void fetchParameters(); ///< set iland parameters for soil |
65 | static SoilParams *mParams; // static container for parameters |
||
525 | werner | 66 | // variables |
67 | double mRE; ///< climate factor 're' (see Snag::calculateClimateFactors()) |
||
68 | double mAvailableNitrogen; ///< plant available nitrogen (kg/ha) |
||
928 | werner | 69 | double mAvailableNitrogenFromLabile; ///< plant available nitrogen from labile pool (kg/ha) |
70 | double mAvailableNitrogenFromRefractory; ///< plant available nitrogen from refractory pool (kg/ha) |
||
534 | werner | 71 | double mKyl; ///< litter decomposition rate |
72 | double mKyr; ///< downed woody debris (dwd) decomposition rate |
||
73 | double mKo; ///< decomposition rate for soil organic matter (i.e. the "old" pool sensu ICBM) |
||
74 | double mH; ///< humification rate |
||
75 | |||
525 | werner | 76 | CNPool mInputLab; ///< input pool labile matter (t/ha) |
77 | CNPool mInputRef; ///< input pool refractory matter (t/ha) |
||
78 | // state variables |
||
79 | CNPool mYL; ///< C/N Pool for young labile matter (i.e. litter) (t/ha) |
||
80 | CNPool mYR; ///< C/N Pool for young refractory matter (i.e. downed woody debris) (t/ha) |
||
534 | werner | 81 | CNPair mSOM; ///< C/N Pool for old matter (t/ha) (i.e. soil organic matter, SOM) |
609 | werner | 82 | |
662 | werner | 83 | CNPair mTotalToDisturbance; ///< book-keeping pool for heterotrophic respiration (kg/*ha) |
609 | werner | 84 | CNPair mTotalToAtmosphere; ///< book-keeping disturbance envents (fire) (kg/ha) |
675 | werner | 85 | |
895 | werner | 86 | static double mNitrogenDeposition; ///< annual nitrogen deposition (kg N/ha*yr) |
675 | werner | 87 | friend class Snapshot; |
448 | werner | 88 | }; |
89 | |||
90 | #endif // SOIL_H |