Evolution of convection in a layered porous medium