Ignition of MHD shocks associated with solar flares