ISTANBUL -- As he surveys the streets of this sprawling mega-city, Mustafa Erdik, the director of an earthquake engineering institute here, says he sometimes feels like a doctor scanning a crowded hospital ward.
It is not so much the city's modern core, where two sleek Trump Towers and a huge airport terminal were built to withstand a major earthquake that is considered all but inevitable in the next few decades. Nor does Dr. Erdik agonize over Istanbul's ancient monuments, whose yards-thick walls have largely withstood more than a dozen potent seismic blows over the past two millenniums.
His biggest worry is that tens of thousands of buildings throughout the city, erected in a haphazard, uninspected rush as the population soared past 10 million from the 1 million it was just 50 years ago, are what some seismologists call "rubble in waiting."
"Earthquakes always find the weakest point," said Dr. Erdik, a professor at Bogazici University here.
Istanbul is one of a host of quake-threatened cities in the developing world where populations have swelled far faster than the capacity to house them safely, setting them up for disaster of a scope that could, in some cases, surpass the devastation in Haiti from last month's earthquake.
Roger Bilham, a seismologist at the University of Colorado who has spent decades studying major earthquakes around the world, including the recent quake in Haiti, said that the planet's growing, urbanizing population, projected to swell by two billion more people by midcentury and to require one billion dwellings, faced "an unrecognized weapon of mass destruction: houses."
Without vastly expanded efforts to change construction practices and educate people, from mayors to masons, on simple ways to bolster structures, he said, Haiti's tragedy is almost certain to be surpassed sometime this century when a major quake hits Karachi, Pakistan, Katmandu, Nepal, Lima, Peru, or one of a long list of big poor cities facing inevitable major earthquakes.
In Tehran, Iran's capital, Dr. Bilham has calculated that one million people could die in a predicted quake similar in intensity to the one in Haiti, which the Haitian government estimates killed 230,000. (Some Iranian geologists have pressed their government for decades to move the capital because of the nest of surrounding geologic faults.)
As for Istanbul, a study led by Dr. Erdik mapped out a situation in which a quake could kill 30,000 to 40,000 people and seriously injure 120,000 at the very minimum.
The city is rife with buildings with glaring flaws, like ground floors with walls or columns removed to make way for store displays, or a succession of illegal new floors added in each election period on the presumption that local officials will look the other way. On many blocks, upper floors jut precariously over the sidewalk, taking advantage of an old permitting process that governed only a building's footprint.
Worse, Dr. Erdik said, as with a doctor's patients, not all of the potentially deadly problems are visible from the outside, and thousands more buildings are presumed to be at risk. "Little details are very important," he said. "To say that a building is in bad condition is easy. To say that one is safe is hard."
Some of Turkey's biggest builders have readily admitted to using shoddy materials and bad practices in the urban construction boom. In an interview last year with the Turkish publication Referans, Ali Agaoglu, a Turkish developer ranked 468th last year on the Forbes list of billionaires, described how in the 1970s, salty sea sand and scrap iron were routinely used in buildings made of reinforced concrete.
"At that time, this was the best material," he said, according to a translation of the interview. "Not just us, but all companies were doing the same thing. If an earthquake occurs in Istanbul, not even the army will be able to get in."
Echoing other engineers and planners trying to reduce Istanbul's vulnerability, Dr. Erdik said that the best hope, considering the scale of the problem, might well be that economic advancement would happen fast enough that property owners could replace the worst housing stock before the ground heaved.
"If the quake gives us some time, we can reduce the losses just through turnover," Dr. Erdik said. "If it happens tomorrow, there'll be a huge number of deaths."
But when a potent quake hit 50 miles away in 1999, killing more than 18,000 people, including 1,000 on the outskirts of Istanbul, the city was reminded that time might not be on its side. That earthquake occurred on the North Anatolian fault, which runs beneath the Marmara Sea, just a few miles from the city's crowded southern flanks.
The fault, which is very similar to the San Andreas fault in California, appears to have a pattern of successive failures, meaning the section near Istanbul is probably primed to fail, said Tom Parsons, who has studied the fault for the United States Geological Survey.
Istanbul stands out among threatened cities in developing countries because it is trying to get ahead of the risk.
A first step was an earthquake master plan drawn up for the city and the federal government by Dr. Erdik's team and researchers at three other Turkish universities in 2006. Such a plan is a rarity outside of rich cities like Tokyo and Los Angeles.
Carrying out its long list of recommendations has proved more challenging, given that the biggest source of political pressure in Istanbul, as with most crowded cities, is not an impending earthquake but traffic, crime, jobs and other real-time troubles.
Nonetheless, with the urgency amplified by the lessons from Haiti's devastation, Istanbul is doing what it can to gird for its own disaster.
The effort to prepare is coming from the top, with tighter building codes, mandatory earthquake insurance and loans from international development banks for buttressing or replacing vulnerable schools and other public buildings.
But a push is also coming from the bottom, as nonprofit groups, recognizing the limits of centralized planning, train dozens of teams of volunteers in poor districts and outfit them with radios, crowbars and first-aid kits so they can dig into the wreckage when their neighborhoods are shaken.
Mahmut Bas, who leads the city's Directorate of Earthquake and Ground Analysis, is charged with consolidating and coordinating everything from building inspections to emergency response. Yet the bureaucracy is almost as sprawling and inefficient as the dizzying web of smog-shrouded streets, clogged with an estimated six million vehicles.
Mr. Bas said collapsing buildings were just one of many threats. One prediction about a potent quake concluded that 30,000 natural gas lines were likely to rupture. "If just 10 percent catch fire, that's 3,000 fires," he said, adding that the city's fire stations are able to handle at most 30 to 40 fires in one day.
Still, keeping vital structures standing -- those fire stations, hospitals and schools -- remains the prime priority.
Under a program financed with more than $800 million in loans from the World Bank and the European Investment Bank, and more in the pipeline from other international sources, Turkey is in the early stages of bolstering hundreds of the most vulnerable schools in Istanbul, along with important public buildings and more than 50 hospitals.
With about half of the nearly 700 schools assessed as high priorities retrofitted or replaced so far, progress is too slow to suit many Turkish engineers and geologists tracking the threat. But in districts where the work has been done or is under way -- those closest to the Marmara Sea and the fault -- students, parents and teachers express a sense of relief tempered by the knowledge that renovations only cut the odds of calamity.
"I hope it's enough," said Serkan Erdogan, an English teacher at the Bakirkoy Cumhuriyet primary school close to the Marmara coast, where $315,000 was spent to add reinforced walls, jackets of fresh concrete and steel rebar around old columns and to make adjustments as simple as changing classroom doors to open outward, easing evacuations.
"The improvements are great, but the building may still collapse," he said. "We have to learn how to live with that risk. The children need to know what they should do."
In a fifth-grade classroom, the student training that goes with the structural repairs was evident as Nazan Sati, a social worker, asked the 11-year-olds what they would do if an earthquake struck right at that moment.
At first a forest of hands shot toward the ceiling. Ms. Sati quickly told them to show, not tell. In a mad, giggling scramble, the students dove beneath their desks.
But the threat for children, and their parents, also lies outside the school walls, in mile upon mile of neighborhoods filled with structures called gecekondu, meaning "landed overnight," because they were constructed seemingly instantly as hundreds of thousands of migrants from rural regions flowed into the city seeking work in the past decade or two.
That kind of construction is commonplace in many of the world's most unstable seismic zones. Dr. Bilham at the University of Colorado has estimated that an engineer is involved in just 3 percent of the construction under way around the world.
Peter Yanev, who has advised the World Bank and the insurance industry on earthquake engineering and is the author of "Peace of Mind in Earthquake Country," noted that in Turkey and other developing countries, even when someone with an engineering degree was involved, that was no guarantee of safe construction because there was little specialized training or licensing.
In the face of such problems, efforts are under way in Istanbul's crowded working-class and poor neighborhoods to train and equip several thousand volunteers to be ready to respond when, not if, the worst happens.
On a sunny Saturday morning, Mustafa Elvan Cantekin, who directs the Neighborhood Disaster Support Project, navigated back streets to meet with one team deep in the city's Bagcilar district, where one estimate projects that some 4,200 people would be likely to die in a major earthquake.
Dr. Cantekin, a Turkish engineer educated at Texas A&M University and tested in the 1999 earthquake zone, has helped create 49 neighborhood teams in the city, each with a shipping container loaded with crowbars, generators, stretchers and other emergency gear.
Through the project, paid for by a Swiss development agency and private companies, he has traveled to Morocco, Jordan and Iran to help initiate programs there based on Istanbul's.
A map on his lap showed that the neighborhood was on the border of red and orange danger zones delineating the worst seismic risks. He pointed to one building after another where there was no permanent roof but instead columns poking skyward in anticipation of a landlord finding a new tenant and adding yet another unlicensed floor -- and another layer of risk.
As his car crawled through mazes of traffic-choked streets, Mr. Cantekin said the harsh reality for the dozens of small communities within a mega-city, as with the residents of shattered towns in Sichuan Province in China after the 2008 earthquake there, was that they would have to be self-reliant when the quake hit.
"China has the biggest civil defense capability in the world, but it still took three or four days to reach the collapsed towns," he said. "If there is the big one here, you are all alone to cope with whatever you have, at least for the first 72 hours."
Outside a community center where children sat at computers playing Farmville on Facebook, Mr. Cantekin inspected the container contents with the team leader, Cuma Cetin, 36, a father of five and a factory worker.
"We're not waiting for the disaster," Mr. Cetin said as he and his team, dressed in orange coveralls, accompanied Mr. Cantekin while he pointed out fatal flaws in nearby buildings.
Along an avenue that was a stream bed four decades ago, in a spot where houses were built on sediment instead of bedrock and thus particularly vulnerable, Mr. Cantekin led the team into a ground-floor area beneath four stories of apartments with laundry flapping in the breeze on balcony after balcony.
The columns holding up this part of the building are too thin, he said, pointing to cracks that have already scarred the concrete surface.
"This is one of the first to go," Mr. Cantekin said, before they walked on to the next one.
This article originally appeared in The New York Times .