Planetary wave response to surface forcing and to instability in the presence of mean flow and topography