Exemplo n.º 1
0
        public static void GrowTree(DateTime date, int canopylayer, CohortBiomass cohortbiomass, float AboveCanopyRadiation)
        {
            cohortbiomass = ComputePhotosynthesis(date, canopylayer, cohortbiomass, AboveCanopyRadiation);

            CohortBiomass.Allocation(cohortbiomass);
            CohortBiomass.MaintenanceRespiration(cohortbiomass);

            ForestFloor.Litter[cohortbiomass.site].AddMass(FoliageSenescence(cohortbiomass), 0.1);
            ForestFloor.WoodyDebris[cohortbiomass.site].AddMass(WoodSenescence(cohortbiomass), 0.1);

            CohortOutput.WriteCohortData(date, cohortbiomass.site, cohortbiomass);
        }
Exemplo n.º 2
0
        public void CalculatePhotosynthesis(DateTime date, ActiveSite site, Hydrology hydrology, ForestFloor forestfloor, SiteOutput siteoutput)
        {
            autotrophicrespiration = 0;
            grosspsn     = 0;
            netpsn       = 0;
            totalnsc     = 0;
            totalroot    = 0;
            totalfoliage = 0;
            totalbiomass = 0;
            maxbiom      = 0;
            maxage       = 0;
            for (int canopylayer = canopy.Length - 1; canopylayer >= 0; canopylayer--)
            {
                for (int ix = 0; ix < IMAX; ix++)
                {
                    if (canopy[canopylayer] == null)
                    {
                        continue;
                    }

                    for (int coh = canopy[canopylayer].Count - 1; coh >= 0; coh--)
                    {
                        CohortBiomass CB = canopy[canopylayer][coh];

                        if (ix == 0)
                        {
                            forestfloor.WoodyDebris.AddMass(CB.WoodSenescence(), KWdLit[CB.Cohort.Species]);
                            forestfloor.Litter.AddMass(CB.FoliageSenescence(date, PlugIn.modelCore.Ecoregion[site], CB.Cohort.Species), ForestFloor.KNwdLitter[PlugIn.modelCore.Ecoregion[site], CB.Cohort.Species]);
                        }

                        float transpiration_lyr = 0;



                        bool cohortisalive = CB.ComputePhotosynthesis(date, PlugIn.modelCore.Ecoregion[site], ix, (int)IMAX, hydrology, ref transpiration_lyr);

                        if (CB.Cohort.Age > MaxAge)
                        {
                            maxage = CB.Cohort.Age;
                        }
                        if (MaxBiom < CB.Cohort.Biomass)
                        {
                            maxbiom = CB.Cohort.Biomass;
                        }

                        autotrophicrespiration += CB.Autotrophicrespiration;
                        netpsn   += CB.NetPsn;
                        grosspsn += CB.GrossPsn;

                        if (cohortisalive == false)
                        {
                            deadcohorts.Add(CB.Cohort);
                            forestfloor.WoodyDebris.AddMass(CB.Cohort.Biomass, KWdLit[CB.Cohort.Species]);
                            forestfloor.Litter.AddMass(CB.Cohort.Fol, ForestFloor.KNwdLitter[PlugIn.modelCore.Ecoregion[site], CB.Cohort.Species]);
                        }

                        transpiration += transpiration_lyr;

                        if (transpiration_lyr > hydrology.Water)
                        {
                            IncrementIMAX(site, date);

                            return;
                        }
                        else
                        {
                            hydrology.SubtractTranspiration(date, transpiration_lyr);
                        }

                        if (ix == 0)
                        {
                            totalbiomass += CB.Cohort.Biomass;
                            totalfoliage += CB.Cohort.Fol;
                            totalnsc     += CB.Cohort.NSC;
                            totalroot    += CB.Cohort.Root;

                            CB.MaintenanceRespiration(PlugIn.modelCore.Ecoregion[site], date);


                            if (siteoutput != null)
                            {
                                //System.Console.WriteLine("WriteCohortData\t" + site.ToString() + "\t" + date.ToString());
                                CohortOutput.WriteCohortData(date, site, canopy[canopylayer][coh], hydrology.Water);
                            }
                        }
                    }
                }
            }//IMAX
        }