The steel skeletons of half-finished hangars rise forlornly from the dust, and a lone gantry crane breaks the monotony of heat waves undulating across the desolate shoreline.

Under the hot African sun in noontime silence, Berbera Base seems an unlikely prize in the struggle between the United States and the Soviet Union for strategic advantage in the rich oil fields of the Arabian peninsula.

But a 15,000-foot concrete runway built by the Soviets in their heyday here and bunkers stretching into the Gulf of Aden from Berbera Port just east of the airstrip have made this torpid little town a major focus of Washington's efforts to reinforce its military presence in the Indian Ocean and Persian Gulf region.

Those efforts have drawn the United States into difficult negotiations with the Somali leadership of President Mohammed Siad Barre. In the negotiations, U.S. policymakers now must weigh Berbera's military advantage against the danger of drawing too close to a nasty, unremitting guerrilla war in the Ethiopian badlands known as Ogaden and an explosive refugee problem created by the continued fighting.

Two U.S. Navy ships already have called here this spring and a Pentagon team has visited to size up Berbera's potential. The dingy port is not much of a liberty town. But American sailors held a beer bust on the humid beach and got around enough to generate smiles from local Somalis for the sailors' plentiful dollars and their penchant for chasing the sleek Somali women. There is little doubt the estimated 100 Americans Washington hopes to station here will be more popular than the Soviets who pulled similar duty less than two years ago.

A vast gap has opened up, however, in the talks conducted by U.S. Ambassador Donald Peterson with Siad Barre's government over how much U.S. military and economic aid should be granted in return for use of the facilities here and in Mogadishu, the capital. A serious dispute also has arisen over U.S. reluctance to give weapons to a government whose Army is sponsoring ethnic Somali guerrillas determined to tear off 157,000 square miles of eastern Ethiopia -- the Ogaden. The Ogaden is traditionally claimed by Somalia.

As the debate goes on, Siad Barre and his aides are reported to be growing increasingly impatient and bitter. Arab diplomatic sources say Siad Barre had expected his offer of military facilities to produce a more fervent diplomatic and military embrace than the United States appears willing to consider.

"By the time the United States makes up its mind, millions of people will have died," a high Somali Foreign Ministry official complained.

U.S. support for Somalia is all the more logical, he argued, because of the strong Soviet and Cuban presence in Ethiopia and large-scale Soviet military aid to the Marxist government of Col. Mengistu Haile Mariam. Cuban troops, reported to number more than 13,000, are garrisoned in most of the Ogaden's major towns, often along with Soviet advisers. Somali officials and guerrilla sources say.

The gains of an American military presence here seem clear enough. The runway, used by the Soviets until Barre expelled them in 1977, remains in relatively good shape.

Before they left, the Soviets installed light panels along the broad strip, dug out revetments for smaller planes and started on several hangars. In the natural port, they bequeathed a new quay, a half-dozen oil storage tanks and a pipeline reaching into the deep outer harbor for refueling the Indian Ocean fleet.

Refurbishing and expanding leftover Soviet facilities would eat up a major share of the $250 million reportedly planned to ready U.S. facilities here, in Oman and in Kenya. But it also would provide the United States with a strategic foothold near Soviet bases in South Yeman, and a convenient weapons dump and resupply point for President Carter's Rapid Development Force and U.S. warships in the region.

However, the dangers of an American military presence here also seem clear. In return for use of Somali bases, Siad Barre is pushing to be more closely integrated with the U.S.-sponsored military alignment of pro-Western states such as Egypt, Saudi Arabia and Oman. In Somali eyes, this includes solid U.S. support for Somalia's struggle against Ethiopia, the major Soviet ally in the region and the main target of Somali foreign policy since independence.

"We have made a clear choice," Siad Barre said recently. "Let America make a clear choice."

Reports from Washington say Siad Barre has demanded more than $1 billion in economic and military aid over the next five years, including substantial help for his Army, which was badly battered in the 1977-78 war with Ethiopia. The United States is willing to grant some aid, but has reportedly offered $40 million -- far less than Somalia wants.

The United States at first considered supplying only nonlethal equipment. However, the negotiations are understood to have moved on to anti-aircraft defenses in response to Somali complaints about recent Ethiopian air raids on Somali towns. Officials in Mogadishu say that the raids killed about 30 persons and injured more than 100.

The United States has also sharply increased its aid to the hundreds of thousands of refugees flowing into Somalia to escape the increased Ogaden fighting. Charles Campbell, head of the U.S. assistance mission in Somalia, said American food aid will reach $13 million this year, with another $8.7 million in other refugee relief scheduled to arrive in the country by October.

The total accounts for about half the foreign refugee aid coming into the country from all sources. But it still leaves Siad Barre and his government far from their goal of comprehensive American military and diplomatic support for their struggle against Ethiopia. This generates what one Arab diplomat has called "bitterness from Siad Barre on down."

"The political help of the United States is more important than giving a few tons of maize," a Foreign Ministry official said. "Help us. We need you. Somalia is not less important than Ethiopia."

Somali disappointment appears particularly sharp because since the Soviet departure, the United States has twice considered military aid to Somalia only to back away because of Somali involvement in the Ogaden war. Despite the urgency arising from the Iran and Afghanistan crises, diplomatic sources in Mogadishu say this has again been a major factor in the difficult Berbera negotiations.

Siad Barre has pledged that any U.S. weapons would be used only to defend Somalia.

At the same time, the United States is known to fear a close military relationship with Siad Barre as long as his Army remains involved in the Ogaden war -- even if he pledges to keep U.S. weapons out of the conflict.

Such a pledge would be difficult to police, given the tight cooperation between the Somali Army and the main guerrilla group, the Western Somalia Liberation Front. Reliable diplomatic sources say Siad Barre, who took over in a military coup in 1969, is assisting the rebels with weapons, ammunition, fuel, transportation and officers from his own 45,000-man Army.

Maize, in 100-pound sacks with the U.S. Agency for International Development handshake symbol were seen well inside Ethiopia in a Western Somalia Liberation Front forward position last week.

In addition, any major U.S. military cooperation with the Somali government would raise questions about traditional American support of the cardinal rule of the Organization of African Unity: respect for colonial frontiers. It is mainly because of this rule that African nations have refused to back Somalia in its support of the guerrillas' fight for secession from Ethiopia.

Some U.S. officials also have questioned whether the United States would be able to remain neutral if the Ogaden war again escalated to an all-out conflict, carried by Ethiopian jets into Somalia itself or to Berbera, as has been threatened by Mengistu.