Edge-driven convection (EDC) forms in the upper mantle at locations of lithosphere thickness gradients, e.g., craton edges. In this study we show how the traditional style of EDC, a convection cell governed by the cold downwelling below an edge alternates with another style of EDC, in which the convection cell forms as a secondary feature with a hot asthenospheric shear flow from underneath the thicker lithosphere. These alternating EDC styles produce episodic lithosphere erosion and decompression melting. Three-dimensional models of EDC show that convection rolls form perpendicular to the thickness gradient at the lithosphere-asthenosphere boundary. Stagnant-lid convection scaling laws are used to gain further insight in the underlying physical processes. Application of our models to the Moroccan Atlas mountains region shows that the combination of these two styles of EDC can reproduce many of the observations from the Atlas mountains, including two distinct periods of Cenozoic volcanism, a semicontinuous corridor of thinned lithosphere under the Atlas mountains, and piecewise delamination of the lithosphere. A very good match between observations and numerical models is found for the lithosphere thicknesses across the study area, amounts of melts produced, and the length of the quiet gap in between volcanic episodes show quantitative match to observations.