Example #1
0
        //---------------------------------------------------------------------
        

        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(PlugIns.ICore modelCore,
                                  double[,] establishProbabilities,
                                  SeedingAlgorithms seedAlg,
                                  Reproduction.Delegates.AddNewCohort addNewCohort)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm;
            switch (seedAlg)
            {
                case SeedingAlgorithms.NoDispersal:
                    algorithm = NoDispersal.Algorithm;
                    break;

                case SeedingAlgorithms.UniversalDispersal:
                    algorithm = UniversalDispersal.Algorithm;
                    break;

                case SeedingAlgorithms.WardSeedDispersal:
                    algorithm = WardSeedDispersal.Algorithm;
                    break;

                default:
                    throw new ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }

            Reproduction.Initialize(establishProbabilities, algorithm,
                                    addNewCohort == null ? null : new Reproduction.Delegates.AddNewCohort(addNewCohort));
        }
        //---------------------------------------------------------------------


        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(ICore modelCore,
                                  SeedingAlgorithms seedAlg)//,
                                  //Reproduction.Delegates.AddNewCohort addNewCohort)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm;
            switch (seedAlg)
            {
                case SeedingAlgorithms.NoDispersal:
                    algorithm = NoDispersal.Algorithm;
                    break;

                case SeedingAlgorithms.UniversalDispersal:
                    algorithm = UniversalDispersal.Algorithm;
                    break;

                case SeedingAlgorithms.WardSeedDispersal:
                    algorithm = WardSeedDispersal.Algorithm;
                    break;

                default:
                    throw new ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }

            Reproduction.Initialize(algorithm);
        }
		//---------------------------------------------------------------------

		/// <summary>
		/// Initializes the instance and its associated site variables.
		/// </summary>
		protected void Initialize(int                             timestep,
		                          double[,]                       establishProbabilities,
		                          int                             startTime,
		                          SeedingAlgorithms               seedAlg,
		                          Reproduction.AddNewCohortMethod addNewCohort)
		{
			this.timestep = timestep;
			this.nextTimeToRun = startTime - 1 + timestep;
			this.updateNextTimeToRun = false;

			SiteVars.Initialize();

			SeedingAlgorithm algorithm;
			switch (seedAlg) {
				case SeedingAlgorithms.NoDispersal:
					algorithm = NoDispersal.Algorithm;
					break;

				case SeedingAlgorithms.UniversalDispersal:
					algorithm = UniversalDispersal.Algorithm;
					break;

				case SeedingAlgorithms.WardSeedDispersal:
					algorithm = WardSeedDispersal.Algorithm;
					break;

				default:
					throw new ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
			}
			Reproduction.Initialize(establishProbabilities, algorithm, addNewCohort);
		}
Example #4
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(PlugIns.ICore modelCore,
                                  double[,]                           establishProbabilities,
                                  SeedingAlgorithms seedAlg,
                                  Reproduction.Delegates.AddNewCohort addNewCohort)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm;

            switch (seedAlg)
            {
            case SeedingAlgorithms.NoDispersal:
                algorithm = NoDispersal.Algorithm;
                break;

            case SeedingAlgorithms.UniversalDispersal:
                algorithm = UniversalDispersal.Algorithm;
                break;

            case SeedingAlgorithms.WardSeedDispersal:
                algorithm = WardSeedDispersal.Algorithm;
                break;

            default:
                throw new ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }
            Reproduction.Initialize(establishProbabilities, algorithm,
                                    addNewCohort == null ? null : new Reproduction.Delegates.AddNewCohort(addNewCohort));
        }
        //---------------------------------------------------------------------


        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(ICore modelCore,
                                  SeedingAlgorithms seedAlg)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm;

            switch (seedAlg)
            {
            case SeedingAlgorithms.NoDispersal:
                algorithm = NoDispersal.Algorithm;
                break;

            case SeedingAlgorithms.UniversalDispersal:
                algorithm = UniversalDispersal.Algorithm;
                break;

            case SeedingAlgorithms.WardSeedDispersal:
                algorithm = WardSeedDispersal.Algorithm;
                break;

            default:
                throw new ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }

            Reproduction.Initialize(algorithm);
        }
