A simple nonlinear filter which completely removes negative values from the multidimensional numerical fields is presented. This filter conserves total mass (sum of all elements in the field) with accuracy better than 0.0001%. Also, the maxima and shape of the filtered function are unaltered. Basically, the filter can be combined with an arbitrary method used for the numerical solution of the advection equation. Two-dimensional advective tests show that negative values are removed, and short waves are significantly damped with the pseudospectral method. The filtering algorithm is very simple. Additional computational time required by the filter is about 4% of that required by the pseudospectral method alone.