The towering concrete piers loom in the middle of the Thames River like a flotilla of warships bearing down on London. They actually are the most visible parts of a massive movable dam, still under construction, to defend the city from the persistent threat of flood implicit in the high water lapping around the piers on a recent winter afternoon.

Between the piers, hidden under water and out of the way of shipping in curved, concrete sills on the river bottom, will be huge, half-moon-shaped steel floodgates. When needed to block one of the dangerous surge tides that periodically rush up the Thames estuary from the North Sea, they will be rotated upright to form a dam a third of a mile across the river, 8 miles downstream from London Bridge.

When it is finally finished at the end of 1982, the Thames Barrier will be an engineering marvel. Its unique rotating gates have attracked the attention of flood engineers from Leningrad to New Orleans. Already, it rivals other ambitious public works projects like Washington's Metro subway for futuristic design and technological challenge, as well as construction delays and cost overruns.

Londoners only hope that it will be ready in time to save their sinking city from a catastrophic tidal flood.

Like the Potomac in Washington, the Thames in London rises and falls twice daily with the tides, only more dramatically because the tides come from the North Sea rather than Chesapeake Bay. It is hard to imagine the Thames posing much danger at low tide on a lazy summer day when its muddy bottom lies exposed 19 feet below the top of the high stone walls along its snake-like course through the city.

But a high tide under certain climatic conditions that occur freuqently between the beginning of autumn and the end of spring each year, the river splashes up near the top of those walls, as it has several times this winter. Just a foot or two higher, and the Thames would flood nearly 50 square miles of inner London where more than a million people live and work.

Such a flood would swamp the Houses of Parliament, Westminister Abbey, possibly parts of Buckingham Palace, and a quarter of a million other buildings including 35 hospitals, 15 power plants and several major railroad terminals. Fifty stations and 46 miles of London subway tunnel would be inundated, along with the area's entire sewer, water and underground gas, electricity and telephone networks.

An hour before an impending flood, sirens last used to warn of German bombing raids during World War II would sound the final alarm. People who had failed to heed earlier radio and television warnings to leave the area while buses, subways and trains were still running would then be expected to "go upstairs and stay put."

A massive military rescue effort codenamed "Operation Giraffe" would be rushed into action with troops, landing craft and helicopters.

"Although this has been a relatively quiet year," according to Bill Cook, who supervises the Greater London Council's around-the-clock flood alert system, "we have come within an hour of issuing the first warnings three times this winter."

As far back as written chronicles go, there are accounts of great London floods.Stow's history of England reports that during 1236, "in the great palace of Westminister men did row with wherries in the midst of the hall," surrounded today by the houses of Parliament.

Diarist Samuel Pepys recorded on Dec. 7, 1663, that "there was last night the greatest tide that ever was remembered in England to have been in the river, all Whitehall having been drowned." Most British government offices are still located on low ground in and around Whitehall.

There have been other much less extensive floods through the years, like to one in 1928 that killed 14 people in homes along the Thames in central London. In 1953, only the collapse of retaining walls downstream saved central London from disaster when the river rushed instead across the lowlands east of the city, killing more than 300 people and destroying 50,000 homes. Those protective walls have since been rebuilt higher and stronger than ever, virtually guaranteeing that the crest of the surge tide would reach the heart of London next time.

Like the prospect of a devastating earthquake along the San Andreas Fault in California, the threat of a killer flood here grows, each year. London is literally losing ground to the Thames, with the average level of the river at high tide rising by four feet every century as the city continues to settle into the soft clay on which the Romans founded it nearly 2,000 years ago.

In addition, Britain has been tilting towards the North Sea since the end of the Ice Age. Freed of its glacial cover, northwestern Scotland is rising, and southeastern England, including London, is being slowly lowered into the English Channel.

These geological problems might be manageable were it not for the phenomenon of surge tides in the North Sea. Pockets of low air pressure and gale winds stir up these small tidal waves and drive them down the North Sea toward southern England and the coasts of Holland and Belgium, where they have nowhere to go but inland.

If one of these surge tides is pushed into the Thames estuary on top of a normal high tide when the river in unusually swollen by rain water, flooding will be inevitable unless the river's banks are built up still higher. But British officials ruled that out because they do not want the Thames to disappear entirely from view inside a stone canyon, nor do they want to further alter historic and scenic areas and river walks along its banks.

So they looked for a way to build a flood barrier downstream that would stop a surge tide from reaching central London while not blocking shipping along the river the rest of the time. A London civil engineer, Charles Draper, whose mother was a close friend of a family that perished in the 1928 Thames flood, came up with the idea of the movable Thames barrier.

Noticing the round rotating valve of his home's main gas tap one day, he invented the barrier's concept of floodgates rotated by giant stell discs on the sides of the barrier's piers. This design enables the four main 1400-ton floodgates, each big enough by itself to dam the entire river upstream in London, to be kept out of the way when not in use. When needed, they can be rotated upright within half an hour.

But it has been difficult to put Charles Draper's invention into action.

There have been problems with planning delays, working with the hard but brittle chalk below the river bottom in which the barrier is being anchored, constructing coffer dams to be able to pour concrete on a dry river bed, and overcoming labor union resistance to the long hours and flexible work rules oof continuous construction.

Deadlines came and went and cost estimates were repeatedly torn up. The barrier, now three years behind schedule, it expected to cost nearly a billion dollars plus the expense of further raising retaining walls downstream to contain the water pushed back when the floodgates are raised.

Thre is a sobering footnote. The Thames Barrier is expected to protect London for only about 50 years. By the year 2030, according to government studies, the rising tides will threaten to surmount the barrier, which Granger said cannot be built any larger.

"We are working at the limits of present technology," he explained. "By 2030, another generation of engineers will have to look at what to do next about the problem. They may have to come up with an entirely different solution."