The nation's farmers are facing hard times, with net farm income expected to drop precipitously by 20 to 40 percent from last year, according to Agriculture Department statistics.

The hardest hit farmers are the nation's meat and egg producers who face a slump even more severe than the decline that has hit the auto industry, according to USDA's top economist, Howard Hjort. But other sectors as well may be swamped by overproduction.

In a sense, last year's good news is this year's bad news with one of the factors depressing farm prices being a record yield for most major crops in 1979.

At the same time, meat supplies have been near record levels. "It's an extremely rare event when we have excess meat production and record yields on all major crops in the same year," said Hjort, director of economics, policy analysis and budget.

Compounding all of this have been steep increses in the prices farmers pay to produce their animals and crops, including record high interest rates in the spring -- when farmers couldn't wait for the money -- and higher fuel costs. In some cases prices are at about the same level or better than last year, but the improvement has been offset by higher costs.

USDA reported that net income for farmers in the second calendar quarter of 1980 is running at an annual rate of $20.2 billion, off 40 percent from $33.3 billion in 1979.

Even though those figures include about $4.4 billion in inventory counted in 1979 income, although it may not be sold until 1980, and even though there are signs of improvement in prices, "we may see a decline in net income on the order of 20 to 25 percent," said Hjort. "That's a significant change," although agriculture is an industry where large cyclical swings are not uncommon, he said. The second half of the year will be telling, he said.

The effects of the decline in income have trickled down to other parts of the economy as well. For instance, purchases of tractors and farm implements have declined by about 40 percent, Hjort said.

"A large percentage of the pork producers are grain producers and many have cattle too. The logic for that traditional arrangement of the sum of several enterprises is that you never have a year when it's bad in all of them," said Roger Wasson of the National Pork Producers Association in Des Moines. "This year has been the exception."

The bad news for meat and egg producers came in the first half of the year when prices produced what is universally described as a "disaster" for farmers. On the other hand, consumers have benefited with food prices contributing less to inflation than they might have otherwise. Now meat prices are beginning to rise slightly.

Hog prices, which plummeted to a low of about $28 per hundredweight in April and May, have risen to approximately $42. "The costs of producing hogs can vary, but I doubt if there are many that can do it for less than $38 per hundred," said Hjort. A more realistic figure is in the mid-40s, he said, and pork producers agree.

Current prices "are hardly a return to prosperity. They're just about at survival levels," said Wasson. "For the most part it's safe to say that for most of 1980, pork producers have been losing $25 to $30 on every hog they marketed," he said. Normally pork production is viewed by farmers as a good enterprise, although not without bad years, Wasson said. "But this has just been the worst."

Cattle producers and feedlots have suffered as well, even though beef supplies were down about 4 percent from the first half of 1979. Huge supplies of pork and poultry held beef prices down as did a declining economy that made consumers think twice before going out for a steak, said Tommy Beall. Beall is director of market research for Cattle-Fax, a market analysis service of the National Cattlemen's Association.

The worst losses so far have been in fed cattle, cattle already fattened for slaughter. Feeders have been losing $25 to $100 a head on fed cattle and several feedlots have gone out of business around the country, he said. Now the losses have reached the farmers who raise cattle to sell to the feedlots, according to Beall.

With supplies bottoming out and prices improving slightly, changes may be in the offing, but improvement will be gradual, he predicted.

Wheat farmers have enjoyed higher prices for wheat in the first half of 1980, but now, with 1980's crops being harvested, wheat prices are slightly below last year's levels, Hjort said. "Since they put much more into producing this crop," farmers will face problems unless prices increase, he said.

Feedgrain producers have enjoyed slightly higher prices than last year but face the same uncertainty about what prices will be when they start bringing in the crops this year.

"The factor that will have the greatest impact on crop prices will be the weather patterns. Right now and for the next six weeks, that's the key," Hjort said. Some long-range predictions show high heat and low precipitation for major parts of the Corn Belt, which would reduce yield and strengthen prices. Short of a drought, the best bet might be for farmers to use reserve programs heavily to increase prices to a point where they may profit, he said.