On March 23, 1971, the Soviet Union set off three Hiroshima-scale nuclear blasts deep underground in a remote region some 1,000 miles east of Moscow, ripping a massive crater in the earth. The goal was to demonstrate that nuclear explosions could be used to dig a canal connecting two rivers, altering their direction and bringing water to dry areas for agriculture.

The nuclear bombs, it turned out, weren’t that effective for building canals, though they did create an “atomic lake” in the crater formed by the blast. But the tests had another lasting consequence, all but forgotten until now: They set in motion the first U.S. government research on climate change — a far-reaching project that has continued into this decade.

On the surface, the reaction to the Soviet tests was somewhat muted. Western countries, including the United States, detected the explosions and lodged a protest alleging a violation of the Limited Test Ban Treaty. Moscow wouldn’t publicly acknowledge the tests for several years.

But in the national security community in Washington, the blasts sparked panic. When intelligence officials briefed Stephen Lukasik, the director of the Pentagon’s secretive Defense Advanced Research Projects Agency, he had an immediate reaction: “Holy shit. This is dangerous.”

The Soviet Union, it turns out, had for more than a decade been studying ways to use nuclear weapons to create massive canals to reroute water for irrigation, and the plan involved hundreds of nuclear detonations. “The Soviets wanted to change the direction of some rivers in Russia,” Lukasik, now 87 years old, told me recently in an interview. “They flow north where they didn’t do any good for them and they wanted to turn them around so they would flow south.”

The Pentagon didn’t particularly care which way rivers ran in the Soviet Union, but it cared about how this ambitious act of geoengineering, which would affect waters flowing into the Arctic Ocean, could potentially alter the world’s climate. Lukasik decided that DARPA needed to start a climate research program that could come up with ways to model the effects. The name of this climate program, highly classified at the time, was Nile Blue.

At first glance, DARPA might have seemed like an odd place to study climate change. The agency was created in 1958 as a response to the Soviet Union’s launch of Sputnik, to help the United States get into space. But in those years, DARPA was also deeply involved in nuclear issues. It had created an extensive monitoring system precisely to tip off the Pentagon to secret tests like the Soviet effort in 1971.

That same year, John Perry, a young Air Force officer, got an unexpected question from an official at DARPA (at the time called just ARPA; the D for “defense” was added in 1972.) “We need a program manager for this program we have. Would you like to come to Washington?” the DARPA official asked Perry.

“Washington was the not the Midwest or Vietnam, so I said, ‘Sure.’” Perry recalled answering. “I’ll discover later what the hell this thing is.”

For Perry, a meteorologist by training, it wasn’t a hard decision, even if he didn’t know exactly what the job entailed. He soon found himself at DARPA’s headquarters in northern Virginia, where he was put in charge of the mysteriously named Nile Blue. One of the first things he decided to do was get rid of the secrecy. Even if the concerns about Soviet nuclear tests needed to be kept quiet, research on climate modeling could be done in the open. Keeping the program classified, particularly during the Vietnam War, would only hurt DARPA’s ability to work with academic scientists, he argued.

The secrecy “did throw sort of a miasma over the program,” Perry recalled, noting there were rumors that DARPA was involved in weather-altering research. “In fact, I had a visit from a guy from the arms control office in the State Department who came over, armed with top-secret clearances and what-have-you, to find out what nefarious things we were doing. He was very disappointed to find out that there weren’t any.”

Once the program was declassified, the next step was finding scientists to do the necessary studies. Perry found himself in charge of $3 million in funding, a sizable sum in the early 1970s, and his mandate was about to expand.

Soon after starting the research program, he was summoned to the director’s office to meet with Lukasik and Eric Willis, who directed DARPA’s nuclear monitoring program. Willis, who had been a student of Willard Libby, the inventor of radiocarbon dating, was interested in taking a historical look at climate.

Willis “took the position that the climate research program really didn’t make any sense unless you had good information on past climates to be able to do the verification models,” Perry recalled. “He thought there should be an element of past climate research in there.”

Perry knew nothing about this topic, so he nodded and smiled before walking out of the director’s office with a new charge to spend $400,000 on paleoclimate research. “Essentially, I called up a few people and said, ‘Hi, you don’t know me, but I want to give you a lot of money,’” he said.

