A spectral model of the zonally averaged circulation in the middle atmosphere