Geochemical and geodynamical constraints on subduction zone magmatism