Modeling local earthquakes as shear dislocations in a layered half space