It has been nine years since the white settlers who styled this city as Africa's Lisbon abruptly left, abandoning it to revolutionaries who vowed that Luanda would become Africa's Hanoi as the tide of history turned in this region.

Today, such dreams lie broken in the desolate streets of Luanda, a city gripped by a continuing agony that contradicts the heady ideological victory that revolutionaries and liberals hoped for and that conservatives around the world feared.

Instead of being a springboard for revolutionary challenge to white rule in South Africa and prowestern African regimes on its border, Angola is a nation ravaged by continuing chaos and international intervention.

Mounds of rotting garbage cascade over the mile-long curbside of the once beautiful bayside promenade that the Portuguese lined with mosaic tile and called the Marginale.

Shops and businesses throughout the city of a million are abandoned, their broken plate glass windows replaced by boards or simply not replaced at all. At one pharmacy, a single bottle of shampoo forlornly sits amid totally empty shelves, a mocking reminder of the collapse of the consumer economy here.

On an evening cooled by breezes off the Atlantic, trash fires glow along a street that once was a principal business artery. Beside a rusted hulk that was several years ago a car, a woman and two small children quickly pick through a garbage heap, hurrying to beat the curfew that will begin in a few hours.

Angola today is a severely wounded country struggling to recover, a place where there is nothing to buy and for most people no money to buy it with anyway, a place where jobs and work are therefore largely meaningless and absenteeism is the rule rather than the exception, foreign residents repeatedly tell a visitor returning for the first time since colonial rule collapsed in a shameful retreat in 1975.

It is, on the surface, as chaotic as the Portuguese administrators and their American and South African white supporters predicted it would be if colonialism were to end and Africans were allowed to rule themselves.

And on the surface, the consequences of letting the covert version of the Nixon Doctrine go down to defeat in Angola appear to be as dire as secretary of state Henry A. Kissinger predicted at the time. Cuban soldiers in trucks and East German security personnel in jeeps bounce through Luanda's dusty streets regularly.

But Angola today is a far more complex, and interesting, historical phenomenon than those simplistic projections would have allowed it to become. Beneath the visible signs of disaster a new spirit of political pragmatism is stirring as the nominally Marxist-Leninist government reexamines, and reacts to, the enormous problems it has helped create and others it has been the victim of.

"The Angolan story is hardly finished, whatever the strategists in Moscow or Washington think and however they may try to impose their designs on reality here," said one diplomatic observer. "The local reality is that Angola is faced with an enormous gamble that will determine not only this government's survival, but also a lot about the future of the conflict between African nationalism and white rule in this region. The difference now is that the government is becoming confident enough to contemplate taking the gamble."

"You are going to Angola?" the worldly, upper-class Portuguese matron in Lisbon asks, a look of genuine horror crossing her face. "But there is nothing to eat there. There is no water. The Cubans run it." Her dismay deepens as she thinks about the prospect and she quickly breaks off the conversation.

Her warnings, repeated by journalistic colleagues and others in Lisbon, turn out to be exaggerated. There is food, even a good beer brewed locally, as long as you have foreign currency to pay for it at Luanda's only comfortable hotel. Called the Presidente, the hotel has been open for business only a few months and is now filled with airline crews, returning Portuguese technicians and western oil executives seeking to get in on new economic opportunities here.

But there are no taxis in this town, leaving a visitor to rely on his feet and on the kindness of strangers, be it a mechanic working for Texaco, a diplomat or a government guide -- anyone with wheels. The only form of public transportation is a small group of sagging buses that reel under the assault of hundreds of Angolans piling into and onto them.

The visitor perching in the hotel lobby in hopes of cadging a ride witnesses the assault on the buses in the square outside the hotel throughout the day. Slowly the visitor in the endless waiting comes to know every crease in the lobby's brown vinyl sofa, as well as the pattern of all of the 88 stripes on the zebra skin hung above the reception desk, and the sullen, suspicious glances the Aeroflot crew members cast about them as they descend each morning. The lobby is an oasis from the dust and stench of the streets, an enclave of intrigue and envy for those shut out on the outside.

Viewed from the ground, all of the dreams of all of those who have touched Angola seem to have come to ruin.

The colonialists who said white rule would survive and create a thriving, fair society fled in an instant and left behind them a system so fragile and bankrupt it collapsed overnight. The African nations that supported the guerrillas and said independence would right the most elementary wrongs of this society have seen instead a continuing bloody war that is as much tribal as it is political. And the Soviets and Americans who sought to turn it into an ideological battleground now watch the Angolans try to edge away from ideology.

