コード例 #1
0
        public static void GrowCohorts(ActiveSite site,
                                       DateTime Time,
                                       DateTime ToTime,
                                       bool issuccessionTimestep)
        {
            if (PlugIn.Cohorts[site] == null)
            {
                return;
            }

            while (Time.CompareTo(ToTime) < 0)
            {
                if (Time.Month == 1)
                {
                    if (issuccessionTimestep && tstep > 1)//&& ClimateDependentData.Data[PlugIn.Date[site]] != null
                    {
                        PlugIn.Cohorts[site].CombineCohorts(site, tstep, Time.Year);
                    }

                    CanopyBiomass.SubCanopyPARmax[site] = float.MinValue;
                    Hydrology.AnnualTranspiration[site] = 0;

                    //CanopyBiomass.DefineAgeLayers(site);
                    CanopyBiomass.DefineBiomassLayers(site);

                    CanopyBiomass.CanopyLAI[site] = 0;
                    PlugIn.Cohorts[site].IncrementCohortsAge();
                }

                Hydrology.UpdateSiteHydrology(Time, site);

                CanopyBiomass.SimulateCanopy(Time, site);

                if (issuccessionTimestep)
                {
                    EstablishmentProbability.Compute(Time, site);
                }

                ForestFloor.Decomposition(site);

                SiteOutput.UpdateSiteData(Time, site);
                CanopyBiomass.GrossPsn[site] = 0;
                CanopyBiomass.NetPsn[site]   = 0;
                CanopyBiomass.AutotrophicRespiration[site] = 0;
                ForestFloor.HeterotrophicRespiration[site] = 0;
                Hydrology.Transpiration[site] = 0;

                Time = Time.AddMonths(1);
            }
            CanopyBiomass.RemoveDeadCohorts(site);

            PlugIn.Cohorts[site].UpdateMaturePresent();

            SiteOutput.WriteSiteData(site);

            DisturbanceDefoliation.Defoliate(site);
        }
コード例 #2
0
        public void GrowCohorts(DateTime date,
                                DateTime ToTime,
                                bool issuccessionTimestep)
        {
            if (Cohorts == null)
            {
                return;
            }


            while (date.CompareTo(ToTime) < 0)
            {
                PlugIn.SetYear(date.Year);

                if (date.Month == (int)Months.January || canopy == null)
                {
                    canopylaimax = 0;

                    if (cohorts == null)
                    {
                        return;
                    }
                }
                if (date.Month == (int)Months.June)
                {
                    Defoliate(site);
                }

                hydrology.UpdateSiteHydrology(date);

                canopy.Grow(date, site, hydrology, forestfloor, cohorts, siteoutput);

                canopylaimax = canopy.CanopyLAImax;

                foreach (Cohort cohort in canopy.DeadCohorts)
                {
                    DeadCohortAges[cohort.Species].Add(cohort.Age);
                    deadcohorts[cohort.Species]++;
                    Cohorts[cohort.Species].RemoveCohort(cohort, site, null);

                    canopy.ResetDeadCohorts();
                }

                if (issuccessionTimestep)
                {
                    Establishment.ComputeEstablishment(date, this);

                    if (HasSiteOutput)
                    {
                        estoutput.UpdateEstData(date, this);
                    }
                }

                if (HasSiteOutput)
                {
                    siteoutput.UpdateSiteData(date, this);
                    siteoutput.WriteSiteData();
                }
                if (date.Month == (int)Months.December)
                {
                    Cohorts.IncrementCohortsAge();

                    forestfloor.Decompose();
                    forestfloor.Decompose();
                }
                date = date.AddMonths(1);
            }
            if (CohortBiomass.HasDeadCohorts)
            {
                CohortBiomass.HasDeadCohorts = false;
            }
        }