Earthquake-induced liquefaction and subsidence of granular media