In a green valley along the Potomac River, 70 miles from Washington's world of computers and political strife, 500 folks pitched in yesterday to help Warren and Jane Roelkey stop their farm from washing away.

Some brought tractors. Others brought food. All brought a desire to work and cooperate with each other, and in turn encourage the soil to cooperate with them.

The Roelkeys have owned their 245-acre farm for 15 years. They had considered selling the farm because it was becoming less and less productive. Water rushing down the hill carried with it 350 tons of soil a year, removing the nutrients that were necessary to grow the hay and corn that supported their own farm of cows and hogs.

The rainwater from the Roelkey farm, at the foot of South Mountain, carried nutrients, pesticides and animal wastes into two streams that eventually drain into the Potomac River and Chespeake Bay. The pesticides and animal wastes cause pollution and put chemicals into the drinking water of thousands of people.

Because the pollutants from the Roelkey farm potentially harmed the larger community, that community had a stake in restoring the land. So members of the Frederick county government, the Catoctin Soil Conservation District, the Environmental Protection Agency asked farm groups and civic groups for volunteers to help restore the land, as a demonstration for other farmers with similar problems.

The Roelkey farm was selected because it met certain criteria established by the soil conservation district, including a location capable of handling large amounts of traffic for the demonstration and a water pollution problem that could be reversed.

Most of the volunteers who worked on the farm yesterday were from Frederick county and many were farmers. But carpenters, office workers and politicians also pitched in. Most of them had not ever met the Roelkeys.

Boys from 4-H clubs driving tractors and men on bulldozers dug out the land for ponds where surplus rainwater could accumulate instead washing away the soil. A father and son team installed a polyethylene pipe in a trench that would carry water to a trough so that cows would not wade in the streams and pollute the water. Other men dug ditches in a spiral around the hill so that water would travel slowly and carry less soil with it.

Then, there were the finishing neighborly touches: some hammered a hog barn together, others painted the barn, still others harvested corn.

They did in one day what would take an average farmer five to seven years and cost him $25,000. They spent $18,000 donated from 300 businesses on paint, wood, fertilizer and seed, and another $17,000 from the Frederick county community to organise the effort.

Len Hart and his 12-year-old son, James, farmers from Frederick County, painted a fence."My brother's on the Farm Bureau," Hart said, "he encouraged me to come. Everyone else was coming - I figured I might as well."

A young man with a blond beard crouched at other side of the fence also painting. "Why am I here?" said Barry Kissin of Sabillasville, Md. "Because this is a demonstration of what people who get togther can accomplish.

"Our economy is based on private interest, everyone out for themselves. We've lost our sense of social welfare - our sense of getting together and creating. This is a way of reversing that. Ecology demands cooperation. You give to it and it gives back to you," he said.

Hundreds of people sitting on hay in wagons were driven through the farm and watched the workers. At each site, a volunteer explained to the tourists the work's purpose and how it was designed to prevent soil erosion and water pollution.

Acting Gov. Blair Lee addressed the assemblage from a podium, saying: "This is a really fine example of people helping each other. A wonderful spirit of community has existed forever in our state and particularly in Frederick County."