A numerical model of the zonally averaged dynamical and chemical structure of the middle atmosphere