Portugal's President Antonio Ramalho Eanes made a strong appeal for unity today in a speech to Parliament in Lisbon apparently designed to push Premier Mario Soares into forming a coalition government.

The general's speech reflected increasing impatience with Soares's minority Socialist government and its inability to resolve the country's economic crisis. Moreover, Soares faces dissent within his Cabinet and there was speculation that the president may be making a bid for power as well.

Eanes emphasized the need for political accord and "collective mobilization" of the people for national recovery. He warned that if these objectives are not met other constitutional means were available, a veiled reference to the president's authority to dissolve Parliament and appoint a premier.

"We have little time to attain these objectives. Eanes said, "and energy has been wasted on talking about secondary matters, forgetting the security, justice and well being promised to the Portuguese people. I hope for this reason that we shall be able to concentrate our efforts on what is essential and urgent."

The general was reportedly tempted to test the executive powers granted his office under the "socialist" construction adopted by elected representatives following the April 25, 1974, leftist military revolution. Gen. Eanes did not participate in the Armed Forces Movement uprising which ended nearly 50 years of rightist dictatorship, but he appears to have the support of many officers in the rebellion.

The president also has considerable support among conservative politicians and officers who would like to see him take a more active political role.

"The situation is such that civilian power is losing ground slowly to Eanes and his military supporters," said a Socialist source. "They are slowly gaining ground. The crisis won't come tomorrow, but it will come."

Soares was reported "irritated" and "frustrated" by the resignation Tuesday of Socialist Foreign Minister Jose Medeiros Ferreira, who had complained of meddling in foreign affairs by other Socialist ministers and politicians. Soares has assumed the foreign affairs portfolio.

Two other Socialist Cabinet officers - Agriculture Minister Antonio Barreto and Labor Minister Antonio Maldonado Gonelha - were reportedly considering leaving the government.

The resignation, threats of resignations and evident split between radicals and moderates in Socialist ranks clearly has weakened, the premier's hand against the president and undercut negotiations for a "gentleman's agreement" for a common program with the Communist party, the middle-of-the-road Social Democ ratic Party and the Conservative Social Democratic Center Party.

He met with leaders of the three parties last night to work out a pact, but the talks were deadlocked. Neither the Social Democrats nor the conservatives want any arrangement with Communist General Secretary Alvaro Cunhal, a pro-Moscow leader whose party controls 80 per cent of the organized labor force.

Socialist sources said that despite mounting problems. Soares was not on the verge of falling, and that he is willing to form a new government including a political technocrats who would come into the Cabinet to strengthen the economic team.

The latest Portuguese political drama is being played out against a background of political activities by rightist officers of the deposed dictatorship and leftist revolutionary officers who have been excluded from the power structure since Eanes put down an extreme-left officer's coup attempt nearly two years ago.

Rightiest officers who were purged for serving the dictatorship have been meeting regularly in recent weeks to demand reinstatemnet in the armed forces.

Leftist officers yesterday turned the funeral of Commander Ramiro Correia, one of the most radical military leaders, into a noisy political demonstration by 10,000 people. They also sang the balland that signalled the start of the leftist uprising.

Among those marching through Lisbon behind the coffin were such once powerful "April Revolution" leaders as former Premier Vasco Concalves and former Premier Vasco Concalves and former Gen. Otelo de Carvalho. The procession was clearly aimed at showing both Eanes and Soares that the leftists are still a force with a measure of popular support.

Aware of Correia's symbolic significance, the president ordered full military honors for the officer, who was killed in a boating accident. His body lay in state Thursday night in the Navy ministry.

All the intrigue and political maneuvering so typical of Portuguese politics do little to solve the country's economic crisis and don't at all help Portugal's image as it seeks loans to bolster its dire financial position. Tourism, however, has picked up, and Portuguese workers abroad have resumed sending money back home.

An International Monetary Fund team is at present in Lisbon negotiating a $50 million loan. Portugal is also expecting a $750 million credit later this year, underwritten by the United States, Japan and European Common Market members.

The small Iberian country, its population of 9.2 million swelled by the return of Portuguese settlers from newly independent African colonies, has a 35 per cent inflation rate, 14 per cent of its workers idle, and a trade deficit of more than $1.1 billion.