Devices are provided comprising one or more insulated hollow vertical pipes inserted into a bed of soil, each pipe having a descending and an ascending conductive element forming a loop within the interior of the pipe. A plurality of such vertical pipes can be attached to a straight pipe, forming a two dimensional array of vertical pipes, in which the loops are connected in series. Further, a series of such one-dimensional straight pipes can be attached together to provide a two-dimensional array. When vertical pipes are inserted into the bed of soil and an electrical current applied to the array, one or more magnetic fields is produced within the bed and parallel to the surface of the bed. The magnetic fields so produced impede downward flow of ionic fertilizers into the ground water, and retaining the fertilizer near growing plants when the bed is irrigated.