At a farewell ceremony recently for a contingent of war volunteers leaving for the battlefront, Iranian leaders gathered on a marble platform outside the assembly building here. Those in religious robes were the dominant group, with those wearing trousers and jackets a clear minority.

It was a dramatic reminder that Iran today, seven years after the overthrow of the shah, is very much a theocratic state.

Of the country's five leading figures, only one -- Prime Minister Mir Hossein Mousavi -- is a layman. Ruhollah Khomeini and Hossein Ali Montazeri, the supreme leader and his chosen successor, are both ayatollahs; President Ali Khamenei and Consultative Assembly Speaker Ali Akbar Hashemi Rafsanjani are both hojatoleslams -- one rank below ayatollah.

The clergy's firm control extends far down into society in this strategic country of 44 million people. More than 100,000 clerics, many with advanced theological degrees, run an interlocking system of holy shrines, richly endowed religious trusts, neighborhood mosques and Islamic associations that thoroughly spread the authority of the theocratic state.

The regime's Islamization program has left no aspect of life untouched. The legislative assembly and the courts are under firm control of clergy and other committed Moslems. The banking system is now run according to religious guidelines and the clergy control the education system, from kindergarten to graduate school, as well as the publishing industry.

Through these steps, Khomeini and his supporters have moved close to fully institutionalizing the control of Iran by the mullahs in a way that is likely to perpetuate the hard-line Islamic hold on this country after the death of the 83-year-old ayatollah.

In an effort to assess the effect and extent of this vast transformation of what once was well on its way to becoming a western-oriented society, I recently attended a meeting of Khomeini with 500 relatives of Iran's war dead; sat in on a theological lecture by Montazeri at Qom, the country's spiritual capital; visited a former movie theater in northeastern Tehran that has been converted into a mosque and Islamic center, and observed a factory work force at daily prayers.

Visits to Khomeini's headquarters in the north Tehran suburb of Jamaran are strictly controlled, with elaborate security for visitors both to preserve his health and to protect him from assassination. Yet he meets weekly with select groups of citizens and is kept in public view through radio and television reports on these appearances.

The groups can be employes of the National Iranian Oil Co., cadres of the Reconstruction Crusade, bazaar traders, or assembly deputies, for example.

At the meeting with the 500 relatives of the war dead, Khomeini appeared on the balcony of his mosque, standing erect and firm. The audience greeted him with clenched fists, shouting: "Allah is great, Khomeini is our leader," and "Death to America, Death to Russia, Death to Israel."

Khomeini then sat quietly in a chair as the head of the Martyrs' Foundation gave a brief report to the audience. Then Khomeini rose and raised his hands in blessing as the audience shouted slogans.

On occasions of religious or state importance, Khomeini addresses his audience -- as he did when he met with civilian and military officials on the prophet Mohammed's birthday on Dec. 1. This week, he made a rare public appearance when he spoke at a rally marking the seventh anniversary of the overthrow of the shah.

In contrast to Khomeini's infrequent public speeches, Montazeri, his longtime associate and the country's second most powerful figure, delivers an hour-long lecture every morning at his headquarters in Qom, the spiritual capital of Iran, 150 miles south of Tehran. The subject is invariably theological, and his audience limited to a few hundred graduate students of theology. I joined these robed men as they underwent strict security checks, surrendering all possessions except notebooks and pens, before entering the lecture hall and sitting on the carpeted floor.

A curtain at the end of the hall opened and Montazeri, a stocky, white-bearded man in a brown cloak, stepped forward. His subject was: "Who can rule an Islamic state?"

Montazeri pursued his theme with quotations in Persian and Arabic without once looking at his notes. Occasionally a student voiced a different quotation. Montazeri listened, replied briefly, and resumed the thread of his argument.

Today there is a surge in religious education. To the important theological colleges in Qom, Mashad, Tabriz, Isfahan, Shiraz and Yazd was added, two years ago, the Imam Sadiq University in Tehran. Before the revolution there were 10,000 theological students in Iran; today there are about 33,000.

With 20,000 students, Qom is the largest center of religious learning. The most desired college is Faiziya, open only to higher-level students. Muhammad Akramin, 28, is a typical young scholar. He has spent half his life in Qom, pursuing theological studies, and it will take him five more years before he gets his darse, his advanced degree in theology. It was his shopkeeper father who wanted him to become a clergyman.

