Secretary of Agriculture Bob Bergland, defending the curtailment of grain shipments to the Soviet Union, yesterday promised "to take every action, under every authority we have to offset the impact on American farmers.

Acknowledging that he previously had opposed the use of U.S. food as a "political weapon," Bergland said. "This is different in this instance we are talking about the Soviet Union."

Bergland said he supported the president because it was a question of, "Do we sit idly by, or do we say, 'No, we're not going to conduct business as usual,'" after the Soviet invasion of the "free-standing, independent country" of Afghanistan.

Privately, a number of officials said that the presidential decision to curb grain shipments had presented the Department of Agriculture with the most difficult tasks since heavy Soviet grain buying in the early 1970s initiated a period of unprecedented farm prosperity.

In his announcement Friday night, President Carter said he was reducing the volume of U.S. grain that the Soviets can buy between October 1979 and September 1980 from 25 million tons to 8 million tons, the minimum allowed under a Soviet-American agreement.

Bergland noted that Carter did not abrogate this areement, and more grain shipments could be approved later. "He didn't want to burn the bridge," Bergland said. "We hope the Soviet Union will come to its senses and stop this madness."

The two immediate problems for the department are to maintain farm incomes and to get cooperation from other grain-exporting nations in not filling orders canceled by the United States.

How the administration accomplishes these tasks is certain to have a strong bearing on the political for tunes of the Carter presidency. Bergland said yesterday that there had been a "mixed, guarded reaction" from farmers, but he predicted that as his program took effect and as the national security rationale for the action became apparent, acceptance of the decision would be strong.

Details of $2.5 billion to $3 billion program to support farm income are still being worked out. Broad outlines of it released yesterday include stepped-up government wheat purchases for foreign food aid, expension of the existing government-backed farm storage program, expanded credits for grain exports and possibly moves later to cut back grain production in the United States.

The immediate problem for the Agriculture Department is to kkep the 17 million tons formerly earmarked for the Soviet Union from being dumped onto domestic grain markets, causing surpluses and falling prices. Grain companies already have contracts for sale of about 13.5 million tons of that to the Soviets.

There is no impact on the shipment of 4 1/2 million to 5 million tons already loaded this year, or on the additional volumes up to the 8 million tons authorized under the U.S.-Soviet agreement. Of more concern is the approximately 13.5 million tons of grain already pruchased from farmers by the grain trade to cover contractuai commitments with the Soviets.

As the export companies divert this grain to other customers abroad, they also are likely to stop buying more grain from rural elevators and cooperatives. In the absence of other government action, prices are then likely to fall.

To prevent this from happening, the administration is banking heavily on the massive expansion of an existing program under which farmers have the option of storing grain away from the market at government expense until prices reach specified levels.

Before the president's announcement, rural elevators in Iowa were buying corn for around $2.11 a bushel. However, under the farm storage program, growers have the option of storing their crops in their own bins, retaining ownership of it.

If they opt for this, they can get a federal loan of $2 a bushel, plus 25 cents a bushel for each year's storage. Their corn must remain off the market until the market price reaches some specified level, currently $2.50 a bushel, and the farmers do not have to begin repaying their loans until corn prices hit $2.80 a bushel.

The purpose of the loan is to enable, the farmer to pay his expenses without having to sell his crop at a low price.

The department announced yesterday that the minimum price for releasing corn from the reserve might be increased to $2.63 a bushel as an inducement to farmers to withhold the grain from the market rather than sell it into the market that has lost a major outlet, the Soviet Union.

A similar reserve program exists for wheat. Under study is a plan to raise from $3.29 a bushel to $3.75 the price at which stored wheat can be released from the reserve. Some 17.5 million tons of feed grains and 6.25 million tons of wheat already are in the farm storage program, and Bergland said a doubling of the volumes is possible.

Bergland said yesterday that he will also seek speedy authorization from Congress to buy up to 4 million tons of wheat for an international emergency famine relief program.

Related to these measures to defend U.S. farmers is a far-reaching international effort by the administration to obtain the help of other major exporting countries to cut off grain to the Soviets.

A meeting of representatives of the United States, Canada, Austrailia, Argentina, Brazil and the European Common Martek is set for Friday in Washington to discuss this unprecedented action.

Canada and Austrailia already have pledged that they will not attempt to make up the deficit caused in the Soviet Union by a loss of U. S. imports, Bergland said. He added that the European Common Market and others have expressed readiness to cooperate "in the interests of world peace."

Coordinated action between grain exporters has been rare in modern history. In the 1960s and 1970s, when the United States withheld grain from the Soviet Union, China, Cuba, North Vietnam and North Korea for political reasons, Canada and Austrailia continued to sell to those countries.

Bergland said yesterday that 3 million tons of grain moving in world trade probably would be rerouted or transshipped to the Soviet Union. But he said that the United States believes that the "reduction in grain availability in the Soviet Union will be quite significant," and will result in widespread slaughter of hogs and poultry to conserve grain supplies.

He said that the loss of a considerable part of the expected U.S. grain imports "could be the cause of a policy change in the Soviet Union," away from the policy followed throughout the 1970s of trying to add meat to Soviet diets.

The Soviet Union is unusually vulnerable to this action because of its own poor harvest and crop failures in Eastern Europe. Eastern Europe will need to import a record 16.7 million tons this year merely to cover its own grain shortfalls, and is unlikely to have much left over for the Soviets.

These imports are also expected to strain East European transportation systems to a degree that would make it difficult for the Soviets to transship grain through Poland, East Germany and Czechoslovakia.

In addition to the cutbacks of wheat and corn, an administration spokesman also said that 1 million tons of soybeans valued at about $230 million and quantities of soybean oil, barley and rice also would be held back from the Soviets pending a solution of the Afghanistan problem.