Пример #1
0
        //---------------------------------------------------------------------
        /// <summary>
        /// Adds frass for a species to the foliar LITTER pools at a site.
        /// Assumes that some of the N has been resorbed.
        /// </summary>
        public static void AddFrassLitter(double inputFrassBiomass, ISpecies species, ActiveSite site)
        {
            double inputDecayValue = 1.0;   // Decay value is calculated for surface/soil layers (leaf/fine root),

            // therefore, this is just a dummy value.


            if (inputFrassBiomass > 0)
            {
                //SiteVars.LitterfallC[site] += defoliatedLeafBiomass * 0.47;

                //double frassBiomass = Math.Max(0.0, OtherData.frassdepk * defoliatedLeafBiomass);
                // Frass C added is a function of defoliated leaf biomass, but adjusted for the CN of litter and frass
                // Any C lost is due to insect metabolism
                double inputFrassC        = inputFrassBiomass * 0.47;
                double inputFrassN        = inputFrassC / (double)SpeciesData.LeafLitterCN[species];
                double actualFrassC       = inputFrassN * (double)OtherData.CNratiofrass; // the difference between input and actual is C lost to insect metabolism
                double actualFrassBiomass = actualFrassC / 0.47;

                //PlugIn.ModelCore.UI.WriteLine("AddFrass.Month={0:0}, inputfrassN={1:0.000}, inputfrassbiomass={2:0.00}, actualfrassbiomass={3:0.00} ", Main.Month, inputFrassN, inputFrassBiomass, actualFrassBiomass);

                SiteVars.FrassC[site] += actualFrassC;

                LitterLayer.PartitionResidue(
                    actualFrassBiomass,
                    inputDecayValue,
                    OtherData.CNratiofrass,
                    0.1,
                    OtherData.StructuralCN,
                    LayerName.Leaf,
                    LayerType.Surface,
                    site);
            }
        }
Пример #2
0
        //---------------------------------------------------------------------
        /// <summary>
        /// Adds some biomass for a species to the foliar LITTER pools at a site.
        /// Assumes that some of the N has been resorbed.
        /// </summary>
        public static void AddResorbedFoliageLitter(double foliarBiomass, ISpecies species, ActiveSite site)
        {
            double inputDecayValue = 1.0;   // Decay value is calculated for surface/soil layers (leaf/fine root),

            // therefore, this is just a dummy value.

            if (foliarBiomass > 0)
            {
                SiteVars.LitterfallC[site] += foliarBiomass * 0.47;

                LitterLayer.PartitionResidue(
                    foliarBiomass,
                    inputDecayValue,
                    SpeciesData.LeafLitterCN[species],
                    SpeciesData.LeafLignin[species],
                    OtherData.StructuralCN,
                    LayerName.Leaf,
                    LayerType.Surface,
                    site);
            }
        }