Sayedzadeh Tehrani, an older friend, is a cleric in Shahr Rey, a suburb of south Tehran. Tehrani is an eminent member of the local Islamic Propagation Organization and works closely with the Islamic Association at the Saadi Tile Co., where he leads daily prayers for the employes. The day I attended, 500 employes -- more than a third of the work force -- participated.

Islamic Associations, voluntary bodies open to all Moslems, were established after the 1979 revolution and now exist in nearly all of Iran's villages, urban neighborhoods, workplaces and military garrisons.

Their main aims are raising the religious consciousness of the people, winning their support for the Islamic regime's policies, and guarding the security of the individual workplace.

The number of mosques has soared, with urban mosques reportedly at more than twice their prerevolution total of 5,600, and an estimated 25,000 mosques throughout the country. Some of them are new, others are conversions of secular buildings. Masjid al Nabi -- Mosque of the Prophet -- in Narmak, a northeastern district of Tehran, is an example of the latter, having been the Monte Carlo Cinema during the shah's rule.

It has a library and a reading hall. A newly built dome and Koranic verses inlaid around the frame of a large window give the former theater an Islamic look. Downstairs, a hall has been partitioned to provide segregated prayer facilities for men and women.

Volunteers in the mosque's office administer the rationing system for basic necessities for the 11,000 families living in the area. The mosque has a consumer cooperative store and the walled compound outside is used as a training ground for war volunteers.

The mosque has classes in the Koran and Arabic as well as interest-free loans to those in need.

Between 100,000 and 120,000 qualified clerics -- about one for every 400 Iranians -- and an unknown number of unofficial village preachers, prayer leaders and theology teachers run the network of holy shrines, richly endowed religious trusts called waqfs, theological schools, neighborhood mosques, and Islamic Associations.

They get their revenues -- often substantial -- from a variety of sources prescribed by the Koran and Islamic tradition: profits from administering religious trusts, consisting of properties donated by the faithful; pilgrims' donations to shrines, and Islamic taxes.

As an example of the size of these funds, the border town of Howeizeh, virtually destroyed in the war with Iraq, recently was rebuilt at a cost of $120 million -- paid from donations by the 8 million pilgrims who visited the shrine of Imam Reza in Mashhad last year.

Each Shiite Moslem adult is expected to give 2.5 percent of his income to an ayatollah, to be spent as charity. Shiites also must donate one-fifth of business profits, to be kept in trust until the reappearance of the Twelfth Imam, who vanished in 873 A.D.

An ayatollah -- there are six in Iran -- uses these funds for charity, as stipends and scholarships to theology students, and to run theological schools.

As the supreme Islamic authority, Khomeini controls the appointment of all local Friday prayer leaders -- the clergymen who deliver the main sermon to a mosque's congregation. The sermon covers political and social issues as well as religious topics, and the cleric often speaks in favor of official decisions and galvanizes public opinion behind the Khomeini regime.

The importance of the Friday prayer leader is underlined by the fact that Khamenei occupies this position in Tehran, with Rafsanjani preaching in his absence.

It is against this background that the regime has carried out its Islamization program in what, elsewhere, would be secular areas.

Islamic banking is now in place. Since the Koran forbids interest, an Islamic bank has "interest-free" sections at which needy customers can borrow without interest, but also "term-deposit" sections that make commercial loans for fees, with profits shared by depositors.

The legal system and the laws have all been Islamized. So has education, by a complete changeover of textbooks and a systematic purging of teachers whose Islamic credentials were in doubt.

The publishing of books is controlled by the Islamic Guidance Ministry, headed by a cleric.

The ministry excises objectionable material from books, periodicals and newspapers. Movie theaters show either heavily censored foreign movies or locally made films whose scripts have been approved.

The Experts' Assembly, which chooses the supreme leader and Leadership Council, is by decree made up exclusively of clergy.

Nearly half of the 270-member elected assembly -- 122 members -- are clergymen and the rest, including the four women, are all devout Moslems. Nonetheless, there is a Guardians' Council -- six clerics appointed by Khomeini and six lawyers elected by the assembly to review all bills to guard against heretical legislation.

Outside the home, all women -- Iranian or foreigners -- must wear Islamic dress, but the definition of what is Islamic is less stringent than immediately after the revolution. Now, instead of the chador, or full shroud, Islamic dress is prescribed simply as "a large scarf, and a long and loose dress with trousers or long, thick socks."

Diplomatic observers in Tehran feel that having Islamized basic aspects of life, the Khomeini regime can afford to make minor concessions without weakening the grip of the theocratic state.