Ejemplo n.º 1
0
        public void Run(Clock clock, IClimateN2OCycleState state, IDimensions dimensions)
        {
            // create shortcuts for commonly accessed data
            var s = state;
            var t = clock.Current;

            if (clock.IsFirstTimestep)
            {
                s.n2odecay = 1.0 / s.lifen2o;

                s.acn2o[t] = 296;
            }
            else
            {
                // Calculate N2O concentrations
                s.acn2o[t] = s.acn2o[t - 1] + 0.2079 * s.globn2o[t] - s.n2odecay * (s.acn2o[t - 1] - s.n2opre);

                if (s.acn2o[t] < 0)
                    throw new ApplicationException("n2o atmospheric concentration out of range");
            }
        }
Ejemplo n.º 2
0
        public void Run(Clock clock, IClimateN2OCycleState state, IDimensions dimensions)
        {
            // create shortcuts for commonly accessed data
            var s = state;
            var t = clock.Current;

            if (clock.IsFirstTimestep)
            {
                s.n2odecay = 1.0 / s.lifen2o;

                s.acn2o[t] = 296;
            }
            else
            {
                // Calculate N2O concentrations
                s.acn2o[t] = s.acn2o[t - 1] + 0.2079 * s.globn2o[t] - s.n2odecay * (s.acn2o[t - 1] - s.n2opre);

                if (s.acn2o[t] < 0)
                {
                    throw new ApplicationException("n2o atmospheric concentration out of range");
                }
            }
        }