From the president's pink suburban palace to the grim, gray waterfront headquarters of the Communist union federation, a chilling political judgment has now been passed on Premier Mario Soares' new government.

This, it is said is the last but one before Portugal is again taken over by a rightwing military dictatorship.

If Soares, a nominal socialist, and his new conservative allies fail to cut the nation's horrendous inflation and unemployment, there will be just one more chance. Gen. Antonio Ramalho Eanes, the ramrod-stiff president and a genuine democrat, would then try to run the country with a constitutional government of his own.

Should this fail, a wide spectrum of opinion here agrees, it would mark the end of this country's brief experiment with democracy.

Key leaders from all sectors - political, military, unions and business - are remarkably matter of fact as they describe this. In much the same way, they agree that the newly disciplined army officers have no great appetite to seize power and upset the democracy they produced here in the coup of April, 1974. Yet, there is also agreement that the army will not stand still indefinitely for the ineffective, soft state that has been the fashion since the coup.

Diego Freitas do Amaral, leader of the Christian Democrats who are supporting Soares, puts it this way:

"The military activists will stay quiet - until the day their wives tell them there is nothing to buy in the shops, nothing to eat."

This country is tired of political theater, speeches and slogans, the distruption of daily life by massive demonstrations for wild demands. Above all, it has had enough of the steady decline in living standards that has been the fate of most Portuguese for the past two years. Portuguese generally welcomed the coup and clearly prefer democracy to the dictatorship of the old Salazar-Caetano era. Nevertheless, there is a limit to the price they will pay for their freedom.

The new preference for order is reflected in daily life. In the milltary barracks, officers have cut their long hair and swapped dashing red bandannas for trim ties. At Tavares' elegant restaurant, chic ladies no longer dress in revolutionary blue jeans but wear prim skirts and fur stoles. In the lobby of the National Assembly, the most democratic legislators kiss the hands of lady constituents like the counts and marquesas who ruled here in the past. At Coomba Dao, Salazar's birthplace, men and women fight the national police with their bare hands to restore the statue of the dictator which lost its head after the April coup.

The Communists and more theatrical leftists speak of defending to the death the "constitutional rights" that were gained three years ago. Yet, they too know that the barracks boast many more guns, that the country's mood has shifted sharply to the right along with the prevailing sentiment of the officers.

Conventional foreign opinion insists that the Communists and the union movement they dominate are the key to the belt-tightening program Portugal must now adopt.

Inside Lisbon, however, the Communists are regarded as among the tamer tigers in town. Early yesterday morning, the Assembly voted on the government's new austerity plan. If the Communists had wanted to make trouble, they would have joined with the other opposition party, the rightwing Social Democrats. Then the outcome would have been close. Instead, the Communists carefully voted a separate "no" from the Social Democrats, assuring Soares of an overwhelming victory, and giving Portugal's creditors a misleading impression of his strength.

Victor Constancio, the young and highly regarded finance minister, author of the austerity plan, said "The Communists will wage a war of words against us, but that will be all."

At the General Confederation of Portuguese Workers, the Communist grouping that claims to represent about 70 percent of the unionized force, Alvaro Rana, a member of the executive commission, patiently explains the party line.

He lists a long string of demands - everything from protecting union rights to increased jobless benefits. What really matters in this inflation-ridden society, however, is the Confederation's wage demands. This comes at the end of Rana's list.

Finally, he concedes that his outfit will seek only "to accompany the increases in the cost of living and not try to recuperate what was lost in 1976 and 1977."

More bluntly, the party will settle for zero wage increases in real terms. This is an astonishingly modest goal since prices outstripped wages by at least 15 percent last year and 9 percent the year before.

Why is the party so mild?

The bearded and smilling Rana replies: "This is because we take account of the national interest, which is the workers' interest."

What he really means, the best-in-formed here agree, is that he knows tougher demands will further depress this fragile economy, could bring the officers out of the barracks and drive Rana and his fellows into prison, exile in Czechoslovakia. The current line - approve a two-hour shipyard demonstration but reject the call for a one-day national strike - reflects a realistic fear of how perishable are the rights of unions, Communists and others to operate freely.

The task of righting Portugal's economy is formidable inflation is officially put at 27 percent but has probably been running over 30 percent. Unemployment is officially listed at 9 percent but could be nearly twice that. Portugal ran a payments deficit last year of $1.2 billion. Given the difference in the size of the economies, that is about five times the big U.S. deficit.

The country desperately needs a quick input of $800 million from abroad to meet the cost of imported food and raw materials. The United States, West Germany and some others are standing by with $750 million. They are awaiting first for a green light from the International Monetary Fund which is to put up the remaining $50 million.

The trouble is that the IMF is insisting on what sober, conservative people here regard as draconian measures. The old Washington joke, that the IMF has overthrown more Latin governments that Marx and Lenin combined, is now circulating sophisticated Lisbon circles.

On paper, Finance Minister Constancio is planning tough measures to curb credit, government spending, subsidies and the other devices that have undermined Portugal's economy. He calculates that he can bring inflation down to a more managaeable 20 percent this year and cut one-third from the balance of payments deficit. He plans for no worsening in unemployment but leaves little room for improvement.

The IMF techniclans, backed by U.S. and West German economists, are insisting on even steeper cuts in credit and sky-high interest rates. Constancio and others fear if they accept such harsh terms, hundreds of small companies will go bust and the number of jobless - most of them unprotected by unemployment benefits - will reach even more drastic totals.

Constancio has just sent his wife, Maria Jose, a well-regarded economist, to Washington to explain to the IMF that Lisbon is already reducing its rate of inflation and its buying abroad. Yet somehow, the authorities here have not yet persuaded Washington that what is involved is political as well as economic stability.

Apart from the IMF, the most worrisome problem here is a slackness in the Soares government that shows up in corruption and nepotism. Leading politicians put ineffectual relatives in important government posts or persuade foreign companies to find soft jobs for themselves. A minister is now under suspicion for his involvement in a ring smuggling coffee from Angola to Spain. Another has asked in vain for an inquiry into the sale of import licenses. A high official in the Ministry of "Social Communications (information or progaganda) is charged with counterfeiting dollars and marks on his own printing press. An aide to a junior minister is accused of smuggling arms, refrigerators and other expensive appliances.

Soares dismisses all this. "There are rumors without proof," he says. "There is no more corruption here than in France, Italy or other countries." He says, however, that he will set up an independent commission under a judge to look into the reports.

Elsewhere, there is a deep fear that the slackness will blacken democracy's name and help ease the way for the rightwing dictatorship few want and many fear. President Eanes, whose rock-ribbed integrity is widely admired, is deeply concerned and speaks out in public and private. His New Year's address to the nation pointedly warned of "the resistant virus of corruption."

The prevailing view here holds that the Portuguese - except for a small minority - want to keep the democracy that the young captains, majors and commanders gave them on April 25, 1974. But there is also a widespread belief that what the officers gave the officers can take away.