Firmly tied to Moscow since its independence five years ago, Mozambique is now beginning openly to court Western involvement in an effort to turn around its limping economy.

Last month, President Samora Machel announced that "private enterprise has an important role to play "in Mozambique's development. Senior government officials have since made it clear in interviews that the country is seeking to diversify its relations.

The officials stress that Mozambique does not intend to break its ties with Soviet Bloc countries. But implicit in their remarks is the desire to reduce Mozambique's heavy dependence on the Soviets.

"We want to cooperate economically with everybody," said Sergio Vieira, governor of the Central bank.

Part of the reason for the turnaround, in addition to economic needs, is the end of the draining guerrilla war in neighboring Zimbabwe, and Machel's close relationship with new Zimbabwean Prime Minister Robert Mugabe.

Mugabe, while describing himself as a marxist, is cool toward the Soviets, who backed his guerrilla rival Joshua Nkomo during the seven-year Rhodesian civil war. Machel apparently has done nothing to help the Soviets break the ice with Mugabe, and both Zimbabwe and Mozambique believe the West has the technology and investment Africa needs to develop.

As a result, changing attitudes in Mozambique and Zimbabwe stand in sharp contrast to dire predictions made during the Rhodesian civil war that the victory of Mugabe's forces would expose the entire southern Africa area to Soviet domination.

Mozambique's information minister, Jose Luis Cabaco, pointed out that Washington cooperated with such countries as China and Yugoslavia. "What we'd like from the United States is just equal treatment," he said.

Maugabe was strongly influenced by his five-year stay in Mozambique, the base for his guerrilla organization in its fight against the white minority Rhodesian government. Machel was reliably reported to have warned Mugabe on several occasions not to follow Mozambique's postindependence economic policies.

While Mozambique did not actively force out whites after independence, nationalization of health and legal services, changes in the educational system and discouragement of private ownership caused panic among 250,000 predominantly Portuguese settlers. The exodus snowballed to the point where today there are fewer than 15,000 Portuguese in Mozambique.

The Portuguese took with them not only their badly needed skills but also some equipment needed to make the economy run, such as vehicles and spare parts. Farms and factories were abandoned or sabotaged. Public transport is still virtually nonexistent.

Perhaps the sharpest reminder of the shambles that Mozambique fell into after its independence from Portugal in 1975 lies in its economic target for 1980. It is simply to return industrial and agricultural output to preindependence levels, which in turn were lower than levels of the early 1970s, before fighting had peaked in the 10-year war for independence.

Output decreased by an average of 30 to 50 percent during the first two years of independence, with key cashew and sugar exports down about 45 percent each. The trade deficit zoomed to $200 million and annual per capita income dropped from about $320 to less than $200.

Equally serious was the effect of the Rhodesian war, which its estimated to have cost Mozambique $550 million during the last five years, or more than its annual budget. A quarter of the $470 million budget had to be devoted to defense.

With the Rhodesian war ended, Machel has launched an "offensive" to eliminate some of the worst economic ills, calling the 1980s "the decade of the fight against underdevelopment."

Machel himself has gone on a rampage criticizing "inefficiency, stupidity, rudeness and petty corruption" during a two-month-long tour of state-run businesses, factories and ports. This in turn has opened the way for critical reviews by lower officials and ushered in a refreshing candor unknown in many African nations.

An important theme in Machel's exhortation was that "the state cannot disperse its forces on managing small businesses." He specifically cited poor distribution at "people's shops" which the government was forced to run after the Portuguese owners fled.

"The state is going to create conditions to help private traders, farmers and manufacturers" operate, he said. "The state should not sell matches."

This led to reports that Machel was inviting the Portuguese to return but he corrected that impression at a later press conference, saying he was speaking of "thousands" of Mozambican entrepreneurs living abroad. There is considerable doubt about the effectiveness of such a move.

Significantly, the policy of the country's sole political party, the Mozambique Liberation Front (Frelimo) has been to create a "nonracial, rather than a multiracial" state, according to Asquino Braganca, a close associate of Machel. In this respect, Machel also is believed to have influenced the new Zimbabwean president.

