SPECFEM3D solves linear seismic wave propagation (elastic, viscoelastic, poroelastic, fluid-solid) and dynamic rupture problems in heterogeneous 3D models. SPECFEM3D also implements imaging and FWI for such complex models based on an L-BFGS (Broyden-Fletcher-Goldfarb-Shanno) algorithm. Based on the high-order spectral-element (CG) discretization for unstructured hexahedral meshes. Scalable performance at Petascale (runs on the largest machines worldwide: Titan and Summit at Oak Ridge, Piz Daint, CURIE, K computer, etc.)