The heart of the Nile Blue program was computational modeling. DARPA may not have had experience with meteorology, but it did have plenty of experience with computers. Just two years earlier, the agency’s computer science office had established the first nodes of ARPANET, the network that would later become the internet. DARPA was also in charge of the Illiac IV, one of the world’s first supercomputers.

DARPA’s climate work helped justify the continuation of Illiac IV, whose costs were attracting scrutiny. “They needed to say that its capability was being developed for some customers who could pay for it,” Perry said. “Climate modeling is a very good customer for computer science.” (Critically, DARPA’s funding for modeling rescued the RAND Corporation’s work on climate simulation, which the National Science Foundation was on the verge of canceling.)

The modeling work had its critics. Perry recalled that Ruth Reck, an atmospheric scientist at General Motors, expressed early skepticism of DARPA-funded climate models. “Modeling is just like masturbation,” he recalled Reck telling some of the DARPA-funded scientists at a conference. “If you do it too much, you start thinking it’s the real thing.”

Reck, who confirmed the anecdote in a recent interview with me, said her point was that scientists were confusing their models with reality. “They had a right to feel glad that they were doing it, they were contributing a lot, but it didn’t mean it was the real thing. It just wasn’t,” she said. “That is very much like masturbation: If they do it enough, it becomes the focus of what they want.”

Yet DARPA’s work was critical to sparking those debates. The research program for the first time was drawing together modelers, paleo-climatologists, radiation experts, and meteorologists. The program created an interdisciplinary field, according to Warren Wiscombe, who credits the agency for transforming him from an applied mathematician into a climate scientist in the 1970s. “All of the sciences then that later contributed to climate science were very separate and they had brick walls between them,” he said. “They were what we call stovepiped now.”

As DARPA was building up its Nile Blue program, another government effort that would alter the course of climate research was taking place behind the scenes. In December 1972, George J. Kukla, of Columbia University, and R.K. Matthews, of Brown, wrote to President Richard Nixon expressing their concerns about “a global deterioration of climate, by order of magnitude larger than any hitherto experience by civilized mankind.”

Their concern was not global warming, but cooling, which they feared could lower food production and increase extreme weather. It was a preliminary result (and one that would later be used by critics of climate change in a simplistic fashion to argue that climate predictions were wrong). The letter caught the attention of Nixon, who ordered an interagency panel to look at the issue. The recommendation, according to William Sprigg, who helped set up the national climate program, was “that the government should have some kind of a program, a plan that would set goals and determine who should be doing what.”

A 1948 article in Mechanix Illustrated vividly captured American fears about the Soviet nuclear program. Visual: Mechanix Illustrated/Apic/Getty Images

In the end, the Soviets abandoned their grand plan to alter the course of rivers, but by the time DARPA finished its research in 1976, the foundation of climate research was firmly in place: a community of scientists dedicated to the issue, and a political atmosphere conducive to continuing the research. DARPA, whose mandate is for fixed-term research, ended its climate program, but the National Science Foundation and the National Oceanic and Atmospheric Administration picked up the work, eventually leading to the establishment of the national climate program.

Even scientists like Reck, who were critical of some of the early modeling work, said the research has showed clearly that climate change is real. “I stand with what I told John [Perry] years ago: ‘I really don’t think we know, I think we are far from understanding the climate,’” she told me. “That does not mean we should not curtail everything that we can to slow down the rate of change. I think we have to do that. I think it’s absolutely frivolous not to do that.”

While the debates go on about the accuracy of climate models, the scientific consensus is that climate change is real, and much of the credit for establishing that consensus goes to DARPA — whose role has been largely forgotten, except by the scientists funded by the program and who went on to take leading positions in climate research.

More than 40 years after the end of Nile Blue, former DARPA officials like Perry and Lukasik still get together for a monthly lunch, where they reminisce about their days at the pioneering agency. Lukasik recalls Perry telling him: “You know, Steve, the work started in DARPA and continued by me in the National Science Foundation became the foundation for all of the understanding of global warming.”

Sharon Weinberger is an executive editor at Foreign Policy magazine and a former Knight Science Journalism fellow at MIT.