Example #6
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Gets the seeding algorithm identified by a particular value of the
        /// SeedingAlgorithms type.
        /// </summary>
        public static SeedingAlgorithm GetAlgorithm(SeedingAlgorithms seedAlg,
                                                    int successionTimestep)
        {
            SeedingAlgorithm algorithm;

            switch (seedAlg)
            {
            case SeedingAlgorithms.NoDispersal:
                algorithm = NoDispersal.Algorithm;
                break;

            case SeedingAlgorithms.UniversalDispersal:
                algorithm = UniversalDispersal.Algorithm;
                break;

            case SeedingAlgorithms.WardSeedDispersal:
                algorithm = WardSeedDispersal.Algorithm;
                break;

            case SeedingAlgorithms.DemographicSeeding:
                algorithm = new DemographicSeeding.Algorithm(successionTimestep).DoesSpeciesSeedSite;
                break;

            default:
                throw new System.ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }
            return(algorithm);
        }
        //---------------------------------------------------------------------

        /// <summary>
        /// Gets the seeding algorithm identified by a particular value of the
        /// SeedingAlgorithms type.
        /// </summary>
        public static SeedingAlgorithm GetAlgorithm(SeedingAlgorithms seedAlg,
                                                    int               successionTimestep)
        {
            SeedingAlgorithm algorithm;
            switch (seedAlg)
            {
                case SeedingAlgorithms.NoDispersal:
                    algorithm = NoDispersal.Algorithm;
                    break;

                case SeedingAlgorithms.UniversalDispersal:
                    algorithm = UniversalDispersal.Algorithm;
                    break;

                case SeedingAlgorithms.WardSeedDispersal:
                    algorithm = WardSeedDispersal.Algorithm;
                    break;

                case SeedingAlgorithms.DemographicSeeding:
                    algorithm = new DemographicSeeding.Algorithm(successionTimestep).DoesSpeciesSeedSite;
                    break;

                default:
                    throw new System.ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }
            return algorithm;
        }
Example #8
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(int timestep,
                                  double[,]                       establishProbabilities,
                                  int startTime,
                                  SeedingAlgorithms seedAlg,
                                  Reproduction.AddNewCohortMethod addNewCohort)
        {
            this.timestep            = timestep;
            this.nextTimeToRun       = startTime - 1 + timestep;
            this.updateNextTimeToRun = false;

            SiteVars.Initialize();

            SeedingAlgorithm algorithm;

            switch (seedAlg)
            {
            case SeedingAlgorithms.NoDispersal:
                algorithm = NoDispersal.Algorithm;
                break;

            case SeedingAlgorithms.UniversalDispersal:
                algorithm = UniversalDispersal.Algorithm;
                break;

            case SeedingAlgorithms.WardSeedDispersal:
                algorithm = WardSeedDispersal.Algorithm;
                break;

            default:
                throw new ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }
            Reproduction.Initialize(establishProbabilities, algorithm, addNewCohort);
        }
 //---------------------------------------------------------------------
 public Parameters(int               timestep,
                   SeedingAlgorithms seedAlgorithm,
                   double[,]         establishProbabilities)
 {
     this.timestep = timestep;
     this.seedAlg = seedAlgorithm;
     this.establishProbs = establishProbabilities;
 }
        //---------------------------------------------------------------------


        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(ICore modelCore,
                                  SeedingAlgorithms seedAlg)//,
                                  //Reproduction.Delegates.AddNewCohort addNewCohort)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm = SeedingAlgorithmsUtil.GetAlgorithm(seedAlg,
                                                                            Timestep);
            Reproduction.Initialize(algorithm);
        }
        //---------------------------------------------------------------------


        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(ICore modelCore,
                                  SeedingAlgorithms seedAlg)//,
        //Reproduction.Delegates.AddNewCohort addNewCohort)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm = SeedingAlgorithmsUtil.GetAlgorithm(seedAlg,
                                                                            Timestep);

            Reproduction.Initialize(algorithm);
        }
Example #12
0
        protected void Initialize(PlugIns.ICore modelCore,
                                  double[,]                       establishProbabilities,
                                  SeedingAlgorithms seedAlg,
                                  Reproduction.AddNewCohortMethod addNewCohort)
        {
            Reproduction.Delegates.AddNewCohort wrappedMethod =
                delegate(ISpecies species,
                         ActiveSite site)
            {
                addNewCohort(species, site);
            };
            Initialize(modelCore, establishProbabilities, seedAlg, wrappedMethod);
            //new Reproduction.Delegates.AddNewCohort(addNewCohort));
//                       System.Delegate.CreateDelegate(typeof (Reproduction.Delegates.AddNewCohort),
//                                                     addNewCohort.Method));
        }
