Numerical models that are used in four-dimensional data assimilation (FDDA) involve on-off switches associated with physical processes. Mathematically these on–off switches are represented by first-order discontinuous functions or step functions. In the development of the adjoint for the variational FDDA, the numerical models must be linearized. While insight has been gained into how to handle the on–off switches represented by first-order discontinuous functions, it is still unclear how to deal with the switches represented by step functions when the model equations are linearized. In this study, the calculus of variations is applied to under-stand how to treat step functions in the development of the adjoint. It is shown that in theory, if adding small perturbations to the initial state does not change the grid points in a forecast model where switching occurs, there is no difficulty in dealing with both first-order discontinuous points and the discontinuous points represented by step functions. However, in practice, first-order discontinuous points are much easier to deal with than those described by step functions.