Numerical solution of the atmospheric diffusion equation for chemically reacting flows