For the past few years, the once bustling Bethlehem Steel shipyard here has been losing a struggle for survival.

Last spring the yard, once the world's most productive, was down to its final project, a repair job on a Danish tanker. With no new contracts on the horizon, the remaining 1,200 boilermakers, welders, machinists and electricians were facing a final shutdown this fall.

"It was sort of like looking over the edge of a cliff and not knowing if you're going to have to jump or not," said David Watson, the shipyard's general manager.

Late last month, the Navy threw Sparrows Point a temporary lifeline -- a $130 million contract to build two electronic surveillance ships that will keep the yard alive for 2 1/2 more years. But the joyous reaction here was quickly tempered by the bleak reality of modern shipyard economics.

The new Navy contract, won on the basis of painful union concessions, will not bring Sparrows Point a profit. Nor will it bring back the 1,300 employes who have been laid off in recent years. And when it expires, the yard will be back where it started, scrambling for work in a dwindling market in which there is only one major customer left, the United States Navy.

The recent collapse of commercial shipbuilding in the United States is not hard to trace. Construction came to a virtual halt after President Reagan abolished a 44-year-old program of federal construction subsidies in 1981.

Since then, 25 of the nation's 115 shipyards -- including two here in the Baltimore area -- have shut their gates for good. Total shipbuilding employment has dropped from 115,000 to 90,000 -- perhaps 10 percent in repair work -- and another 30,000 jobs are expected to vanish in the next five years, meaning that the industry will have been cut in half during the 1980s.

"Where we used to have shipyards, we now have Marriott hotels and boutiques and shops," said Navy Secretary John F. Lehman Jr.

While many experts say inefficient shipyards and high union wages have permanently priced the United States out of the world market, maritime officials and some military strategists say the country has little choice but to rescue an industry they believe is vital to national defense. Even with the Navy's huge military buildup and an expanded program of chartering civilian ships, some officials warn that the Pentagon will not have enough seapower to supply its troops with food and equipment in time of war.

Defense Secretary Caspar W. Weinberger said recently that the Navy's shipbuilding program is "insufficient to support the nation's present shipyards at an efficient level of production . . . . Clearly what is needed is a revitalization of the commercial segment of the maritime industry."

"God help us if we're ever in a protracted conflict, because you have to support your troops," said Rep. Roy Dyson (D-Md.), who lobbied the Navy to keep Sparrows Point alive. "We have to hope the allies will be kind enough to let us use their ships."

Yet the national defense argument, the prime justification for maritime aid programs for the past 50 years, is meeting increasing skepticism in some circles. A controversial report approved yesterday by the National Advisory Committee on Oceans and Atmosphere concluded that even the country's currently diminished shipyard capacity is "considerably greater" than would be required in a major conventional war and that there is no need for renewed subsidies to keep faltering shipyards alive.

One premise of the report, which is based on classified Pentagon studies, is that the shipyards -- some of which are operating far below maximum capacity -- could expand their production by 3 1/2 to six times during a full-scale mobilization, providing all the new ships that would be needed in a prolonged global conflict.

"Look at England in the Falklands," said retired rear admiral Nathan Sonenshein, a former commander of Navy shipbuilding and a member of the panel that approved the report. "In less than two months, they were able to modify and convert some 50 of their merchant ships that were then used for naval operations.

"Sure, it's always better to have more shipyards and more merchant ships to give you a margin of safety. But the hard question is, are you going to pay for it? I wouldn't pay for any more than we now have."

For struggling U.S. shipyards, that is clearly not enough. In fact, there are few areas of the economy where industry officials are more candid about their inability to cope with foreign competition.

It costs three times as much and takes twice as long to build an oceangoing ship in the United States as it does in the booming shipyards of Japan and South Korea, which now produce more than half of the world's commercial ships.

"We cannot compete in the world market," said Lee Rice, president of the Shipbuilders Council of America. "It's worse than it's ever been . . . . We cannot win an argument on the economics. We have to reduce it to the fundamental national security issue."

"How can I compete with the South Koreans?" asked Richard F. Brunner, senior vice president of Avondale Shipyards in New Orleans, in an interview last year. "My labor rate is $11 an hour and theirs is $2. If I spent zero for labor, if I had no labor cost at all, my construction would be just slightly higher than the Koreans' . . . . Well, I can't get zero labor."

Watson said that even Bethlehem Steel's Singapore shipyard, where wages are $4.50 an hour, cannot match financial incentives offered by the Japanese and Koreans. "They blow your brains out with low-cost financing," he said.