Example #13
0
        protected void Initialize(PlugIns.ICore                   modelCore,
                                  double[,]                       establishProbabilities,
                                  SeedingAlgorithms               seedAlg,
                                  Reproduction.AddNewCohortMethod addNewCohort)
        {
            Reproduction.Delegates.AddNewCohort wrappedMethod =
                delegate(ISpecies   species,
                         ActiveSite site)
            {
                addNewCohort(species, site);
            };
            Initialize(modelCore, establishProbabilities, seedAlg, wrappedMethod);
                       //new Reproduction.Delegates.AddNewCohort(addNewCohort));
//                       System.Delegate.CreateDelegate(typeof (Reproduction.Delegates.AddNewCohort),
//                                                     addNewCohort.Method));
        }
 //---------------------------------------------------------------------
 public Parameters(int                                         timestep,
     SeedingAlgorithms                           seedAlgorithm,
     Ecoregions.AuxParm<Percentage>[]            minRelativeBiomass,
     Species.AuxParm<double>                     leafLongevity,
     Species.AuxParm<double>                     woodyDecayRate,
     Species.AuxParm<double>                     mortCurveShapeParm,
     Species.AuxParm<Ecoregions.AuxParm<double>> establishProbability,
     Species.AuxParm<Ecoregions.AuxParm<int>>    maxANPP,
     Species.AuxParm<Ecoregions.AuxParm<double>> leafLitterDecayRate,
     string                                      ageOnlyDisturbanceParms)
 {
     this.timestep = timestep;
     this.seedAlg = seedAlgorithm;
     this.minRelativeBiomass = minRelativeBiomass;
     this.leafLongevity = leafLongevity;
     this.woodyDecayRate = woodyDecayRate;
     this.mortCurveShapeParm = mortCurveShapeParm;
     this.establishProbability = establishProbability;
     this.maxANPP = maxANPP;
     this.leafLitterDecayRate = leafLitterDecayRate;
     this.ageOnlyDisturbanceParms = ageOnlyDisturbanceParms;
 }
 //---------------------------------------------------------------------
 public Parameters(int                                         timestep,
     SeedingAlgorithms                           seedAlgorithm,
     Ecoregions.AuxParm<Percentage>[]            minRelativeBiomass,
     Species.AuxParm<double>                     leafLongevity,
     Species.AuxParm<double>                     woodyDecayRate,
     Species.AuxParm<double>                     mortCurveShapeParm,
     Species.AuxParm<Ecoregions.AuxParm<double>> establishProbability,
     Species.AuxParm<Ecoregions.AuxParm<int>>    maxANPP,
     Species.AuxParm<Ecoregions.AuxParm<double>> leafLitterDecayRate,
     string                                      ageOnlyDisturbanceParms,
     List<ClimateChange.ParametersUpdate>        climateChangeUpdates)
     : base(minRelativeBiomass,
            leafLongevity,
            woodyDecayRate,
            mortCurveShapeParm,
            establishProbability,
            maxANPP,
            leafLitterDecayRate)
 {
     this.timestep = timestep;
     this.seedAlg = seedAlgorithm;
     this.ageOnlyDisturbanceParms = ageOnlyDisturbanceParms;
     this.climateChangeUpdates = climateChangeUpdates;
 }
