In the popular novel, "The Crash of '79," author Paul Erdman prophesied the collapse of the Western financial system when oil-producing countries withdrew the hundreds of billions of dollars they had on deposit in Western banks.

Iran, which figured prominently in the recent novel, will withdraw billions of dollars of deposits from domestic offices and foreign branches of major U.S. banks as part of an agreement to return the 52 American hostages. The funds are a sizable portion of the deposits President Carter froze Nov. 14, 1979, days after hostages were seized in Tehran. There will be a sudden flight of several billion dollars from the dozen or so American banks with Iranian funds.

But unlike Erdman's fictional scenario, there will be no financial Armageddon for the U.S. banking system.

Although the numbers sound large, and are, the foreign banks that get the deposits the U.S. banks lost probably will redeposit the same funds in U.S. banks within minutes or hours. A foreign bank, say in Switzerland, will accept deposits not only in its own currency (the franc) but in foreign currencies, such as dollars.

But the banks will take their newly acquired dollar deposits and deposit them in a U.S. bank with which they do business. If the Iranians choose to keep some of their assets in dollars -- and they probably will, because much interational trade is conducted in dollars -- the money will find its way back to the United States quickly, according to Monroe J. Heagele, vice president and economist for First Pennsylvania Bank.

Furthermore, U.S. banks have anticipated the loss of these deposits for several days, at least. Banking sources said U.S. banks have been adding to their deposits in recent days by selling such securities as certificates of deposit to big investors, both in United States and abroad. In recent years big banks have had to rely on such "purchased deposits" to come up with a sizable portion of the funds they in turn lend to their customers.

The banks probably will pay slightly more interest for these replacement deposits but the increased costs will do little more damage to the banks than to reduce their earnings nearly imperceptibly.

Even if a bank should find itself unable to come up the deposits it needs, the Federal Reserve system, the nation's central bank, will lend the bank what it needs to replace the lost Iranian accounts. "We stand ready, as lender of last resort, to do what is needed," a Federal Reserve official said, adding that he does not expect U.S. banks to have any difficulty replacing the lost deposits.

It is unlikely that Iran will want to keep all its reacquired billions in the form of U.S. dollars. Iran could decide to convert some of its reacquired dollars into other currencies, such as West German marks or Japanese yen. If that happens, the dollars might take a slight beating on foreign exchange markets, depending on how many dollars are sold for other currencies. But even that depends on the psychology of investors who buy and sell foreign currencies.

The settlement of the Iranian crisis could so boost confidence in the dollar that euphoria could overcome the otherwise depressing effect of a sudden selling of dollars by Iran.

If Iran uses some of its unfrozen deposits to buy goods and services, the dollars will either flow to the United States, to foreign banks in the form of dollars that get redeposited in the United States or to the foreign exchange markets.

The settlement of the crisis itself may affect the psychology of the gold, silver and stock markets and, depending upon how those unpredictable investors react, could either push up prices or depress them. Because gold prices usually rise during periods of heightened international tensions, the resolution of the hostage crisis should drive metals' prices down. The stock market prefers tranquility and prices should benefit from the settlement.

But no one yet has been able to foretell the actions of fickle investors accurately. The resolution of the crisis could spark movements in market prices that are seemingly contradictory to what the experts expect.

One thing is clear, however, The "Crash of '79," so unrealized by the first month of 1981, will not be triggered by the settlement of the hostage crisis in Iran.