示例#1
0
        private void OnDoSoilOrganicMatter(object sender, EventArgs e)
        {
            // Get potential residue decomposition from surfaceom.
            SurfaceOrganicMatterDecompType SurfaceOrganicMatterDecomp = SurfaceOrganicMatter.PotentialDecomposition();

            foreach (soilCNPatch aPatch in Patch)
            {
                aPatch.OnPotentialResidueDecompositionCalculated(SurfaceOrganicMatterDecomp);
            }

            num_residues = SurfaceOrganicMatterDecomp.Pool.Length;

            sw_dep = Soil.Water;

            // update soil temperature
            if (use_external_st)
            {
                Tsoil = ave_soil_temp;
            }
            else
            {
                // initialise soil temperature
                if (simpleST == null)
                {
                    simpleST = new simpleSoilTemp(MetFile.Latitude, MetFile.Tav, MetFile.Amp, MetFile.MinT, MetFile.MaxT);
                }

                Tsoil = simpleST.SoilTemperature(Clock.Today, MetFile.MinT, MetFile.MaxT, MetFile.Radn, salb, dlayer, bd, ll15_dep, sw_dep);
            }

            // calculate C and N processes
            //    - Assesses potential decomposition of surface residues;
            //		. adjust decomposition if needed;
            //		. accounts for mineralisation/immobilisation of N;
            //	  - Compute the transformations on soil organic matter (including N mineralisation/immobilition);
            //    - Calculates hydrolysis of urea, nitrification, and denitrification;
            for (int k = 0; k < Patch.Count; k++)
            {
                Patch[k].Process();
            }

            // send actual decomposition back to surface OM
            if (!is_pond_active)
            {
                SendActualResidueDecompositionCalculated();
            }
        }
示例#2
0
        /// <summary>Reset the state values to those set during the initialisation</summary>
        public void Reset()
        {
            inReset = true;

            // Save present state
            SaveState();

            // reset the size of arrays - so it zeroes them
            ResizeLayerArrays(dlayer.Length);

            // reset patches
            Patch.Clear();
            soilCNPatch newPatch = new soilCNPatch(this);

            Patch.Add(newPatch);

            foreach (soilCNPatch aPatch in Patch)
            {
                aPatch.ResizeLayerArrays(dlayer.Length);
            }

            // reset C and N variables to their initial state
            oc      = OC_reset;
            NO3ppm  = no3ppm_reset;
            NH4ppm  = nh4ppm_reset;
            ureappm = ureappm_reset;

            // perform initial calculations and setup
            InitCalc();

            // reset soil temperature
            if (!use_external_st)
            {
                simpleST = new simpleSoilTemp(MetFile.Latitude, MetFile.Tav, MetFile.Amp, MetFile.MinT, MetFile.MaxT);
                Tsoil    = simpleST.SoilTemperature(Clock.Today, MetFile.MinT, MetFile.MaxT, MetFile.Radn, salb, dlayer, bd, ll15_dep, sw_dep);
            }

            // get the changes of state and publish (let other component to know)
            DeltaState();

            inReset = false;
        }
示例#3
0
        private void OnDoSoilOrganicMatter(object sender, EventArgs e)
        {
            // Get potential residue decomposition from surfaceom.
            SurfaceOrganicMatterDecompType SurfaceOrganicMatterDecomp = SurfaceOrganicMatter.PotentialDecomposition();

            foreach (soilCNPatch aPatch in Patch)
                aPatch.OnPotentialResidueDecompositionCalculated(SurfaceOrganicMatterDecomp);

            num_residues = SurfaceOrganicMatterDecomp.Pool.Length;

            sw_dep = Soil.Water;

            // update soil temperature
            if (use_external_st)
                Tsoil = ave_soil_temp;
            else
            {
                // initialise soil temperature
                if (simpleST == null)
                    simpleST = new simpleSoilTemp(MetFile.Latitude, MetFile.Tav, MetFile.Amp, MetFile.MinT, MetFile.MaxT);

                Tsoil = simpleST.SoilTemperature(Clock.Today, MetFile.MinT, MetFile.MaxT, MetFile.Radn, salb, dlayer, bd, ll15_dep, sw_dep);
            }

            // calculate C and N processes
            //    - Assesses potential decomposition of surface residues;
            //		. adjust decomposition if needed;
            //		. accounts for mineralisation/immobilisation of N;
            //	  - Compute the transformations on soil organic matter (including N mineralisation/immobilition);
            //    - Calculates hydrolysis of urea, nitrification, and denitrification;
            for (int k = 0; k < Patch.Count; k++)
                Patch[k].Process();

            // send actual decomposition back to surface OM
            if (!is_pond_active)
                SendActualResidueDecompositionCalculated();
        }
示例#4
0
        /// <summary>Reset the state values to those set during the initialisation</summary>
        public void Reset()
        {
            inReset = true;

            // Save present state
            SaveState();

            // reset the size of arrays - so it zeroes them
            ResizeLayerArrays(dlayer.Length);

            // reset patches
            Patch.Clear();
            soilCNPatch newPatch = new soilCNPatch(this);
            Patch.Add(newPatch);

            foreach (soilCNPatch aPatch in Patch)
                aPatch.ResizeLayerArrays(dlayer.Length);

            // reset C and N variables to their initial state
            oc = OC_reset;
            NO3ppm = no3ppm_reset;
            NH4ppm = nh4ppm_reset;
            ureappm = ureappm_reset;

            // perform initial calculations and setup
            InitCalc();

            // reset soil temperature
            if (!use_external_st)
            {
                simpleST = new simpleSoilTemp(MetFile.Latitude, MetFile.Tav, MetFile.Amp, MetFile.MinT, MetFile.MaxT);
                Tsoil = simpleST.SoilTemperature(Clock.Today, MetFile.MinT, MetFile.MaxT, MetFile.Radn, salb, dlayer, bd, ll15_dep, sw_dep);
            }

            // get the changes of state and publish (let other component to know)
            DeltaState();

            inReset = false;
        }