Gleanings from the 151st annual meeting this week of the American Association for the Advancement of Science, the country's largest scientific society:

A NASA planetary scientist has a theory to explain why Earth's climate is so moderate while those of its two nearest planetary neighbors are so extreme. Mars has an average surface temperature 130 degrees Fahrenheit colder than Earth's; Venus' temperature is some 800 degrees hotter.

These great climatic differences, said James F. Kasting, may in part be a result of the way each planet used its primordial endowment of carbon dioxide.

Carbon dioxide is a "greenhouse gas" that lets sunlight reach a planet's surface but retards the resultant heat from radiating into space. Mars has very little in its atmosphere, while Venusian skies are thick with it and Earth has just the right amount for a moderate climate.

The mystery is how these planets, all formed at the same time from the same region of a primordial cloud of gas and dust, could end up so different.

Kasting, who developed the theory at the National Aeronautics and Space Administration's Ames Research Center in Moffett Field, Calif., said his idea began with an analysis of what happens to carbon dioxide on Earth.

When rain weathers silicate rocks, the dominant type on land, some of the released calcium combines with the air's carbon dioxide to form calcium carbonate. This washes into the sea, falls to the bottom as sediment and, when compressed, forms limestone.

Most of the Earth's carbon dioxide has thus become locked up in the huge plates that form the planet's crust. But when these plates collide, the edge of one often slides under the other. The resulting heat releases the carbon dioxide as a gas that goes back into the atmosphere, often in volcanic eruptions. Earth's fairly steady carbon dioxide cycle keeps just the right amount in the air.

Venus, being closer to the sun, received so much heat early on that its water vapor was driven to the upper atmosphere where sunlight split the molecules, freeing light hydrogen to drift into space. Gradually, Kasting speculated, Venus lost its water and therefore lacked a mechanism for removing carbon dioxide from its atmosphere.

Mars, by contrast, grew colder because, being much smaller than Earth, its interior cooled, leaving a surface without moving plates and volcanoes to liberate the carbon dioxide locked in its rocks during an early wet period when rivers flowed. Eroded river valleys are still visible.

Peregrine falcons, once endangered by DDT and other pesticides, are making a dramatic comeback all over the world, according to Brian J. Walton, a peregrine researcher at the University of California, Santa Cruz.

Walton said breeding pairs are now nesting high in Washington, Baltimore, New York and many other cities. Some use building edges and roofs as their wilderness cousins use rocky cliffs. Others have found nest sites in the girders of bridges.

The falcons began declining in the 1940s with the worldwide spread of DDT. By 1975, peregrines in North America had dropped to an estimated 5 percent of their former numbers.

With the ban of DDT and the introduction of breeding programs, the population stabilized and, in the 1980s, began increasing rapidly.

Walton said urban life has been good for peregrine expansion because the birds have little natural competition and abundant supplies of pigeons to eat.

San Francisco medical researchers have discovered a way in which the nervous system appears to communicate with the immune system, directing it to concentrate its infection-fighting responses in certain parts of the body.

It has been known that some nerve cells release a small protein molecule known as substance P, but its function has been unclear. Donald G. Payan of the University of California, San Francisco, has found that certain immune-system cells, called helper T-lymphycytes, have receptor sites on their surface specifically suited to bind with substance P.

Once binding occurs, the T-cells produce a chemical reaction that stimulates other parts of the immune system into activity in their region.

Payan said it was not clear how this interaction works in the normal immune system but that there was evidence that when it goes awry, it can aggravate conditions such as arthritis, asthma and allergic reactions. These are all conditions in which the immune system mistakes certain cells of its own body as foreign and tries to destroy them.

Payan said that if further study confirmed that naturally released substance P causes arthritis pain, it might be possible to develop a chemical that binds to substance P, blocking its action.

Girls may have aptitude for computer programming that exceeds that of boys, a University of Minnesota sociologist says.

A survey of eighth- and 11th-grade students in Minnesota found that females outscored males, 55 percent to 40 percent, in correctly answering a question requiring them to think through a problem as a computer would, said Ronald Anderson.

The quiz question asked participants to determine "the output from this procedure":

A. List the names Brown, Anderson and Crane in alphabetical order.

B. Remove the last name from the list.

C. If only one name is left, stop. Otherwise, go on to step D.

D. List the remaining names in reverse order.

E. Go back to step B.

Anderson suggested that, unlike this survey, most computer tests are biased against those who favor words over mathematical symbols.

By the way, the answer is "Brown."