The liquids in the manure are part of a closed circle as well. Everything at the dairy is sited with gravity in mind, so that all liquids  the runoff from the drying area, wet manure left behind in the alleys, wastewater from the milking parlor and rainwater  drain into the first of three interconnected lagoons that are lined with compacted clay.

The first lagoon is bubbly and dark, with anaerobic bacteria digesting the organic matter to reduce odor. By the third lagoon, the water is clear and dilute enough to be pumped to irrigation equipment on Mr. Volleman’s fields.

But the margin for error in handling both the solids and liquids is thin.

Farmers must plan where and when they spread dried manure, both to avoid odor complaints from downwind neighbors and to avoid overapplying nutrients that may run off in a rainstorm. “It’s like any other business,” Dr. Mukhtar said. “If you’re not keeping track of where your nutrients are going, you may be reapplying those nutrients on the same piece of land. That’s more than the plants can take and the soil can hold.”

Image Manure is vacuumed up by a Zamboni-like machine to be processed. Credit... Brandon Thibodeaux for The New York Times

One problem, said Robert T. Burns, a professor in the department of agricultural and biosystems engineering at Iowa State University, is that manure typically has more phosphorous than needed. “Manure is an unbalanced fertilizer from the plant’s view,” Dr. Burns said.

Diet modification can help, to some extent. Phosphorous is added to dairy feed as a supplement, and research has shown that it tends to be added in excess, said William P. Weiss, a professor in the animal sciences department at Ohio State University. “You can get good milk and good health at much lower levels,” Dr. Weiss said. “And every gram less they feed is a gram less excreted.”

Nitrogen, on the other hand, comes from protein, and a lactating cow needs to consume a lot of protein. “Decrease it a bit, and then milk production falls off,” Dr. Weiss said.