President Carter announced last night a sharp reduction in the shipment of American grain to the Soviet Union as well as other trade and diplomatic curtailments in response to what he called the Soviets' "callous violation of internation law" by their invasion of Afghanistan.

In a nationally televised speech from the White House, the president declared that the United States and other nations committed to peace cannot "do business as usual" with the Soviet Union or permit the Soviets "to commit this act with impunity."

He announced a temporary ban on the sale to the Soviet Union of "high technology" items such as computers, a "severe" curtailment of Soviet fishing rights in American waters and the deferral of most Soviet-american cultural and exchange programs, including plans to open consular offices in New York and Kiev.

Carter also said the United States and its allies will provide military equipment and other assistance to Pakistan, which borders Afghanistan, and he warned the Soviets that Continued aggressive actions" will imperil participation by athletes from the United States and other nations in the 1980 Olympic Games in Moscow next summer.

"History teaches perhaps very few clear lessons," the president said in explaining the U.S. countermeasures. "But surely one such lesson learned by the world at great cost is that aggression unopposed becomes a contagious disease."

Senior administraiton officials provided reporters with additional details of many of Carter's measures, which are intended to deny the Soviet Union important benefits of the cooperative side of the U.S.-Soviet relationship of the 1970s.

Not mentioned by the president or detailed by the briefers were decisions made early yesterday, just before Secretary of Defense Harold Brown left for the People's Republic of China. The decisions are likely to goad the Soviets in the competitive side of the relationship.

Official sources said the tone, subject matter and politics of the longplanned Brown trip were altered at the last minute because of the Soviet action in Afghanistan, which provided a shared strategic interest of the most tangible sort for Washington and Peking.

Brown is to propose a joint U.S.-Cinese effort in aiding Pakistan against the threat from Soviet troops in Afghanistan next door, offficials said.

Brown is also carrying instructions to explore technology transfers for China well beyond what had been approved for transfer to the Soviet Union before the new restrictions imposed by Carter last night. "Even-handedness [between China and the Soviet Union] is out the window," said an official source.

Neither the president nor the administration officials made any mention of a program of aid or recognition for the Islamic tribesmen who are fighting the communist government and Soviet troops in Afghanistan. However, a White House briefer did nothing to discourage speculation about such a program, telling reporters that not all aspects of Carter's measures need to be discussed.

The most serious measure Carter announced last night was the reduction in grain shipments. Officials said the order will mean a cut in the amount of grain shipped to the Soviet Union this year from 25 million metric tons to 8 million metric tons.

Coupled with what administration officials said were assurances from Canada, Australia and other grain-exporting nations that they would not make up the difference, the loss of American grain will strike at Soviet efforts to build up its livestock herds and provide a better diet for the Russian people.

But the grain shipment curtailment was also the most politically risky of the measures the president imposed. Anything resembling a grain embargo is politically explosive in farm states such as Iowa, where in less than three weeks Carter faces his first renomination test in the Iowa precinct caucuses. w

The president has vowed repeatedly not to use food as a political weapon, and in his 1976 campaign denounced the grain embargoes imposed by the Nixon and Ford administrations throughout the Farm Belt.

Last night he sought to soften the political impact of his grain reduction order by assuring American farmers that the 17 million metric tons of grain to be withheld from the Soviets will not be allowed into the domestic market, where they would depress prices.

He said this will be done through government storage programs and through the purchase of some of the undelivered grain at market prices for use in world hunger programs and for the production of gasohol. This program would cost an estimated $2.5 billion to $3 billion.

Under a five-year agreement signed in 1976, the United States agreed to sell the Soviet Union 8 million metric tons of grain a year, with options to sell more if it wished. Earlier, the administration agreed to exercise its option for 1980, as has been done in earlier years, and sell 25 million metric tons this year. The president's order last night nullified the optional grain shipments while leaving the basic grain agreement intact.

The ban Carter ordered on the sale of high technology items to the Soviet Union, which he said will continue "until further notice," also will strike at the Soviet economy. Administration officials said the action will involve a review of export licenses already granted and a more restrictive export policy in the future, particularly for oil drilling equipment crucial to Soviet efforts to expand domestic oil production.

In explaining and defending these actions during his 13-minute speech from the Oval Office, Carter painted a grim picture of what he called the "extremely serious threat to peace" posed by the Soviet invasion of Afghanistan.

"If the Soviets are encouraged in this invasion by eventual success, and if they maintain their dominance over Afghanistan and then extend their control to adjacent coutries, the stable, strategic and peaceful balance of the entire world will be changed," he said. "This would threaten the security of all nations, including, of course, the United States and our allies and friends."

Carter confirmed he would ask Congress to permit a resumption of U.S. military and economic assistance to Pakistan, despite that nation's continuing program of seeking to build a nuclear weapons capability. Aid to Pakistan was terminated last April under U.S. laws designed to combat the spread of nuclear weapons.

In saying that the United States will assist Pakistan against "the seriously increased threat it now faces" from Soviet forces in Afghanistan, Carter declared that the United States stands similarly ready to help "other nations in the region." A White House official said this referred particularly to Iran, declaring that common interests of the United States and Iran have been obscured by the holding of the U.S. hostages and suggesting that the common interest might be reasserted if the hostages were freed.

Senior officials provided reporters with these details of the program for penalizing the Soviet Union:

The Soviet fish catch in American waters will be reduced from about 350,000 tons to about 75,000 tons, at a cost to the Soviets of $55 million to $60 million.

Planned U.S.-Soviet joint meetings on agriculture and health have been canceled, and meetings on business facilities and civil aviation have been postponed.

U.S. flights by Aeroflot, the Soviet airline, have been trimmed to two each week instead of three.

The openings of a Soviet consulate in New York and a U.S. consulate in Keiv have been postponed.

Despite lengthy debate on the point within the administration, the diplomatic staff of the Soviet Union in the United States is not being reduced at present. However, reporters were told that the issue is being reviewed.