Esempio n. 1
0
        /// <summary>Send an energy balance event</summary>
        private void SendEnergyBalanceEvent()
        {
            for (int j = 0; j <= Canopies.Count - 1; j++)
            {
                CanopyType componentData = Canopies[j];

                if (componentData.Canopy != null)
                {
                    CanopyEnergyBalanceInterceptionlayerType[] lightProfile = new CanopyEnergyBalanceInterceptionlayerType[numLayers];
                    double totalPotentialEp = 0;
                    double totalInterception = 0.0;
                    for (int i = 0; i <= numLayers - 1; i++)
                    {
                        lightProfile[i] = new CanopyEnergyBalanceInterceptionlayerType();
                        lightProfile[i].thickness = Convert.ToSingle(DeltaZ[i]);
                        lightProfile[i].amount = Convert.ToSingle(componentData.Rs[i] * RadnGreenFraction(j));
                        totalPotentialEp += componentData.PET[i];
                        totalInterception += componentData.interception[i];
                    }

                    componentData.Canopy.PotentialEP = totalPotentialEp;
                    componentData.Canopy.LightProfile = lightProfile;
                }
            }
        }
Esempio n. 2
0
        /// <summary>Send an energy balance event</summary>
        private void SetCanopyEnergyTerms(MicroClimateZone MCZone)
        {
            for (int j = 0; j <= MCZone.Canopies.Count - 1; j++)
            {
                if (MCZone.Canopies[j].Canopy != null)
                {
                    CanopyEnergyBalanceInterceptionlayerType[] lightProfile = new CanopyEnergyBalanceInterceptionlayerType[MCZone.numLayers];
                    double totalPotentialEp = 0;
                    double totalInterception = 0.0;
                    for (int i = 0; i <= MCZone.numLayers - 1; i++)
                    {
                        lightProfile[i] = new CanopyEnergyBalanceInterceptionlayerType();
                        lightProfile[i].thickness = MCZone.DeltaZ[i];
                        lightProfile[i].amount = MCZone.Canopies[j].Rs[i] * MCZone.RadnGreenFraction(j);
                        totalPotentialEp += MCZone.Canopies[j].PET[i];
                        totalInterception += MCZone.Canopies[j].interception[i];
                    }

                    MCZone.Canopies[j].Canopy.PotentialEP = totalPotentialEp;
                    MCZone.Canopies[j].Canopy.LightProfile = lightProfile;
                }
            }
        }