When Reagan took office, 65 commercial ships were on order in the United States. No new contracts were placed with U.S. yards until last year, when five ships were ordered for the domestic trade, which is reserved for U.S. carriers.

This seemingly irreversible tailspin comes at a time when the U.S.-flag fleet, which had 5,000 active ships at the end of World War II, has dwindled to fewer than 400.

The administration's plan for replenishing the fleet is to allow companies to build ships in the Far East and still receive federal operating subsidies -- an approach that would all but write off U.S. shipyards. At the same time, it is gradually increasing the Ready Reserve Force, a carefully maintained backup fleet that can be broken out on five to 10 days' notice. The 50-ship fleet is expected to grow to 116 by 1991.

The Navy has also been buying and leasing a growing auxiliary fleet, including 18 electronic surveillance ships, 15 refueling vessels, 13 weapons-stockpile ships, eight heavy-equipment carriers, three floating supermarkets, two cable-laying ships, two survey ships, two missile resupply ships, two aviation supply ships and two hospital ships.

Still, the big money remains in the buildup of warships for Lehman's 600-ship Navy, which administration officials once argued would be the shipbuilding industry's salvation. And to be sure, a handful of big shipyards are booming now with billions of dollars in orders for new nuclear aircraft carriers, submarines and other vessels that form the backbone of Lehman's armada.

Yet this naval work is highly concentrated. Three of these yards -- Newport News Shipbuilding & Dry Dock Co. in Virginia, General Dynamics Corp.'s Electric Boat yard in Connecticut, and Ingalls Shipyard in Mississippi -- will receive 73 percent of the Navy's $12.4 billion budget for shipbuilding this year.

Those billions have done little to help yards such as Tacoma Boatbuilding Co. in Washington state, which has been teetering on the edge of bankruptcy for more than a year and was forced to lay off about a third of its 1,400-person work force last year.

The naval buildup has also been little comfort for Baltimore's once thriving shipbuilding industry: Maryland Shipbuilding and Drydock closed its gates for good here in 1983, and Bethlehem Steel's Key Highway shipyard became a casualty in 1982 and is currently targeted for condominiums near the shops of Harborplace.

Now only Sparrows Point is left, carrying on a struggle that some here believe may be a lost cause.

The fate of this 19th century facility, now a sleepy jungle of cranes and work sheds, mirrors the industry's rise and fall. Founded in 1891 and acquired by Bethlehem Steel a quarter-century later, the yard was once a thriving anchor in Baltimore Harbor, churning out hundreds of military cargo carriers during World War II and commercial tankers in the postwar boom years.

In 1953, it was the world's most productive shipyard, delivering 10 vessels in a single year. As recently as 1969, the six tankers it completed made it first in the nation in terms of tonnage delivered.

In the early 1970s, the 5,000 employes who passed through its gates each day were part of a Bethlehem Steel work force of 27,000 that made the company the No. 1 employer in Maryland.

But as the demand for U.S.-built ships continued to slip -- in part because of a worldwide oil glut that eliminated the demand for new oil tankers -- Sparrows Point was forced to extraordinary lengths to seek military contracts. In 1982, the yard won a contract to repair three auxiliary ships for the Navy, but that work is almost finished.

Desperate to lower its bidding rates, the shipyard staked its future on a series of painful concessions it won from the local shipbuilding union last year: a no-strike clause, an end to cost-of-living raises and a two-tiered wage scale that cut a starting mechanic's pay from $10.50 to $8.50 an hour.

It was a difficult pill for the workers to swallow, even though management was accepting a 5 percent pay cut. Month after month, Sparrows Point was still outbid for military contracts, and a crucial commercial order vanished when the financing fell through.

"People here were bitter -- who wouldn't be?" James Childs, the local union treasurer, said before the new Navy contract award. "We made those concessions in good faith. Everybody who voted for them thought they were going to get work. People felt like they got egg on their face."

"It's painful," said welder Gary Maxwell, a 17-year veteran. "You get up in the morning and you don't know if you're going to be here at the end of the day."

The yard's luck finally changed last month when it outbid Avondale to snare the contract on electronic surveillance ships. But Bethlehem Steel was forced to bid so low -- nearly $100 million below what the Navy has budgeted for the ships -- that the work is hardly a bonanza.

"We got a reprieve," said Watson, who must lay off 600 more workers before the Navy work brings the yard back to current levels. "But the company didn't bid this with the idea of making a killing or even making a profit . . . . The industry doesn't have enough work to go around, and these bids are reflecting that."