Subversion Repositories public iLand

Rev

Rev 639 | Rev 671 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1
 
448 werner 2
#ifndef SOIL_H
3
#define SOIL_H
4
 
525 werner 5
#include "snag.h"
527 werner 6
struct SoilParams; // forward
591 werner 7
class ResourceUnit; // forward
8
 
448 werner 9
class Soil
10
{
11
public:
525 werner 12
    // lifecycle
591 werner 13
    Soil(ResourceUnit *ru=0);
525 werner 14
    /// set initial pool contents
534 werner 15
    void setInitialState(const CNPool &young_labile_kg_ha, const CNPool &young_refractory_kg_ha, const CNPair &SOM_kg_ha);
525 werner 16
 
17
    // actions
18
    void setSoilInput(const CNPool &labile_input_kg_ha, const CNPool &refractory_input_kg_ha); ///< provide values for input pools
19
    void setClimateFactor(const double climate_factor_re) { mRE = climate_factor_re; } ///< set the climate decomposition factor for the current year
609 werner 20
    void newYear(); ///< reset of counters
526 werner 21
    void calculateYear(); ///< main calculation function: calculates the update of state variables
662 werner 22
 
582 werner 23
    /// remove part of the biomass (e.g.: due to fire).
566 werner 24
    /// @param DWDfrac fraction of downed woody debris (yR) to remove (0: nothing, 1: remove 100% percent)
25
    /// @param litterFrac fraction of litter pools (yL) to remove (0: nothing, 1: remove 100% percent)
26
    /// @param soilFrac fraction of soil pool (SOM) to remove (0: nothing, 1: remove 100% percent)
27
    void disturbance(double DWDfrac, double litterFrac, double soilFrac);
662 werner 28
    /// remove biomass from the soil layer (e.g.: due to fire).
29
    /// @param DWD_kg_ha downed woody debris (yR) to remove kg/ha
30
    /// @param litter_kg_ha biomass in litter pools (yL) to remove kg/ha
31
    /// @param soil_kg_ha biomass in soil pool (SOM) to remove kg/ha
32
    void disturbanceBiomass(double DWD_kg_ha, double litter_kg_ha, double soil_kg_ha);
525 werner 33
 
34
    // access
35
    const CNPool &youngLabile() const { return mYL;} ///< young labile matter (t/ha)
36
    const CNPool &youngRefractory() const { return mYR;} ///< young refractory matter (t/ha)
534 werner 37
    const CNPair &oldOrganicMatter() const { return mSOM;} ///< old matter (SOM) (t/ha)
525 werner 38
    double availableNitrogen() const { return mAvailableNitrogen; } ///< return available Nitrogen (kg/ha*yr)
609 werner 39
 
40
    const CNPair &fluxToAtmosphere() const { return mTotalToAtmosphere; } ///< total flux due to heterotrophic respiration kg/ha
41
    const CNPair &fluxToDisturbance() const { return mTotalToDisturbance; } ///< total flux due to disturbance events (e.g. fire) kg/ha
42
 
525 werner 43
    QList<QVariant> debugList(); ///< return a debug output
44
private:
591 werner 45
    ResourceUnit *mRU; ///< link to containing resource unit
527 werner 46
    void fetchParameters(); ///< set iland parameters for soil
47
    static SoilParams *mParams; // static container for parameters
525 werner 48
    // variables
49
    double mRE; ///< climate factor 're' (see Snag::calculateClimateFactors())
50
    double mAvailableNitrogen; ///< plant available nitrogen (kg/ha)
534 werner 51
    double mKyl; ///< litter decomposition rate
52
    double mKyr; ///< downed woody debris (dwd) decomposition rate
53
    double mKo; ///< decomposition rate for soil organic matter (i.e. the "old" pool sensu ICBM)
54
    double mH; ///< humification rate
55
 
525 werner 56
    CNPool mInputLab; ///< input pool labile matter (t/ha)
57
    CNPool mInputRef; ///< input pool refractory matter (t/ha)
58
    // state variables
59
    CNPool mYL; ///< C/N Pool for young labile matter (i.e. litter) (t/ha)
60
    CNPool mYR; ///< C/N Pool for young refractory matter (i.e. downed woody debris) (t/ha)
534 werner 61
    CNPair mSOM; ///< C/N Pool for old matter (t/ha) (i.e. soil organic matter, SOM)
609 werner 62
 
662 werner 63
    CNPair mTotalToDisturbance; ///< book-keeping pool for heterotrophic respiration (kg/*ha)
609 werner 64
    CNPair mTotalToAtmosphere; ///< book-keeping disturbance envents (fire) (kg/ha)
448 werner 65
};
66
 
67
#endif // SOIL_H