West Germany is allying itself with the United States against the Moscow Olympics this summer. But Bonn took that position only after a period of sturm und drang that announces a new crack in the Atlantic alliance. This, according to German visitors to Washington, is how the consultations with the United States proceeded.

On Jan. 11 Egon Bahr, a personal emissary of Chancellor Helmut Schmidt, asked Secretary of State Cyrus Vance in Washington what the United States intended to do about the Moscow Olympics. Vance replied that while opposition was possible, it was distinctly unlikely.

On Jan. 16, Deputy Secretary of State Warren Christopher was asked the same question by German officials in Bonn. He also told them a move against the Olympics was highly improbable.

A couple of days later, the president's national security adviser, Zbigniew Brzezinski, repeated that assurance in a telephone conversation with his German opposite number, Berndt von Staden. On Jan. 20, only hours before the president announced the policy on "Meet the Press," the Germans were told the United States would oppose holding the Games in Moscow.

Washington puts a different emphasis on the same events. When the administration first began looking for possible ripostes to the Soviet invasion of Afghanistan, a boycott of the Olympics was considered but set aside as far too weak. Hence Vance's comment to Bahr. The Olympic possibility seemed very dim during the next couple of weeks. Therefore, the low priority accorded to it by Christopher and Brzezinski in their discussions with German officials.

But at the end of the third week of January, public and editorial and congressional opinion in this country suddenly turned against American participation in the Moscow Games. With feeling running strong, the president decided to call for the boycott on his "Meet the Press" appearance. pThe decision was communicated to the Germans as soon as it was made.

Behind these two accounts lies a deep conflict of political forces in Germany and the United States. While Bonn is more than ever dependent on Washington, Washington is less and less able to accommodate Bonn's internal political problems.

Chancellor Schmidt is probably the most pro-American leader in West German -- maybe even in all German -- history. He does not share the enthusiasm of his fellow Social Democrat, Willy Brandt, for an Eastern policy, or Ostpolitik, designed to improve Bonn's relations with Russia and the whole Soviet bloc, including East Germany. Neither does he share the (largely Roman Catholic) enthusiasm of Konrad Adenauer for a European community. On the contrary, Schmidt believes in the Atlantic alliance as the keystone of German policy around the world.

Political expediency reinforces belief. Schmidt faces opposition in general elections this year from a Christian Democratic leader, Franz-Joseph Strauss, who is always prone to charge Socialists with softness on communism. The chancellor is also under pressure from the left wing of his own party and from his coalition partners, the Free Democrats, to maintain ties to the East.

By cleaving to the United States, Schmidt fortifies himself against Strauss and his pro-communist charges. At the same time, the chancellor disciplines his own left and the Free Democrats with the implicit threat that too much pressure for Ostpolitik will cost them American support and the elections.

But to maintain that delicate balance, the chancellor must have foreknowledge of American intentions. Otherwise, he will be caught out of phase with the United States in ways that weaken his domestic base and expose him to Soviet pressure. That explains the repeated efforts to sound Washington on the Olympics and, equally, the anger when Washington surprised Bonn.

Jimmy Carter is not hostile to Schmidt, and he sets high store by allied relations. But he has to work against the background of an American opinion fragmented and volatile on foreign policy. His diplomatic advisers are divided as to what to do about the Russians. His political advisers are not above using foreign policy for election purposes.

Accordingly, Carter cannot know in advance what anti-Soviet measures will find favor in this country and among his advisers. Lacking sure support, he is loathe to move without signs of popular favor. When he does move, he wants to get the credit himself -- without diluting it by a lot of advance publicity from abroad. So even if he were John J. McCloy with a southern accent, Carter could not possibly live up to the hopes of his best friends in Germany.

In these conditions, the United States and West Germany are condemmed to drift apart. Bonn is now looking more and more toward Paris and an understanding that will preserve the connections with the East against the unpredictable ups and downs of American policy toward the Soviet Union.