In a layered ocean circulation model, the vertical coordinate is a quantity related to density, and in a vertical discretization the fluid can be approximated as a stack of layers of constant density. Depending on the dynamics of the flow, one or more of these layers can be reduced to near-zero thickness in certain regions. In a discontinuous Galerkin (DG) algorithm, this situation requires a suitable use of limiters and a suitable implementation of horizontal viscosity. In the present work, the viscosity is implemented via the "local DG" method, as adapted to a barotropic-baroclinic time splitting that is used to address the multiple time scales (external and internal) that are present in ocean dynamics. It will be shown that one aspect of this method amounts to differentiating by integration.