ALMOST TEO MONTHS have passed since Iran declared martial law but the country remains in terrible trouble and the shah seems uncertain what to do. One can sympathize with him: For decades he worked to modernize. He thought he was doing fine; many foreign friends told him so. He believed his people were behind him. Certainly no one in the American government, his principal patron, was warning him that rouble lay ahead. But then suddenly the fever of the post-1973 oil boom infected the whole society with a still-unnamed disease. What seemed to be erratic but steady progress turned overnight into calamity. Shocked, the shah has since evidently become a moody man, wary of his civilian and military adviserrs but resigned to seeing them make key decisions. Leadership, supposedly his long suit, is simply not coming through.

Alienation in Iran is now so raw and universal that any attempt to satisfy one political claimant turns out to outrage others. To offer political liberalization to the middle class, as Iran is doing, offends the army's sense of order and the religious right's sense of propriety. Yet to cater to their concerns in this regard would send the middle class up the wall. The economy, built on an oil bubble, is scarcely functioning; virtually the whole oil industry is out on one or another kind of strike. But the government, to appease the discontent, has granted extravagant pay increases and promised lavish argicultural and social reforms. Multi-billion-dollar prestige projects in fancy weapons and nuclear power face cancellation, yet they have their important constituencies, too.

This administration inherited a deep American commitment to the shah and to his heady view of the importance of Iran in the strategic scheme of things. A vision of disintegration across the whole tier from Turkey through Iran to the Asian subcontinent, with Moscow ultimately making sport with the pieces, flits fearfully across the minds of high officials. Jimmy Carter's support of Iran and the shah has emphasized political liberalization. The rationale is that unless it is given a chance, chaos or an unworkable string of coups are the only alternatives.

Political liberalization involves, of course, a great gamble. Who knows what really will work? The place is in many respects still feudal; it is not what you would call Thomas Jefferson country. But the shah, or whichever combination of his lieutenants is really running Iran, seems to be taking that gamble. At least for as long as he does, the United States has no good choice but to help him see it through.