TEHRAN, AUG. 24 -- Crowded into a suffocatingly hot little room with smears of blood on the tiled walls, men and boys chanted Islamic prayers mixed with political slogans in a rhythmic crescendo around the youthful corpse lying in their midst.

"There is only one God," they intoned, beating their chests loudly with the flat of the hand. "You will now go to heaven. For every one who falls, 10 more martyrs will rise up to go to the war."

The fervor of the ceremony as family and friends came to bury another war casualty in Tehran's Behesht Zahra Cemetery was a strong reminder of the force and depth of Iran's Islamic revolution. Since chasing the shah from his Peacock Throne in 1979, the power of this upheaval has transformed Iran from a compliant ally and well-heeled customer of the United States into an unpredictable threat.

The revolution here has hurtled forward -- some Iranians say backward -- so fast in the last eight years that its momentum is clearly visible to a short-term visitor. The atmosphere it has created goes a long way toward explaining Iran's determination to pursue the war with Iraq, its zeal for exporting Shiite Moslem power and its prickly resentment of U.S. and other western attempts to exercise influence in the Persian Gulf region.

What has happened in Iran seems to strike with such force partly because it rises from and plays on four powerful emotions at once:Religious revival, which has fired a particular following among the Iranian people whose Shiite strain of Islam traditionally had been disparaged by fellow Moslems and westerners, while even in largely Shiite Iran its values had been ignored.Nationalism, a strong reactionary force in a country where foreign, particularly U.S., influence long was dominant and the western-oriented "king of kings" was put on his throne in 1953 by a CIA coup d'etat against a nationalistic prime minister, Mohammed Mossadegh, to safeguard western oil and strategic interests.Ethnic pride -- played out in aspirations for a renaissance of Persian influence in the Middle East, including in Arab nations -- that had been overshadowed for centuries but never abandoned by the heirs to the Persian Empire. Iraq's Baath Party government, led by President Saddam Hussein, has recognized this facet of the seven-year-old war. It often calls the conflict "Saddam's Quddesiyeh," a reference to the Battle of Quddesiyeh in 637, in which Arab warriors drove the Persians back across the gulf.Revolutionary zeal, a non-Marxist version of the organizational and morale-building drive to reform society that underpins authoritarian revolutions elsewhere and has created the same kind of military vanguard, called here the Revolutionary Guards.

Iran also has organized komitehs, or revolutionary committees, that enforce the new rule in the streets. The komitehs have formed around mosques or mullahs here, but Iranians said they perform roughly the same functions as neighborhood Sandinista Defense Committees in Nicaragua or Revolutionary Defense Committees in Cuba.

Tehran residents go to their local komitehs to get ration cards for sugar or meat, for example, and komiteh leaders make sure the masses turn out for demonstrations when the Islamic leadership puts out the call.

To many foreigners or Iranians educated in the West, the revolution's zeal has given rise to narrow-mindedness and extremism, particularly surrounding harsh Moslem strictures that have become the law of the land. An Iranian woman smiled in commiseration, for instance, when a western woman was forced to enter Mehrabad International Airport through a separate door from her male traveling companion.

Similarly, a Kurdish Iranian complained with a derisory laugh that Revolutionary Guard sentries barred him from the Interior Ministry because he was wearing a short-sleeved shirt in the Tehran heat. A taxi driver, used to dealing with foreigners, said with a smile that "normal people" travel to the Caspian Sea for a swim while "the poor people" attend Friday prayers to listen to fiery speeches from their leaders.

In the former Hilton Hotel in Tehran, now called the Esteqlal, or Independence, a woman veiled from head to toe, with only her eyes showing, patrolled the lobby to remind female guests that they must cover their hair. An American with a dark wisp peeking out of her scarf received a pink card from a waiter urging her politely in Persian and English to respect Iranian customs.

Alcoholic beverages have been banned since soon after Ayatollah Ruhollah Khomeini flew here from France and set up the Islamic Republic. In a measure of the importance this measure has assumed here, the Tehran Times last week put on page one a story telling how Islamic guerrillas in neighboring Afghanistan blew up a truck carrying vodka to Soviet occupation troops in Herat.

At the same time, Iranians reported that Christians here have received authorization to make their own wine and vodka. It can be consumed not only for religious services, they said, but also on social occasions inside their homes.

"Before the revolution, people drank outside their homes and prayed inside," went a joke making the rounds here. "Now they pray outside their homes and drink inside."

The changes have been serious business as well, however, and they have raised strong doubts in the minds of many Iranians, particularly as the war with Iraq drags on. With komiteh members ready to report on what they hear, several Iranians met by chance were eager to share these doubts, but only after looking over their shoulders and moving out of hearing of their neighbors.

"In every cemetery you see hundreds and thousands of graves," said a student at Tehran University who previously had studied in the United States. "In any country, if you want to build the country and all these young men die, what will happen? We are spending our money and our youth."

"I have many questions in my mind," he continued. "What is going to happen in this country? What is going to happen to the girls who have no husbands, when they get to be 35 or 40? Are we all going to take three or four wives?"

Diplomatic sources said that the high casualty count after last winter's assault on Iraqi forces near Basra particularly shook many families whose sons had gone to the front as basijis, or volunteers. According to one count, up to 50,000 Iranian youths were killed or wounded out of 100,000 dispatched to the region to fight, a high count even in a nation that seems fascinated with martyrdom.

Because of a drop in the number of volunteers since then, the Revolutionary Guards organized special brigades this spring to improve government services to the families of those who volunteer for the front, a diplomat said.

Despite the doubts, the fervor of Islamic and revolutionary revival has been maintained and continues to be the strongest force at the command of Khomeini's government, diplomats pointed out.

The killings at Mecca on July 31, for example, became a focal point for popular rallies and speechmaking against Iraq, Saudi Arabia and the United States for several weeks. An incident in which a U.S. F14 shot a missile at an Iranian F4 Phantom and missed, although it happened at about the same time, attracted little attention.

Several diplomats suggested Iranian leaders have deliberately used such controversies as the Mecca killings to whip up popular support that otherwise could flag under pressure from war casualties and economic hardships.

"They have to do something from time to time, apart from the war, to keep people alert on the revolution, to keep the thing alive," said one.

But for what diplomats said still appears to be a majority of Iran's 45 million inhabitants, particularly in the less developed countryside, the combined forces of religion and revolution have retained the ability to mobilize. In a poor suburb of Tehran, for example, a shopkeeper named Hussein responded to a question about his political views in a way that left little doubt about where he thought Iran was headed.

"You can just listen to {parliamentary speaker Ali Akbar Hashemi} Rafsanjani in the Friday prayers," he said, "and that is what I think."