Idealized numerical simulations are performed in order to get a deeper dynamical understanding of the socalled shallow fohn. This is a southerly gap flow which sometimes occurs in north-south oriented Alpine valleys under approximately westerly synoptic-scale flow conditions. Observations indicate that shallow fohn is primarily driven by a hydrostatic pressure difference between relatively cold air to the south of the Alps and warmer air to the north. A recent study suggested that the meridional pressure gradient associated with geostrophically balanced westerly wind also has the potential to induce significant shallow fohn. While this study is restricted to an infinitely long mountain ridge with a gap, various isolated ridges are considered in the present work. It is found that replacing the infinite ridge by an isolated one leads to fundamental changes in the behaviour of the gap Row if surface friction is excluded and the large-scale flow is taken to be uniform westerly. While strong southerly gap flow is found for the infinite ridge, weak northerly gap flow prevails for the isolated mountains. This is primarily because flow splitting and Coriolis effects yield-in the parameter range relevant for the Alps-strong anticyclonic flow around an isolated mountain. Due to ageostrophy, this anticyclonic flow is associated with a northerly flow component towards the northern side of the mountain, piling up some air there and compensating for or even reversing the geostrophic pressure gradient across the mountain. From that it follows that the mere presence of a geostrophic pressure gradient is not sufficient to induce shallow fohn. Surface friction yields a southerly flow component in the boundary layer and reinforces the pressure gradient across the mountain. Therefore, friction supports southerly gap flow and reduces the differences between infinite and isolated ridges. However, additional simulations with an arc-shaped mountain similar to the real Alps indicate a further reduction of the tendency towards southerly gap flow. This is due to a weak lee cyclone which forms to the east of the arc and reduces the cross-Alpine pressure gradient. A southerly component in the large-scale flow appears to be necessary to obtain southerly gap flow for the arc-shaped mountain. In this case, potentially cold low-level air is piled up on the southern side of the Alps, and a hydrostatic pressure difference across the Alps is established in accordance with observations.