A new three-dimensional terrain-following tidal model of free-surface flows