"There is no deliberate attempt to go around balancing races," said another Maputo official. "We don't think there is any need for balancing because we don't consider the races antagonistic."

The Cabinet members include 10 blacks, eight whites [one from the former Portuguese colony of Goa, which was absorbed by India] and one person of mixed race. The minister for security, Jacinto Veloso, is a white. Marcellino Dos Santos, No. 2 to Machel in Frelimo, is of mixed race. Two balck ministers are married to white South Africans.

The country's estimated 12 million population is probably 98 percent black.

Mozambican officials are quick to point out that the "nonracial" policy is a product of Frelimo, not Portuguese colonialism which left the country with a 5 percent literacy rate of independence. Frequent mention is made pendence. Frequent mention is made of racial colonial policies although some Portuguese who settled here did intermarry.

Despite such racial tolerance, Machel's initial economic policies precipitated the exodus of the whites and created the shortage of trained manpower that is now one of Mozambique's most serious problems.

According to Subhaschandra Bhatt, deputy director of ports and railways rail and sea transport is operating at 50 percent capacity since the number of skilled personnel had shrunk from 7,500 to 600 before independence.

At Barragem, less than 60 miles north of Maputo, there is a poignant example of Mozambique's lack of modern equipment and trained manpower.

Rhodesian forces destroyed a railway bridge crossing a dam there last September and workmen are simply using sledgehammers and crowbars to try to chip away at a 100-foot-long segment of concrete hanging down from the bridge into the water. Using explosives would destroy the dam gate and no hydraulic equipment is available, according to the official in charge of the operation.

Against this background, Mozambique's opening to the West is seen by some political observers as a part of the Mozambicans' efforts "to find their own way" toward socialism. But it comes at a particularly delicate time for Soviet relations in southern Africa, when the nations are shifting from war to peace.

The Soviets have a distinct advantage in wartime since they -- unlike the West -- are willing to provide arms to liberation movements. In peacetime, however, the West has the technology and money that Africa needs.

Information Minister Cabaco insisted in an interview that no basic changes were under way and that the socialist countries remain "our natural allies," Machel has said that he merely wanted to diversify his country's East-West relations without endangering the links to the Soviet Union.

Other officials, while restating Machel's views, put a different emphasis on their explanations.

"Marxism doesn't have any Vatican," said Jose Catorze, editor of the government-controlled newspaper, Nooticias. Like other officials, he maintained that each country must follow its own path to socialism. The Soviets shudder at the heresey,maintaining that Moscow is the font of Marxism-Leninism.

Cynics here say that Machel previously had sought better relations with the West and especially the lifting of the U.S. ban on aid to Mozambique. In this view, the end of the Rhodesia conflict makes such efforts more realistic.

U.S. Ambassador Willard De Pree, who has served here for four years, noted that relations have improved sharply. In contrast to the time when he had little access to government officials, the ambassador now sees Machel frequently.

The major problem for the United States, particularly Congress, is that when the crunch came at the United Nations in January over U.S. efforts to condemn the Soviet invasion of Afghanistan, Mozambique was one of the few third World nations that lined up solidly with the Soviet Union.

Aside from Marxism, Congress has kept Mozambique from receiving aid in the past because it harbored Mugabe's guerrillas and because of its allegedly poor human rights record.

With, the independence of Zimbabwe, the first issue has disappeared. Many diplomats say Machel, who recently released several thousand political prisoners, has a better human rights record than many other African leaders whose countries receive aid.

In the mid-1970s, American officials feared that Mozambique might follow the route of Angola and Ethiopia and invite in large numbers of Cuban and Soviet military and civilian advisers.

But the American Embassy estimates that there were 450 Soviet and East European troops and 250 Cuban soldiers in the country as of January, compared with a total of sightly over 1,000 in 1978. Estimates on civilian personnel are about the same as 1978 -- about 1,150, with slightly over a third being Cubans.

But Cabaco insisted that the communist "guests" do not exert undue influence on Machel's government, a view shared by a number of foreign diplomats.

"We would welcome 500 Americans running around the country," the information minister added.