Example #16
0
        //---------------------------------------------------------------------
        public override void Initialize()
        {
            PlugIn.ModelCore.UI.WriteLine("Initializing " + Names.ExtensionName + " version " + typeof(PlugIn).Assembly.GetName().Version);
            Cohort.DeathEvent += DeathEvent;
            Globals.InitializeCore(ModelCore, ((Parameter <ushort>)Names.GetParameter(Names.IMAX)).Value);
            EcoregionData.Initialize();
            SiteVars.Initialize();

            Landis.Utilities.Directory.EnsureExists("output");

            Timestep = ((Parameter <int>)Names.GetParameter(Names.Timestep)).Value;
            Parameter <string> CohortBinSizeParm = null;

            if (Names.TryGetParameter(Names.CohortBinSize, out CohortBinSizeParm))
            {
                if (Int32.TryParse(CohortBinSizeParm.Value, out CohortBinSize))
                {
                    if (CohortBinSize < Timestep)
                    {
                        throw new System.Exception("CohortBinSize cannot be smaller than Timestep.");
                    }
                    else
                    {
                        PlugIn.ModelCore.UI.WriteLine("Succession timestep = " + Timestep + "; CohortBinSize = " + CohortBinSize + ".");
                    }
                }
                else
                {
                    throw new System.Exception("CohortBinSize is not an integer value.");
                }
            }
            else
            {
                CohortBinSize = Timestep;
            }

            string Parallel = ((Parameter <string>)Names.GetParameter(Names.Parallel)).Value;

            if (Parallel == "false")
            {
                ParallelThreads = 1;
                PlugIn.ModelCore.UI.WriteLine("  MaxParallelThreads = " + ParallelThreads.ToString() + ".");
            }
            else if (Parallel == "true")
            {
                ParallelThreads = -1;
                PlugIn.ModelCore.UI.WriteLine("  MaxParallelThreads determined by system.");
            }
            else
            {
                if (Int32.TryParse(Parallel, out ParallelThreads))
                {
                    if (ParallelThreads < 1)
                    {
                        throw new System.Exception("Parallel cannot be < 1.");
                    }
                    else
                    {
                        PlugIn.ModelCore.UI.WriteLine("  MaxParallelThreads = " + ParallelThreads.ToString() + ".");
                    }
                }
                else
                {
                    throw new System.Exception("Parallel must be 'true', 'false' or an integer >= 1.");
                }
            }
            this.ThreadCount = ParallelThreads;

            FTimeStep = 1.0F / Timestep;

            //Latitude = ((Parameter<float>)PlugIn.GetParameter(Names.Latitude, 0, 90)).Value; // Now an ecoregion parameter

            ObservedClimate.Initialize();
            SpeciesPnET = new SpeciesPnET();
            Landis.Library.PnETCohorts.SpeciesParameters.LoadParameters(SpeciesPnET);

            Hydrology.Initialize();
            SiteCohorts.Initialize();
            string PARunits = ((Parameter <string>)Names.GetParameter(Names.PARunits)).Value;

            if (PARunits != "umol" && PARunits != "W/m2")
            {
                throw new System.Exception("PARunits are not 'umol' or 'W/m2'.");
            }
            InitializeClimateLibrary(); // John McNabb: initialize climate library after EcoregionPnET has been initialized
            //EstablishmentProbability.Initialize(Timestep);  // Not used

            // Initialize Reproduction routines:
            Reproduction.SufficientResources = SufficientResources;
            Reproduction.Establish           = Establish;
            Reproduction.AddNewCohort        = AddNewCohort;
            Reproduction.MaturePresent       = MaturePresent;
            Reproduction.PlantingEstablish   = PlantingEstablish;
            SeedingAlgorithms SeedAlgorithm = (SeedingAlgorithms)Enum.Parse(typeof(SeedingAlgorithms), Names.parameters["SeedingAlgorithm"].Value);

            base.Initialize(ModelCore, SeedAlgorithm);

            StartDate = new DateTime(((Parameter <int>)Names.GetParameter(Names.StartYear)).Value, 1, 15);

            PlugIn.ModelCore.UI.WriteLine("Spinning up biomass or reading from maps...");

            string InitialCommunitiesTXTFile = Names.GetParameter(Names.InitialCommunities).Value;
            string InitialCommunitiesMapFile = Names.GetParameter(Names.InitialCommunitiesMap).Value;

            InitialCommunitiesSpinup = Names.GetParameter(Names.InitialCommunitiesSpinup).Value;
            Parameter <string> LitterMapFile;
            bool litterMapFile = Names.TryGetParameter(Names.LitterMap, out LitterMapFile);
            Parameter <string> WoodyDebrisMapFile;
            bool woodyDebrisMapFile = Names.TryGetParameter(Names.WoodyDebrisMap, out WoodyDebrisMapFile);

            InitializeSites(InitialCommunitiesTXTFile, InitialCommunitiesMapFile, ModelCore);
            if (litterMapFile)
            {
                MapReader.ReadLitterFromMap(LitterMapFile.Value);
            }
            if (woodyDebrisMapFile)
            {
                MapReader.ReadWoodyDebrisFromMap(WoodyDebrisMapFile.Value);
            }

            // Convert PnET cohorts to biomasscohorts
            ISiteVar <Landis.Library.BiomassCohorts.ISiteCohorts> biomassCohorts = PlugIn.ModelCore.Landscape.NewSiteVar <Landis.Library.BiomassCohorts.ISiteCohorts>();

            foreach (ActiveSite site in PlugIn.ModelCore.Landscape)
            {
                biomassCohorts[site] = SiteVars.SiteCohorts[site];

                if (SiteVars.SiteCohorts[site] != null && biomassCohorts[site] == null)
                {
                    throw new System.Exception("Cannot convert PnET SiteCohorts to biomass site cohorts");
                }
            }
            ModelCore.RegisterSiteVar(biomassCohorts, "Succession.BiomassCohorts");

            ISiteVar <Landis.Library.AgeOnlyCohorts.ISiteCohorts> AgeCohortSiteVar = PlugIn.ModelCore.Landscape.NewSiteVar <Landis.Library.AgeOnlyCohorts.ISiteCohorts>();
            ISiteVar <ISiteCohorts> PnETCohorts = PlugIn.ModelCore.Landscape.NewSiteVar <ISiteCohorts>();

            foreach (ActiveSite site in PlugIn.ModelCore.Landscape)
            {
                AgeCohortSiteVar[site]   = SiteVars.SiteCohorts[site];
                PnETCohorts[site]        = SiteVars.SiteCohorts[site];
                SiteVars.FineFuels[site] = SiteVars.Litter[site].Mass;
                IEcoregionPnET ecoregion = EcoregionData.GetPnETEcoregion(PlugIn.ModelCore.Ecoregion[site]);
                IHydrology     hydrology = new Hydrology(ecoregion.FieldCap);
                SiteVars.PressureHead[site] = hydrology.GetPressureHead(ecoregion);
                if (UsingClimateLibrary)
                {
                    SiteVars.ExtremeMinTemp[site] = ((float)Enumerable.Min(Climate.Future_MonthlyData[Climate.Future_MonthlyData.Keys.Min()][ecoregion.Index].MonthlyTemp) - (float)(3.0 * ecoregion.WinterSTD));
                }
                else
                {
                    SiteVars.ExtremeMinTemp[site] = 999;
                }
            }

            ModelCore.RegisterSiteVar(AgeCohortSiteVar, "Succession.AgeCohorts");
            ModelCore.RegisterSiteVar(PnETCohorts, "Succession.CohortsPnET");
        }
        public override void Initialize()
        {
            PlugIn.ModelCore.UI.WriteLine("Initializing " + Names.ExtensionName + " version " + typeof(PlugIn).Assembly.GetName().Version);
            Cohort.DeathEvent += DeathEvent;

            Litter         = PlugIn.ModelCore.Landscape.NewSiteVar <Landis.Library.Biomass.Pool>();
            WoodyDebris    = PlugIn.ModelCore.Landscape.NewSiteVar <Landis.Library.Biomass.Pool>();
            sitecohorts    = PlugIn.ModelCore.Landscape.NewSiteVar <SiteCohorts>();
            FineFuels      = ModelCore.Landscape.NewSiteVar <Double>();
            PressureHead   = ModelCore.Landscape.NewSiteVar <float>();
            ExtremeMinTemp = ModelCore.Landscape.NewSiteVar <float>();
            Landis.Utilities.Directory.EnsureExists("output");

            Timestep = ((Parameter <int>)GetParameter(Names.Timestep)).Value;
            Parameter <string> CohortBinSizeParm = null;

            if (TryGetParameter(Names.CohortBinSize, out CohortBinSizeParm))
            {
                if (Int32.TryParse(CohortBinSizeParm.Value, out CohortBinSize))
                {
                    if (CohortBinSize < Timestep)
                    {
                        throw new System.Exception("CohortBinSize cannot be smaller than Timestep.");
                    }
                    else
                    {
                        PlugIn.ModelCore.UI.WriteLine("Succession timestep = " + Timestep + "; CohortBinSize = " + CohortBinSize + ".");
                    }
                }
                else
                {
                    throw new System.Exception("CohortBinSize is not an integer value.");
                }
            }
            else
            {
                CohortBinSize = Timestep;
            }


            FTimeStep = 1.0F / Timestep;

            //Latitude = ((Parameter<float>)PlugIn.GetParameter(Names.Latitude, 0, 90)).Value; // Now an ecoregion parameter

            ObservedClimate.Initialize();

            SpeciesPnET = new SpeciesPnET();

            EcoregionPnET.Initialize();
            Hydrology.Initialize();
            SiteCohorts.Initialize();

            // John McNabb: initialize climate library after EcoregionPnET has been initialized
            InitializeClimateLibrary();

            EstablishmentProbability.Initialize(Timestep);

            IMAX = ((Parameter <ushort>)GetParameter(Names.IMAX)).Value;
            //LeakageFrostDepth = ((Parameter<float>)GetParameter(Names.LeakageFrostDepth)).Value; //Now an ecoregion parameter
            //PrecipEvents = ((Parameter<float>)GetParameter(Names.PrecipEvents)).Value;// Now an ecoregion parameter


            // Initialize Reproduction routines:
            Reproduction.SufficientResources = SufficientResources;
            Reproduction.Establish           = Establish;
            Reproduction.AddNewCohort        = AddNewCohort;
            Reproduction.MaturePresent       = MaturePresent;
            Reproduction.PlantingEstablish   = PlantingEstablish;


            SeedingAlgorithms SeedAlgorithm = (SeedingAlgorithms)Enum.Parse(typeof(SeedingAlgorithms), parameters["SeedingAlgorithm"].Value);

            base.Initialize(ModelCore, SeedAlgorithm);


            StartDate = new DateTime(((Parameter <int>)GetParameter(Names.StartYear)).Value, 1, 15);

            PlugIn.ModelCore.UI.WriteLine("Spinning up biomass or reading from maps...");

            string             InitialCommunitiesTXTFile = GetParameter(Names.InitialCommunities).Value;
            string             InitialCommunitiesMapFile = GetParameter(Names.InitialCommunitiesMap).Value;
            Parameter <string> LitterMapFile;
            bool litterMapFile = TryGetParameter(Names.LitterMap, out LitterMapFile);
            Parameter <string> WoodyDebrisMapFile;
            bool woodyDebrisMapFile = TryGetParameter(Names.WoodyDebrisMap, out WoodyDebrisMapFile);

            //Console.ReadLine();
            InitializeSites(InitialCommunitiesTXTFile, InitialCommunitiesMapFile, ModelCore);
            if (litterMapFile)
            {
                MapReader.ReadLitterFromMap(LitterMapFile.Value);
            }
            if (woodyDebrisMapFile)
            {
                MapReader.ReadWoodyDebrisFromMap(WoodyDebrisMapFile.Value);
            }

            // Convert PnET cohorts to biomasscohorts
            ISiteVar <Landis.Library.BiomassCohorts.ISiteCohorts> biomassCohorts = PlugIn.ModelCore.Landscape.NewSiteVar <Landis.Library.BiomassCohorts.ISiteCohorts>();


            foreach (ActiveSite site in PlugIn.ModelCore.Landscape)
            {
                biomassCohorts[site] = sitecohorts[site];

                if (sitecohorts[site] != null && biomassCohorts[site] == null)
                {
                    throw new System.Exception("Cannot convert PnET SiteCohorts to biomass site cohorts");
                }
            }
            ModelCore.RegisterSiteVar(biomassCohorts, "Succession.BiomassCohorts");
            ModelCore.RegisterSiteVar(WoodyDebris, "Succession.WoodyDebris");
            ModelCore.RegisterSiteVar(Litter, "Succession.Litter");


            ISiteVar <Landis.Library.AgeOnlyCohorts.ISiteCohorts> AgeCohortSiteVar = PlugIn.ModelCore.Landscape.NewSiteVar <Landis.Library.AgeOnlyCohorts.ISiteCohorts>();
            ISiteVar <ISiteCohorts> PnETCohorts = PlugIn.ModelCore.Landscape.NewSiteVar <ISiteCohorts>();


            foreach (ActiveSite site in PlugIn.ModelCore.Landscape)
            {
                AgeCohortSiteVar[site] = sitecohorts[site];
                PnETCohorts[site]      = sitecohorts[site];
                FineFuels[site]        = Litter[site].Mass;
                IEcoregionPnET ecoregion = EcoregionPnET.GetPnETEcoregion(PlugIn.ModelCore.Ecoregion[site]);
                IHydrology     hydrology = new Hydrology(ecoregion.FieldCap);
                PressureHead[site] = hydrology.GetPressureHead(ecoregion);
                if (UsingClimateLibrary)
                {
                    ExtremeMinTemp[site] = ((float)Enumerable.Min(Climate.Future_MonthlyData[Climate.Future_MonthlyData.Keys.Min()][ecoregion.Index].MonthlyTemp) - (float)(3.0 * ecoregion.WinterSTD));
                }
                else
                {
                    ExtremeMinTemp[site] = 999;
                }
            }

            ModelCore.RegisterSiteVar(AgeCohortSiteVar, "Succession.AgeCohorts");
            ModelCore.RegisterSiteVar(PnETCohorts, "Succession.CohortsPnET");
            ModelCore.RegisterSiteVar(FineFuels, "Succession.FineFuels");
            ModelCore.RegisterSiteVar(PressureHead, "Succession.PressureHead");
            ModelCore.RegisterSiteVar(ExtremeMinTemp, "Succession.ExtremeMinTemp");
        }