President Carter took action yesterday to reduce the amount of corn, barley and sorghum growth by American farmers next summer by 7 million tons - a step deemed necessary because of slumping grain prices and a huge buildup of unsold stocks.

Officials said they did not expect a possible wholesale increase in these grain prices to generate higher retail food prices - and they left open the possibility that the decision could be revoked before corn is planted next spring if shortages develop in World grain markets.

American corn is the world's largest crop and corn is the commodity most closely tied to overall food prices because it is the main feed for beef, dairy cows, hogs and poultry.

The decision to reduce production next year by giving farmers strong incentives to idle cropland was made by President Carter yesterday, the final day for making the announcement.

Annoncing the actions, Deputy Secretary of Agriculture John White said that it was "a matter of great domestic and international concern." Carter reportedly agonized over the decision until the last minure, weighing the potential impact on food prices at home as well as the availability of corn to foreign countries which buy one-quarter of the entire U.S. crop.

The United States supplies more than half the corn imported by foreign countries.

A number of contries - including Japan, East Germany, Italy and the Soviet Union - buy most of their corn from the United States.

Latest Department of Agriculture estimates are that the Soviet Union may order a record 10 million metric tons of corn from the United States this year - more than in any previous year.

Iran, whose leader met yesterday with Carter, had become a major customer for American corn to feed its growing livestock herds in recent years.

American farmers last summer grew the biggest crop of animals feed grains in history and the Department of Agriculture estimates that 43.5 million metric tons will still be unsold when farmers harvest the 1978 crop. That is the largest stockpile since 1972.

Authorities said that prices recieved by farmers now are below what it costs them to produce the grain. Unless prices move up, the administration is facing the prospect of having to make substantial payments to farmers under the new price support and income gurantee program approved recently by Congress.

Under the land "set-side" plan announced yesterday, farmers are not required to idle any land - but there are strong incentives for them to do so. Farmers who don't will not be eligible for price supports or for income subsidies if grain prices stay low.

The plan also applies to barley and sorghum, the other major animal feed grains.

If a farmer decides to adhere to the government plan, he will have to idle one acre of land for every 10 acres of corn, barley grain sorghum that he plants. Government agents will verify compliance.

THe department estimates that this will result in 7 million tons less grain - a three per cent reduction of U.S. total production, and a 1 per cent cutback in world production of those grains.

The administration still has the option of revoking the cutback after it reviews the world grain situation in January and February, White said.

He said that the program has the advantage of saving energy, since it will reduce the amount of area cultivated and harvested with gasoline-petroleum-based fertilizer, pesticides and insecticides.

"The feed grain set-aside also supports good conservation," White said in a press release. "It is an effective tool to take the presurre off farmers to use their marginal lands to raise crops and provide encouragement to farmers to concentrate their production on prime agricultural lands."