Two weeks after the most important election in El Salvador's modern history, the country remains without a new government as rival parties negotiate the division of power.

It is a tropical version of the smoke-filled room, with a dozen men arguing in a breezy living room one day and a cool private office the next about which of their parties shall control which areas of national life. They have managed to agree on a few fundamental principles, but many important issues remain to be resolved.

The leaders of the five parties that participated in the U.S.-backed election are trying to form a "government of national unity" that is to write a new constitution, organize general elections and run the country in the meantime, fighting a war against leftist guerrillas and implementing reforms insisted on by the United States as a condition for continued aid.

Leaders of the three main parties involved in the negotiations appear optimistic and say there are "only details" to work out. The details, however, could cause the talks to collapse, and all sides say the coming week could be decisive.

One detail is the role of the armed forces, and there are signs that Defense Minister Jose Guillermo Garcia may be replaced by someone less enamored of the political wars and more involved in the war against the guerrillas.

The talks are being followed closely by U.S. Ambassador Deane R. Hinton, who has expressed the hope that a government will be formed that is stable enough to fight off the rebels and palatable enough to the U.S. Congress to keep U.S. aid coming in. In practice, Hinton has made clear, this means keeping the Christian Democrats, who won 24 seats in the 60-member constituent assembly, from moving into open parliamentary opposition to the four rightist parties that together took 36 seats.

The embassy view is that the Christian Democrats can provide a moderating influence if they are in the government but would be vulnerable to increased political violence if they were in opposition.

A delegation of U.S. congressmen told the Salvadoran politicians that a failure to form a government acceptable to Congress, which must approve foreign aid, would delay the delivery of $100 million now scheduled as part of President Reagan's Caribbean Basin initiative.

During last week's discussion on the role of the military in El Salvador's future government, Christian Democrat Jose Napoleon Duarte, who is president of the current junta but is not expectedto have a job in the new government, said the armed forces firmly backed the reforms implemented during his rule. Many of these changes, particularly the agrarian reform, have been criticized by members of the four rightist parties.

But the military is far from united on the reforms, and the mixed election results mean that division continues within the Army as it does among the civilians. Although the Army will choose its own man to be defense minister, there was speculation last week that Gen. Garcia could be replaced.

Garcia is thought to be the most powerful man in El Salvador, but he rarely leaves the capital for the battlefield except for publicity purposes.

"The soldiers look at Garcia and are resentful. He goes to parties, and they go to die," said a knowledgeable Christian Democrat. But Garcia has carefully built alliances among the provincial commanders and would be difficult to dislodge if he chose to resist.

All sides expect the guerrillas to dig in and resume major efforts to regain militarily the prestige they lost in the massive turnout for the March 28 election they had denounced as a fraud. Traditionally in Latin America, people who oppose an election cast blank or defaced ballots. With 10 percent of the 1.4 million ballots either invalid or nullified by defacement or ignorance, both government and diplomatic sources say that if the left had campaigned, its candidates probably could have taken 25 percent of the tally.

Another major detail to be decided is who will become interior minister, an important post controlling the disbursement of funds, patronage and public works to all local officials.

The Republican Nationalist Alliance, which won 19 seats in the new assembly, wants its colorful leader, retired Maj. Roberto D'Aubuisson, to have the job. D'Aubuisson, who has a reputation as a plotter and close associate of rightist "death squads," has been criticized by U.S. officials in the past, but Hinton and visiting Rep. James C. Wright Jr. (D-Tex.) made more favorable comments about him last week.

D'Aubuisson "is dedicated to democratic processes and believes in a government in which all sides can participate," Wright told reporters.

Despite their differences, the parties have agreed on several points. According to party officials, they have pledged to continue the "democratization" of local, union and party elections, with all legal parties allowed to participate. No ministry will try to undo what another ministry controlled by another party has done.

The new assembly will be able to make laws while it is drawing up a new constitution, and decrees of the current military-civilian junta will only be modified, not reversed or eliminated. The banks will remain in majority state control, but more private shareholding will be allowed.

On the crucial issue of agrarian reform, the three parties agreed to preserve it in its original three-stage structure and to confine "perfecting" it, as the rightists have pledged to do, to a crackdown on bribery and measures to speed the delivery of land titles and payments.