Soviet President Nikolai Podgorny left today for Zambia after a four-day state visit devoted mostly to extensive political talks with Tanzanian President Julius Nyerere on the explosive situation in southern Africa.

A joint communique published tonight said that their discussions had taken place in an atmosphere of "trust, friendship and mutual understanding" and that the two sides had agreed to hold "regular consultations."

There were few surprises in the communique except perhaps for the less-than wholehearted backing given to the soviet-armed Patriotic Front of Zimbabwe, one of three nationalist groups vying for African and international recogniation in white-ruled Rhodesia.

The communique simply said that the two sides considered the establishment of the front "an important step" in the unification of the African nationalist movement in Rhodesia. It did not indicate that they regarded the Front as worthy of recognition or support.

The Soviet were believed to be seeking endorsement of the Patriotic Front, led by Joshua Nkomo and Robert Mugabe, as the sole representative of the Africans in Rhodesia. Nyerere, too, has been supporting the Front along with the other leaders of the "front-line" states against the two other factions led by Bishop Abel Musurewa and Rev. Ndabaningi Sithole.

But the communique seems to signal a shift away from this stance by Nyerere.

On questions outside Africa, the Soviet Union and Tanzania reaffirmed an identity of views on the "majority" of issues. But Nyerere was reported to have refused to discuss a number of contentious East-West issues, including the human-rights question.

The Soviet Union also announced that it was extending a 19.2 million loan to Tanzania for two state farms and a technical college and to finance and training of Tanzanian agronomists in Soviet institutes.

Podgorny's visit was a relatively low-key affair, apprently in keeping with the wishes of Nyerere. Podgorny addressed no public rally, cancelled a scheduled press conference and his only trip outisde the capital was a 20-hour trip to the spice island of Zanzibar. His reception here was correct and cordial but hardly enthusiastic.

In several of his toasts and dinner speeches, Podgorny appeared somewhat defensive about Soviet policy in southern Africa. In a speech Thursday night, he warned his hosts that "international reactionary forces are trying to sow distrust toward the Soviet foreign policy to set off the young states against the Soviet Union (and) to isolate and thus weaken the national liberation movement."

In the same speech, Podgorny gave Soviet backing to the Tanzanian policy of making the Indian Ocean a "zone of peace." He said, "The key question in the preservation of peace in this region is the elimination of imperialist military bases that exist in the Indian Ocean."

The Soviet Union, he added, "has no military bases in the Indian Ocean and has no intention to establish them."

The soviets deny that their missile-stocking and naval repair facilities at the Somali port of Berbera constitute a "base" or indeed that they even exist.

For his part, Nyerere praised the Soviet Union for its "great contribution" to the African freedom struggle in providing arms to African nationalists fighting to overthrow the white governments in Rhodesia and Namibia. "By helping the liberation movements," he said at a banquet Wednesday, "the Soviet Union is thus helping Tanzania."

The Tanzanian leader also stressed that his country was a "fervently nonaligned nation" wanting friendship with all nations of the East and West but domination by none. He indirectly chided the Soviet Union for its failure to give independent Tanzania more than a token amount of aid.

At the same time he signaled to the Kremlin that Tanzania's friendship would never be a function of the amount of aid given but dependent "on the degree of mutual respect."

Robin Wriyght filed this special report from Lusada, Zambia, the second leg of Podgorny's three-nation Afircan tour.

This could be the most productive stop in his itinerary. It certainly will be the most symbolic.

Relations between the two countries have been icy since the Soviet Union and Cuba became involved in the Angolan civil war in late 1975. Just over a year ago, Zambian President Kenneth Kaunda warned the rest of Africa about the danger of the Soviet "tinger and its marauding cubs."

Podgorny's four-day state visit marks a major foreign policy change for Zambia, which has maintained close ties with the United States since gaining independence from Britain in 1964.

At a press conference on the eve of Podgorny's arrival, Kaunda said black Africa's dependence on the socialist bloc would increase because they were the only nations that supported and supplied arms for the four-year-old guerrilla war against Rhodesia, while the West "has been supporting fascism and racism in southern Africa. Now we are fighting and our allies are those who recognize the need for feeding us with arms. We have no choice in the matter; the West is to blame."

But the first trip by a Soviet leader to black Africa appears to be aimed at more than just rebuilding friendships and countering new U.S. interest in the continent. While Zambia is one of two countries providing bases for Rhodesian nationalist guerrillas, Kaunda has also spearheaded southern African detente and backed each new Rhodesian peace initiative launched by the United States and Britain.

In the past, the pragmatic Kaunda has been one of the West's main hopes in getting support for a peaceful alternative from the "front-line" countries - Zambia, Botswana, Tanzania, Angola and Mozambique.

Diplomatic sources in Lusaka, from both Eastern and Western countries, believe that Moscow would now like to obtain a full commitment from Zambia for the Soviet solution in Rhodesia, a military victory by Marxist guerrillas.