Semi-Implicit Formulations of the Navier--Stokes Equations: Application to Nonhydrostatic Atmospheric Modeling