A multiscale multilayer vertically integrated model with vertical dynamics for CO2 sequestration in layered geological formations