ore than 100,000 West Germans turned out for rallies today in Bonn and Munich to wave American flags, sing the "Battle Hymn of the Republic" and generally affirm West Germany's gratitude to the United States and its continued loyalty to the Western alliance.

Organized by the Christian Democratic Union, the major conservative opposition party, the rallies come four days before President Reagan is due here to meet with other NATO leaders. The affirmations followed months of public protests in West Germany against U.S. foreign and military policies and bomb attacks last week against several American military and corporate buildings.

Christian Democratic Chairman Helmut Kohl told the crowd in Bonn that the purpose of the rallies was to give West Germany's allies a picture of this country without the red flags, raised fists and anti-American violence of past television broadcasts from here.

What resulted today was a picture of largely middle-aged West Germans filling a park in front of Bonn's university, looking festive and holding neatly printed banners proclaiming "Americans Stay Here," "Say Something Good About America" and "We Belong to the West."

Anti-NATO demonstrations in Bonn and West Berlin are scheduled to coincide with the alliance summit. The Christian Democrats are hoping today's strong pro-America stand will boost their own party's fortunes in elections Sunday in Hamburg, a key national test.

Public opinion surveys show neutralist sentiments in West Germany to be on the rise, particularly among the youth. But the surveys also point to West Germany as the most pro-American major European ally.

"Without the United States and its readiness to defend our freedom, this rally of free citizens in a free land would not be possible," Kohl declared. Police put attendance here at 50,000, but Kohl claimed 120,000. In any case, the rally drew far fewer than the more than 250,000 who massed in the same place in October to protest the planned deployment of new nuclear missiles in Europe.

In Munich, 30,000 heard Chairman Franz Josef Strauss of the conservatives' Bavarian wing.

Special correspondent Sari Gilbert reported from Rome:

An estimated 300,000 Italian leftists marched through this capital in a five-hour anti-nuclear demonstration timed to coincide with preparations for a visit by President Reagan Monday.

Marchers passed in front of the U.S. Embassy, the Soviet Consulate and the Ministry of Defense to join a giant rally at Piazza del Popolo, where speakers called for a halt of construction at the new nuclear missile base in Sicily.

Participants in the march, thousands of whom were brought to Rome on 10 special trains and about 400 buses organized by Italy's large Communist Party, included Communists, anarchists and several other small leftist groups.

The organizers, a peace committee, said the march was against the nuclear arms race in general. But because of an anti-American tone, the march was boycotted by part of the labor confederation and by the Socialist Party, a key member of the current five-party government coalition.