Subversion Repositories public iLand

Rev

Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1
 
671 werner 2
/********************************************************************************************
3
**    iLand - an individual based forest landscape and disturbance model
4
**    http://iland.boku.ac.at
5
**    Copyright (C) 2009-  Werner Rammer, Rupert Seidl
6
**
7
**    This program is free software: you can redistribute it and/or modify
8
**    it under the terms of the GNU General Public License as published by
9
**    the Free Software Foundation, either version 3 of the License, or
10
**    (at your option) any later version.
11
**
12
**    This program is distributed in the hope that it will be useful,
13
**    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
**    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
**    GNU General Public License for more details.
16
**
17
**    You should have received a copy of the GNU General Public License
18
**    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
********************************************************************************************/
20
 
448 werner 21
#ifndef SOIL_H
22
#define SOIL_H
23
 
525 werner 24
#include "snag.h"
527 werner 25
struct SoilParams; // forward
591 werner 26
class ResourceUnit; // forward
27
 
448 werner 28
class Soil
29
{
30
public:
525 werner 31
    // lifecycle
591 werner 32
    Soil(ResourceUnit *ru=0);
525 werner 33
    /// set initial pool contents
534 werner 34
    void setInitialState(const CNPool &young_labile_kg_ha, const CNPool &young_refractory_kg_ha, const CNPair &SOM_kg_ha);
525 werner 35
 
36
    // actions
37
    void setSoilInput(const CNPool &labile_input_kg_ha, const CNPool &refractory_input_kg_ha); ///< provide values for input pools
38
    void setClimateFactor(const double climate_factor_re) { mRE = climate_factor_re; } ///< set the climate decomposition factor for the current year
609 werner 39
    void newYear(); ///< reset of counters
526 werner 40
    void calculateYear(); ///< main calculation function: calculates the update of state variables
662 werner 41
 
582 werner 42
    /// remove part of the biomass (e.g.: due to fire).
566 werner 43
    /// @param DWDfrac fraction of downed woody debris (yR) to remove (0: nothing, 1: remove 100% percent)
44
    /// @param litterFrac fraction of litter pools (yL) to remove (0: nothing, 1: remove 100% percent)
45
    /// @param soilFrac fraction of soil pool (SOM) to remove (0: nothing, 1: remove 100% percent)
46
    void disturbance(double DWDfrac, double litterFrac, double soilFrac);
662 werner 47
    /// remove biomass from the soil layer (e.g.: due to fire).
48
    /// @param DWD_kg_ha downed woody debris (yR) to remove kg/ha
49
    /// @param litter_kg_ha biomass in litter pools (yL) to remove kg/ha
50
    /// @param soil_kg_ha biomass in soil pool (SOM) to remove kg/ha
51
    void disturbanceBiomass(double DWD_kg_ha, double litter_kg_ha, double soil_kg_ha);
525 werner 52
 
53
    // access
54
    const CNPool &youngLabile() const { return mYL;} ///< young labile matter (t/ha)
55
    const CNPool &youngRefractory() const { return mYR;} ///< young refractory matter (t/ha)
534 werner 56
    const CNPair &oldOrganicMatter() const { return mSOM;} ///< old matter (SOM) (t/ha)
525 werner 57
    double availableNitrogen() const { return mAvailableNitrogen; } ///< return available Nitrogen (kg/ha*yr)
609 werner 58
 
59
    const CNPair &fluxToAtmosphere() const { return mTotalToAtmosphere; } ///< total flux due to heterotrophic respiration kg/ha
60
    const CNPair &fluxToDisturbance() const { return mTotalToDisturbance; } ///< total flux due to disturbance events (e.g. fire) kg/ha
61
 
525 werner 62
    QList<QVariant> debugList(); ///< return a debug output
63
private:
591 werner 64
    ResourceUnit *mRU; ///< link to containing resource unit
527 werner 65
    void fetchParameters(); ///< set iland parameters for soil
66
    static SoilParams *mParams; // static container for parameters
525 werner 67
    // variables
68
    double mRE; ///< climate factor 're' (see Snag::calculateClimateFactors())
69
    double mAvailableNitrogen; ///< plant available nitrogen (kg/ha)
928 werner 70
    double mAvailableNitrogenFromLabile; ///< plant available nitrogen from labile pool (kg/ha)
71
    double mAvailableNitrogenFromRefractory; ///< plant available nitrogen from refractory pool (kg/ha)
534 werner 72
    double mKyl; ///< litter decomposition rate
73
    double mKyr; ///< downed woody debris (dwd) decomposition rate
74
    double mKo; ///< decomposition rate for soil organic matter (i.e. the "old" pool sensu ICBM)
75
    double mH; ///< humification rate
76
 
525 werner 77
    CNPool mInputLab; ///< input pool labile matter (t/ha)
78
    CNPool mInputRef; ///< input pool refractory matter (t/ha)
79
    // state variables
80
    CNPool mYL; ///< C/N Pool for young labile matter (i.e. litter) (t/ha)
81
    CNPool mYR; ///< C/N Pool for young refractory matter (i.e. downed woody debris) (t/ha)
534 werner 82
    CNPair mSOM; ///< C/N Pool for old matter (t/ha) (i.e. soil organic matter, SOM)
609 werner 83
 
662 werner 84
    CNPair mTotalToDisturbance; ///< book-keeping pool for heterotrophic respiration (kg/*ha)
609 werner 85
    CNPair mTotalToAtmosphere; ///< book-keeping disturbance envents (fire) (kg/ha)
675 werner 86
 
895 werner 87
    static double mNitrogenDeposition; ///< annual nitrogen deposition (kg N/ha*yr)
675 werner 88
    friend class Snapshot;
448 werner 89
};
90
 
91
#endif // SOIL_H