Пример #3
0
        //---------------------------------------------------------------------
        /// <summary>
        /// Kills fine roots and add the biomass to the Dead Fine Roots pool.
        /// </summary>
        public static void AddFineRootLitter(double abovegroundFoliarBiomass, ICohort cohort,
                                             ISpecies species,
                                             ActiveSite site)
        {
            double fineRootBiomass = CalculateFineRoot(cohort, abovegroundFoliarBiomass);

            double inputDecayValue = 1.0;   // Decay value is calculated for surface/soil (leaf/fine root),

            // therefore, this is just a dummy value.
            if (fineRootBiomass > 0)
            {
                LitterLayer.PartitionResidue(
                    fineRootBiomass,
                    inputDecayValue,
                    SpeciesData.FineRootCN[species],
                    SpeciesData.FineRootLignin[species],
                    OtherData.StructuralCN,
                    LayerName.FineRoot,
                    LayerType.Soil,
                    site);
            }
        }
        /// <summary>
        /// Grows all cohorts at a site for a specified number of years.
        /// Litter is decomposed following growth.
        /// </summary>
        public static ISiteCohorts Run(ActiveSite site,
                                       int years,
                                       bool isSuccessionTimeStep)
        {
            ISiteCohorts siteCohorts = SiteVars.Cohorts[site];
            IEcoregion   ecoregion   = PlugIn.ModelCore.Ecoregion[site];

            for (int y = 0; y < years; ++y)
            {
                Year = y + 1;

                if (PlugIn.ModelCore.CurrentTime > 0 && Climate.Future_MonthlyData.ContainsKey(PlugIn.FutureClimateBaseYear + y + PlugIn.ModelCore.CurrentTime - years))
                {
                    EcoregionData.AnnualWeather[ecoregion] = Climate.Future_MonthlyData[PlugIn.FutureClimateBaseYear + y - years + PlugIn.ModelCore.CurrentTime][ecoregion.Index];
                }

                SiteVars.ResetAnnualValues(site);

                if (y == 0 && SiteVars.FireSeverity != null && SiteVars.FireSeverity[site] > 0)
                {
                    FireEffects.ReduceLayers(SiteVars.FireSeverity[site], site);
                }

                // Next, Grow and Decompose each month
                int[] months = new int[12] {
                    6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5
                };

                if (OtherData.CalibrateMode)
                {
                    months = new int[12] {
                        6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5
                    }
                }
                ;

                for (MonthCnt = 0; MonthCnt < 12; MonthCnt++)
                {
                    // Calculate mineral N fractions based on coarse root biomass
                    if (MonthCnt == 0)
                    {
                        AvailableN.CalculateMineralNfraction(site);
                    }
                    //PlugIn.ModelCore.UI.WriteLine("SiteVars.MineralN = {0:0.00}, month = {1}.", SiteVars.MineralN[site], i);

                    Month = months[MonthCnt];

                    SiteVars.MonthlyAGNPPcarbon[site][Month] = 0.0;
                    SiteVars.MonthlyBGNPPcarbon[site][Month] = 0.0;
                    SiteVars.MonthlyNEE[site][Month]         = 0.0;
                    SiteVars.MonthlyResp[site][Month]        = 0.0;
                    SiteVars.MonthlyStreamN[site][Month]     = 0.0;
                    SiteVars.SourceSink[site].Carbon         = 0.0;
                    SiteVars.TotalWoodBiomass[site]          = Main.ComputeWoodBiomass((ActiveSite)site);
                    //SiteVars.LAI[site] = Main.ComputeLAI((ActiveSite)site);

                    double ppt = EcoregionData.AnnualWeather[ecoregion].MonthlyPrecip[Main.Month];

                    double monthlyNdeposition;
                    if (EcoregionData.AtmosNintercept[ecoregion] != -1 && EcoregionData.AtmosNslope[ecoregion] != -1)
                    {
                        monthlyNdeposition = EcoregionData.AtmosNintercept[ecoregion] + (EcoregionData.AtmosNslope[ecoregion] * ppt);
                    }
                    else
                    {
                        monthlyNdeposition = EcoregionData.AnnualWeather[ecoregion].MonthlyNDeposition[Main.Month];
                    }

                    if (monthlyNdeposition < 0)
                    {
                        throw new System.ApplicationException("Error: Nitrogen deposition input data are not present in climate library");
                    }

                    EcoregionData.MonthlyNDeposition[ecoregion][Month] = monthlyNdeposition;
                    EcoregionData.AnnualNDeposition[ecoregion]        += monthlyNdeposition;
                    SiteVars.MineralN[site] += monthlyNdeposition;
                    //PlugIn.ModelCore.UI.WriteLine("Ndeposition={0},MineralN={1:0.00}.", monthlyNdeposition, SiteVars.MineralN[site]);

                    double liveBiomass = (double)ComputeLivingBiomass(siteCohorts);
                    double baseFlow, stormFlow;
                    SoilWater.Run(y, Month, liveBiomass, site, out baseFlow, out stormFlow);

                    // Calculate N allocation for each cohort
                    AvailableN.SetMineralNallocation(site);

                    if (MonthCnt == 11)
                    {
                        siteCohorts.Grow(site, (y == years && isSuccessionTimeStep), true);
                    }
                    else
                    {
                        siteCohorts.Grow(site, (y == years && isSuccessionTimeStep), false);
                    }

                    WoodLayer.Decompose(site);
                    LitterLayer.Decompose(site);
                    SoilLayer.Decompose(site);

                    //...Volatilization loss as a function of the mineral n which
                    //     remains after uptake by plants.  ML added a correction factor for wetlands since their denitrification rate is double that of wetlands
                    //based on a review paper by Seitziner 2006.

                    double volatilize = (SiteVars.MineralN[site] * EcoregionData.Denitrif[ecoregion]); // monthly value

                    //PlugIn.ModelCore.UI.WriteLine("BeforeVol.  MineralN={0:0.00}.", SiteVars.MineralN[site]);

                    SiteVars.MineralN[site]            -= volatilize;
                    SiteVars.SourceSink[site].Nitrogen += volatilize;
                    SiteVars.Nvol[site] += volatilize;

                    SoilWater.Leach(site, baseFlow, stormFlow);

                    SiteVars.MonthlyNEE[site][Month] -= SiteVars.MonthlyAGNPPcarbon[site][Month];
                    SiteVars.MonthlyNEE[site][Month] -= SiteVars.MonthlyBGNPPcarbon[site][Month];
                    SiteVars.MonthlyNEE[site][Month] += SiteVars.SourceSink[site].Carbon;
                }
            }

            ComputeTotalCohortCN(site, siteCohorts);

            return(siteCohorts);
        }