Soviet military personnel in large numbers are leaving Somalia, their largest outpost in africa, authoritative African sources here said yesterday.

An African source said be thought a complete pullout of the Soviet "adviser" force is likely.

The reports of the initial departure of a quarter of the 6,000 Soviets in the strategic country astride the Horn of Africa coincided with the return home of Somali President Mohammed Siad Parre from a state visit to Saudi Arabia. American's closest friend in the Arab world.

Sources said the Somali leader had discussed economic and military ais with the the Saudis and got what he sought. It has long been assumed that if Somalia were to shift its allegiance from the Soviet Union. Saudi Arabia would serve as the major intermediary to woo the Somalis for the West.

Close Washington observers of the Middle East scne said that the Saudis were in fact being extremely cautious and had been reluctant to receive President Barre until prevailed upon to do so by Egyptian President Anwar Sadat, who expelled Soviet troops from his soul in 1972.

These Washington observers referred to the growing conviction among analysts that Sadat expelled the large Soviet presence from Egypt because Saudi Arabia made that a condition for significant aid. The sources said they would expect the Saudis to pose similar conditions on Somalia.

The Somalis, however, explain the shift in terms of their traditional hostility to Ethiopia, where the Soviets are reported to be pouring large amounts of military material in a major attempt to shore up the anti-Western revolutionary government there. Ethiopia, which had been a longstanding military client of Washington, is in a virtual state of war with Somalia over the Ogaden region, the southwestern third of Ethiopia claimed by Somalia.

One knowledgeable African source yesterday explained that soviet departure from Somalia as "incompatibility - there is now way they can have both Ethiopia and Somalia." Cuban leader Fidel Castro tried unsuccessfully earlier this year to get Somalia and Ethiopia to end their territorial dispute by forming a Marxist federation.

The Soviet stake in Somalia, Africa's easternmost country, includes use of the port at Berbera. Then-Secretary of Defense James Schlesinger alleged in 1975 that the Soviets had a major missile and naval base at berbera. Although the Somalis vocifereously denied the charge and invited U.S. Congressional and press delegation to see for themselves, no Westerners were allowed to visit the actual Soviet facilities in the port.

The Soviet Union and Somalia signed a cooperation and friendship treaty in 1974.

Somalia, with a population of 3.3 million, is generally considered to have the best-trained and equipped army in East Africa. Although small (22,000 men), the army is heavily mechanized with Soviet medium tanks, armored personnel carriers and mobile artillery.

African sources said that the Soviet personnel leaving Somalia are bound both for Ethiopia and for home.

The Somalis have been flirting for months with the idea of switching their alliances, but U.S. analysts have at least until recently been impressed by their hesitations and mixed signals as much as by their willingness to contemplate changing camps.

As long ago as mid-1975, President Barre told a Washington Post interviewer that he was willing to let the U.S. Navy use maintenance and refueling facilities in Somalia. But American officials then deemed that Barre's offer had no practical meaning.

Upon his return to his capital of Mogadishu this week, Barre announced a "complete identity of views" with the conservative Saudis on the political situation in the Horn, the Red Sea and the Indian Ocean areas.

Somalia, a member of the Arab League, is a potential pivot between the Arab world and black Africa. Its population has racial and cultural affinities with both worlds.

Ethiopia is also fighting a major secessionist movement in Eritrea, its Red Sea province. There, too, the rebels have heavy Arab backing. Eritrean independence would leave Ethiopia both landlocked and virtually surrounded by hostile borders.

To the north, Egyptian-backed Sudan's relations with Ethiopia have been steadily deteriorating. The Eritreans use Sudan as a staging base: there have been armed clashes between Ethiopian and Sudanese border forces; Sudan has been actively improving its ties both with Somalia and with Kenya, Ethiopia's southern neighbor.

In May, the Sudanese expelled the 90 Soviet military advisers in the country and made the Soviets reduce their embassy staff. Only yesterday, the Soviet foreign affairs weekly Overseas accused Sudanese President Jaafar Nimeri of waging a propaganda campaign to split the Soviet Union from its friends in Africa and the Arab world.

Unconfirmed reports of the departure of Soviets from Somalia had been circulating in Nairobi, Kenya. Those reports said that the forces being withdrawn were the ones stationed in Berbera at the mouth of the Red Sea.The reports said that some Cuban military men were also being transferred from Somalia to Ethiopia.

The Soviet presence in Berbera was heavily cited by American officials as a justification for the U.S. military buildup in the Indian Ocean, especially on the British-owned island of Diego Garcia.

The Soviets were said to have major radio tracking facilities in Somalia. They can probably be replaced in Ethiopia, but loss of the port facility in Berbera would leave the Soviet fleet with go friendly port of call in East Africa north of Marxist Mozambique.

An African who knows Somalia well said recently. "The Russians and Cubans never understood that, for the Somalis, socialism came after nationalism. Just because the Somalis and the Ethiopians claim to have the same ideology, that doesn't mean they could ever agree on anything."