コード例 #1
0
 //---------------------------------------------------------------------
 /// <summary>
 /// Weathering of rock phosphorus (rate is user-defined), increasing
 /// mineral phosphorus and reducing rock phosphorus.
 /// </summary>
 public static void Weathering(IEcoregion ecoregion,
                               Rock rock,
                               MineralSoil mineralSoil)
 {
     rock.WeatheredMineralP = rock.ContentP * EcoregionData.WeatheringP[ecoregion];
     rock.ContentP = Math.Max(rock.ContentP - rock.WeatheredMineralP, 0);
     mineralSoil.ContentP += rock.WeatheredMineralP;
 }
コード例 #2
0
        //---------------------------------------------------------------------
        /// <summary>
        /// Reduces available P according to the amount of P necessary for growth (i.e., ANPP).
        /// </summary>
        public static void CohortUptakeAvailableP(double leafANPP,
                                                  double woodANPP,
                                                  //double leafLongevity,
                                                  ActiveSite site,
                                                  ISpecies species,
                                                  MineralSoil mineralSoil)
        {
            double leafLongevity = SpeciesData.LeafLongevity[species];
            double coarseRootANPP = Roots.CalculateCoarseRoot(woodANPP, leafLongevity);
            double fineRootANPP = Roots.CalculateFineRoot(leafANPP, leafLongevity);

            //Leaf phosphorus: leafANPP is multiplied by litter fraction P
            //  assuming the difference between leaf and litter P is
            //  translocated and cycled within the cohort.
            double leafP = leafANPP * SpeciesData.LeafFractionP[species];
            double woodP = woodANPP * SpeciesData.WoodFractionP[species];
            double coarseRootP = coarseRootANPP * SpeciesData.WoodFractionP[species];
            double fineRootP = fineRootANPP * SpeciesData.FRootFractionP[species];

            double Preduction = leafP + woodP + coarseRootP + fineRootP;
            Preduction = Math.Max(Preduction, 0.0);

            mineralSoil.ContentP -= Preduction;
        }
コード例 #3
0
 //---------------------------------------------------------------------
 /// <summary>
 /// Add nitrogen and phosphorus deposition to the mineral pools.
 /// </summary>
 public static void Deposition(IEcoregion ecoregion,
                               MineralSoil mineralSoil)
 {
     mineralSoil.ContentN += EcoregionData.DepositionN[ecoregion];
     mineralSoil.ContentP += EcoregionData.DepositionP[ecoregion];
 }
コード例 #4
0
        //---------------------------------------------------------------------
        /// <summary>
        /// Initializes the module.
        /// </summary>
        public static void Initialize()
        {
            cohorts             = Model.Core.Landscape.NewSiteVar<SiteCohorts>();
            availableN          = Model.Core.Landscape.NewSiteVar<double>();
            unavailable         = Model.Core.Landscape.NewSiteVar<Pool>();
            fineRoots           = Model.Core.Landscape.NewSiteVar<Pool>();
            coarseRoots         = Model.Core.Landscape.NewSiteVar<Pool>();
            woodyDebris         = Model.Core.Landscape.NewSiteVar<PoolD>();
            litter              = Model.Core.Landscape.NewSiteVar<List<PoolD>>();
            deadFineRoots       = Model.Core.Landscape.NewSiteVar<List<PoolD>>();
            litterAdd           = Model.Core.Landscape.NewSiteVar<List<PoolD>>();
            deadFineRootsAdd    = Model.Core.Landscape.NewSiteVar<List<PoolD>>();
            removeLitter        = Model.Core.Landscape.NewSiteVar<List<PoolD>>();
            removeDeadFineRoots = Model.Core.Landscape.NewSiteVar<List<PoolD>>();
            soilOrganicMatter   = Model.Core.Landscape.NewSiteVar<SoilOrganicMatter>();
            mineralSoil         = Model.Core.Landscape.NewSiteVar<MineralSoil>();
            charcoal            = Model.Core.Landscape.NewSiteVar<Charcoal>();
            rock                = Model.Core.Landscape.NewSiteVar<Rock>();
            //fireSeverity        = Model.Core.Landscape.NewSiteVar<int>();

            TotalWoodBiomass    = Model.Core.Landscape.NewSiteVar<double>();
            CurrentYearMortality = Model.Core.Landscape.NewSiteVar<double>();
            PrevYearMortality = Model.Core.Landscape.NewSiteVar<double>();
            //fireSeverity = Model.Core.GetSiteVar<byte>("Fire.Severity");

            // Enable interactions with (almost) any fire extension:
            /*if (Model.Core.GetSiteVar<int>("Fire.Severity") == null)
            {
                Console.Write("Fire Severity not cu");
            }
            else
            {
                Console.Write("Real value");
                fireSeverity = Model.Core.GetSiteVar<int>("Fire.SeverityX");
            }*/

            foreach (ActiveSite site in Model.Core.Landscape)
            {
                //  site cohorts are initialized by the PlugIn.InitializeSite method
                availableN[site]            = new double();
                unavailable[site]           = new Pool();
                fineRoots[site]             = new Pool();
                coarseRoots[site]           = new Pool();
                woodyDebris[site]           = new PoolD();
                litter[site]                = new List<PoolD>();
                deadFineRoots[site]         = new List<PoolD>();
                litterAdd[site]             = new List<PoolD>();
                deadFineRootsAdd[site]      = new List<PoolD>();
                removeLitter[site]          = new List<PoolD>();
                removeDeadFineRoots[site]   = new List<PoolD>();
                soilOrganicMatter[site]     = new SoilOrganicMatter();
                mineralSoil[site]           = new MineralSoil();
                charcoal[site]              = new Charcoal();
                rock[site]                  = new Rock();
            }
        }
コード例 #5
0
        //---------------------------------------------------------------------
        /// <summary>
        /// Weathering (i.e., physical decomposition) of charcoal carbon, nitrogen,
        /// and phosphorus. Charcoal C, N, and P and mineral soil N and P are
        /// updated. The weathering rate gives a half-life of 3,465 years (Lutzow
        /// et al. 2006 suggest a range of 500-10,000 years).
        /// </summary>
        public static void Weathering(Charcoal charcoal,
            MineralSoil mineralSoil)
        {
            double weatheringRate = 0.0002;

            charcoal.ContentC = Math.Max(charcoal.ContentC * Math.Exp(-1 * weatheringRate), 0);

            charcoal.WeatheredMineralN = charcoal.ContentN - (charcoal.ContentN *
                Math.Exp(-1 * weatheringRate));
            charcoal.ContentN = Math.Max(charcoal.ContentN - charcoal.WeatheredMineralN, 0);
            mineralSoil.ContentN += charcoal.WeatheredMineralN;

            charcoal.WeatheredMineralP = charcoal.ContentP - (charcoal.ContentP *
                Math.Exp(-1 * weatheringRate));
            charcoal.ContentP = Math.Max(charcoal.ContentP - charcoal.WeatheredMineralP, 0);
            mineralSoil.ContentP += charcoal.WeatheredMineralP;
        }