Little more than a decade ago, Angola seemed to have become the jewel in an otherwise badly tarnished Portuguese colonial crown. Wealth was beginning to pour in from oil, coffee, diamonds and agricultural exports. The beginning of serious revolutionary activity had jolted the Portuguese out of 500 years of complacency and exploitation. They were beginning to examine ways of extending privilege beyond the small circle of mixed-race and black Angolans they had accepted into the system.

That change barely had begun when radical young Portuguese Army officers weary of colonial warfare overthrew Lisbon's dictatorship and offered to turn power over to African nationalists in Guinea-Bissau, Mozambique and Angola. Here, the African nationalist movement was fractured along ideological and tribal lines that quickly drew both superpowers and neighboring South Africa into the struggle for control of Angola.

The outside involvement escalated the conflict and helped frighten the Lisbon government and the more than 300,000 white settlers who had formed the economic and political infrastructure of this country of 7 million inhabitants into pulling out of Angola in a wild rush home.

The exodus would itself have been sufficient to ensure that the prophecies of collapse and chaos would come true. Left behind in ruins was a system that in any event had produced no more than 250 qualified African elementary school teachers, two local pilots and a handful of professionals in other areas by independence.

The brief civil war and its bitter aftermath created a new instability. The Soviet Union and Cuba rushed aid to their surrogates, who were to emerge victorious, and the United States and South Africa armed their proxies and helped them carry their war close to Luanda before losing. It was to be Kissinger's last effort in office to let local forces do the fighting for western objectives with western arms and money.

Any hopes for reviving the economy were crushed quickly under the weight of a heavy centralized bureaucracy imposed on the country by the victorious Popular Movement for the Liberation of Angola, known as the MPLA.

A farmer found that to get a simple spare part for a tractor he had to submit a request to the Ministry of Agriculture in Luanda, which then had to pass it on the Ministry of Planning, which would have to approve the foreign currency allocation for it. Farming came to a halt quickly and instead of exporting food, Angola became a major food importer.

The network of Portuguese traders who had managed the nation's retail trade and its coffee exports was suddenly gone, as were the African workers who had been kept on the coffee plantations in large part by a system of forced labor. Coffee exports plummeted to 10 percent of the sales recorded during colonial times. Insecurity and theft in the diamond areas cut exports from 2.4 million carats in 1974 to one-fourth that figure today, according to professional estimates.

Three invasions by South African troops and the continuing rebellion led by guerrilla chieftain Jonas Savimbi have devastated Angola's southern and eastern provinces. More than 130,000 refugees have fled the south, the country's three major rail lines have been shut down by sabotage, and hydroelectric dams and power lines are destroyed by Savimbi's men on a fairly regular schedule now.

In an air-conditioned, pastel-shaded seaside villa 10 miles south of the confusion and deprivation of Luanda, Jose Eduardo dos Santos contemplates reports of such drastic conditions without betraying a single hint of despair or disappointment.

The 42-year-old president of Angola exudes the quiet determination that has always marked his style, and a quiet confidence that foreigners who watch him closely say is new.

Trained as a petroleum engineer in the Soviet Union, dos Santos has moved cautiously but systematically in his five years to consolidate power in the faction-ridden party that rules Angola. He appears to have applied engineering principles to politics and to have succeeded in a step-by-step isolation of potential rivals within the MPLA.

Earlier this year, dos Santos moved to outflank a government apparatus that was widely perceived to be inefficient and perhaps obstructionist. He stopped holding regular meetings of his Cabinet and created instead a nine-member Defense and Security Council that now makes major policy decisions for the country.

It is composed primarily of dos Santos loyalists drawn from the 12-member Politburo of the MPLA, which converted itself from a liberation movement to a vanguard party in 1977. The party reportedly has about 30,000 members, and can count on the support of the 120,000 members of the national trade union syndicate.

One of dos Santos' allies on the Defense and Security Council is Planning Minister Lopo do Nascimento, who acknowledges that the party made enormous economic mistakes after independence, and who says the present regime must improve things by decentralizing and emphasizing efficiency, particularly in agriculture.

"We are considering ways to give more decision-making power and resources to the provincial governments, and to let provinces keep part of the foreign currency earnings they generate to encourage enterprise there," do Nascimento says. "We have to be more flexible than we have been" in providing incentives and encouraging the private sector. He describes the state marketing board set up to handle coffee sales as "a monster" and acknowledges: "We cannot solve our problems without the help of our farmers."

On a Sunday the "internationalists," as the foreigners who live and work in Angola are known, gather in separate knots along the sandy beaches that curve in an arc around The Island, Luanda's once fashionable resort area across the bay.

Finnish relief workers, Cuban officers mixing easily with Angolan counterparts, standoffish French oil company employes and Soviet air traffic controllers retreat from the tensions of the work week to The Island. Up the beach, however, one group has not left the cares of the "real world" behind. Dressed in bright blue exercise suits, about 20 East German technicians believed to work for the department of state security move about their separate beach under the watchful gaze of two of their number carrying automatic rifles.

