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

            if (clock.IsFirstTimestep)
            {
                s.ch4decay = 1.0 / s.lifech4;

                s.acch4[t] = 1222.0;
            }
            else
            {
                // Calculate CH4 concentrations
                s.acch4[t] = s.acch4[t - 1] + 0.3597 * s.globch4[t] - s.ch4decay * (s.acch4[t - 1] - s.ch4pre);

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

            if (clock.IsFirstTimestep)
            {
                s.ch4decay = 1.0 / s.lifech4;

                s.acch4[t] = 1222.0;
            }
            else
            {
                // Calculate CH4 concentrations
                s.acch4[t] = s.acch4[t - 1] + 0.3597 * s.globch4[t] - s.ch4decay * (s.acch4[t - 1] - s.ch4pre);

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