A wetting and drying algorithm with a combined pressure/free-surface formulation for non-hydrostatic models