How much do the Russians, East Europeans and Cubans run Angola?

It is a question that predictably brings a brusque and defensive response from Angolan officials, who say they appreciate the help the "comrade internationalists" have given following the Portuguese pullout, but insist it has not compromised Angola's sovereign and independent status.

"We are not a closed country," dos Santos says. "We are a nonaligned country that wants to coexist in peace with countries of differing social and political systems." He reiterates that Angola wants diplomatic relations with the United States, which refuses to establish them.

At Luanda's military airport, a small forest of Antonov transports and other Soviet planes is tended by Russian technicians and managers who are omnipresent on the runways and in the hangars. In all, there are thought to be in Angola 2,000 Soviet and East European technicians providing maintenance, training pilots, advising security operations and doing some high- level military coordination as well as other tasks.

But it is the estimated 25,000 Cuban troops and 6,000 civilians who have created the most controversy and kept the Reagan administration in hot pursuit of a regional peace agreement that it might otherwise have let die. Washington's obsession with inflicting diplomatic and military defeats on Fidel Castro wherever possible has made Angola the centerpiece of current U.S. policy in Africa, diplomatic relations or no.

In addition to the combat units deployed in static defense positions along the Lubango rail line, a dozen or so Cuban advisers are thought to be stationed with each of the Angolan Army's battalions and to have been instrumental in organizing and training those battalions, according to reliable witnesses.

But these witnesses also report that Angola is beginning to take over more of the training of its rapidly expanding Army, which is thought to number about 65,000 men. And a trip with the Angolan Air Force to the war zone of the south confirms that fully trained Angolan pilots are taking over more of the flying missions, although Cuban helicopter pilots remain an important part of antiguerrilla warfare.

"There is a confidence in the Army that was not there before," said a trained observer. "It is the reason the government can pursue the diplomatic option with the United States as deeply as it has, and to propose to the South Africans that the Cubans will go if the South Africans will get out of the picture and cut off supplies to Savimbi's guerrillas.

"Dos Santos has to know that Savimbi has stockpiled two or three years' worth of supplies in the forests out there, and that it will be a hard fight for them in a one-against-one struggle. But it is a gamble that the Luanda government looks like it may be ready to take now."

Despite everything, the Portuguese are still the foreigners who matter here. It is more than the fact that Portuguese is the national language that permits Angola's hundreds of linguistically different tribes to converse with each other. It is more than the fact that in the poverty and disorganization of independence senior ministers continue to use file jackets imprinted "Overseas Province of Angola," the colonial designation.

The imprint of Lusitania, the cultural spirit and soul of Portugal, is deep in this society. On a hillside overlooking Luanda's bay, the successful Marxist MPLA insurgents have established a military museum in an ancient crusader fort, where they have placed in display cases AK47 assault rifles, photographs of the murderous Stalin's Organ mortar tubes and photographs of dead and mutilated victims of South African attacks on villages.

Outside in the courtyard stand statues they gathered from around the city after the settlers departed. Luis vaz de Camoes, the epic poet and explorer of the 16th century, stands beside a crusader knight and a Portuguese king. At the entrance is a decorative panel showing the Portuguese winning a major 17th century battle.

This theme also dominates the delicate blue and white decorative tiles that still grace the rotunda entranceway to the national bank. Portuguese explorers still set out on missions blessed by Portuguese priests and royalty in these scenes.

"We could not afford to replace those tiles if we took them down," said an Angolan. But there is also a suggestion that there is an acceptance of Portuguese culture here that does go deeper than colonial heritage in other parts of Africa.

For the poorest residents of this demoralized city, there are two classes of people. You either live "on the asphalt," and therefore are well-to-do, or you live "on the sand," in the musseques or shantytowns that have mushroomed across the sandy outskirts of the city since independence.

The collapse of farming in the interior, the continuing insecurity and the lure of an independent African urban environment have all contributed to the exponential growth of the musseques. That growth in turn has beaten back whatever efforts the authorities have made to provide anything approaching adequate municipal services.

On the same recent Sunday that the "internationalists" gathered at The Island, 30,000 Angolans turned out for the first national party held since independence. At the party, sponsored by the local radio station and a few of the surviving businesses, food and beer normally not available for purchase were flowing freely at a dozen snack shacks set up in a park near the bay.

While a bubble machine exhaled soap globules onto the stage, rival bands blared out pop songs, children danced beneath palm trees, a few drunks roamed the crowd and enormous quantities of beer were consumed.

It was, in short, a boozy, sultry Sunday afternoon typical for tropical African capitals. For desolate Angola, the scene represented both progress and hope.