The explosion blew the roof vent off and charred the wall above the place the garbage trucks unload. Another old gas tank or kerosene can or gas cylinder, no one knew which, had blown up in one of Maryland Environmental Services' experiments in dealing with two growing national problems: the shortage of energy and the surplus of junk.

"We regard waste as a natural resource, a raw material," said Michael T. Long, administrative services chief as MES. Trying to squeeze energy out of trash in Baltimore County and garden compost out of sewage in Beltsville, MES expects explosions and nasty odors and makes plans accordingly.

Long described MES as "a bastard agency" of uncertain antecedents and conflicting loyalties, charged in the 1970 legislation that created it with being as creative as possible. Although it is an agency of the Maryland Department of Natural Resources and runs all the state sewage facilities, it also has the structure of a corporation and operates local waste management projects on a non-profit, contract basis.

"That causes all kinds of problems," Long said. "We're a profit-loss operation in style with the rules and regulations of a stage bureaucracy."

The agency spends $12 million a year on 80 projects statewide, including $1.5 million of state money. The rest is from contracts to operate municipal sewage or water systems. "We get the tough ones. If a plant runs well we never see it, but if it's old or breaking down, a real dog, we get called in to take it over," Long said.

There are also special grants, like the $10 million in 1972 from the state and Baltimore County to finance the plant where explosions are just another daily hazard.

Trucks bring ordinary smelly neighborhood garbage in one side of the Maryland Resource Recovery Facility at a landfill in Cockeysville. There is everything from dinner scraps through newspapers to old refrigerators and mattresses.

Several things come out the other side: scrap iron and other ferrous metal that can be sold right back to steel plants; bits of glass; mountains of fluffy, confetti-like paper and plastic that will burn; and hard little pellets that also will burn.

The fluff and the pellets are "refuse-derived fuel," or RDF, one of MES's most promising experimental products. Studies agree that 60 to 80 per cent of all urban trash is burnable and has about half of two-thirds the energy content of the same weight of coal. The MES plant is selling some of its RDF to a Spring Grove, Pa., paper mill at about $12 a ton, less than half the price of coal, and industry officials predict that costs will decline.

"We designed the plant with occasional explosions in mind," said MES director Thomas D. McKewen. All the garbage goes into two massive shredders, each of which can reduce 55 tons of trash to two-to-six-inch particles every hour.

When the pounding steel grinders rip open paint cans or old gas tanks, however, the fumes occasionally ignite and there is a blast. The first big one, in early 1976, closed the facility for two months. At that time there were only two of the bulbous red explosion control devices on each shredder to douse fires and ease pressure buildup. Now each shredder has four and the recent explosion shut the place down for only a few hours.

Such problems, however, have contributed to the image of alternative energy sources like refuse-derived fuel as trouble-prone experiments whose usefulness, if any, lies far into the future. "There is neither a national commitment to nor a national constituency for resource recovery from trash," National Center for Resource Recovery president Rocco Petrone told a Washington conference on the subject last month.

The nonprofit center, formed in 1970 by a coalition of industries and labor unions, estimated that the country produces 3 1/2 pounds of trash per day per person. Reprocessing 65 per cent of that would provide two per cent of current U.S. energy needs, saving about 350,000 barrels of oil and $6 million every day, according to Charlotte Rines, urban waste program manager of the Department of Energy.

"There are problems in fitting the product to the energy-consuming market, which largely uses boilers that burn pulverized coal or oil. Burner modifications may be necessary to use RDF, although some experiments have mixed it with coal successfully.

To be nationally attractive, it will have to be cheaper to turn garbage into RDF than to bury it. "All the processes we know of are still very expensive - more than $10 a ton to recover any energy at all," said Rines.

At Maryland Environmental Services' plant, operators in glass-enclosed booths watch over the garbage pits below and manage the conveyor belts with a computer control panel the size of a large candy box. Until markets are found, most of the RDF is still being compacted to take up less landfill space. Some recovered glass, which is 7 per cent of all trash, is being tested for use in globule form as home insulation cellulose insulation. Other glass can make lightweight building blocks as strong as concrete ones.

In another project, MES is building an artificial reef off Assateague Island out of three million old tires, tied together in seven-tire bundles. Maryland produces 50 tons of scrap tires every day, MES figures show, which at present have little future other than to provide a base for marine growth and, therefore, fish.

MES is also a participant in the notorious experiment to handle waste by-heating it in a closed area without oxygen to sterilize and reduce it, a process called pyrolysis. The $20 million plant in Baltimore has had an unending series of problems, to the point where McKewen said, "Just the word pyrolysis makes people nervous."

A more successful project involves mixing sewage sludge with wood chips and letting it sit for several weeks while it breaks down into compost that it useful as a soil enricher.

Markets for all of these products are there but have to be developed, McKewen said. "The alternatives to resource recovery from trash are in cinceration and landfill, which means that in the long run there is simply no choice," he said.