Water dynamics in a gradually nonhomogeneous soil described by the linearized Richards equation