UPDATE |Over 5 million Germans moved to North America during the 19th century, including President Donald Trump's grandfather, Friedrich, who moved to the U.S. at age 16. New research suggests that a variable climate in Germany may have played a role.

During the 19th century, there were glacier advances in the Alps, colder winters and summers, and extreme events like droughts and floods. An estimated 20 to 30 percent of migration from southwest Germany to North America may be attributed to that shift in climate, according to Rüdiger Glaser, lead author of the study appearing in the journal, Climate of the Past, and physical geography professor at the University of Freiburg, Germany.

"The chain of effects is clearly visible: poor climate conditions lead to low crop yields, rising cereal prices and finally emigration," Glaser said in a statement. "But it is only one piece of the puzzle."

President Donald Trump smiles during the introduction of his Secretary of Homeland Security nominee Kirstjen Nielsen in the East Room of the White House on October 12. Reuters

The study analyzed official migration statistics, population data, weather data, harvest figures and cereal price records. They focused on the region Baden-Württemberg, a southwestern state in Germany that borders France. Migrants such as Charles Pfizer—who founded one of the largest pharmaceutical companies in the world—originated from there, and Trump's grandfather also grew up nearby, according to Glaser.

"Trump, he comes from southwest Germany—the Palatinate, the neighboring region to Baden-Württemberg," Glaser toldThe Independent. Although Glaser also said that Germans like Trump's grandfather came to the U.S. for "peace and freedom," his study points to evidence that a variable climate was also a factor. Glaser told The Independent that world leaders should be aware of the history of migration, particularly in relation to climate change.

The president—who campaigned on building a 2,000-mile wall along the southern border of the United States to keep immigrants out of the country—has largely denied climate change, once even calling it a hoax that was created by the Chinese. Trump also intends to pull out of the 2015 Paris climate agreement, though he cannot officially do so until after the 2020 election. Meanwhile, Politico reported last year that Trump wants to build a seawall to protect one of his golf courses from rising sea levels, which are expected to rise significantly as a result of climate change.

Glaser's study notes that climate change is not the sole reason for massive amounts of immigration to North America during the 19th century, but rather, another factor. The study points to other major climate events that have caused waves of migration. In Indonesia, a volcano eruption in 1815 resulted in the "year without summer" in 1816, which saw wet and cold weather that led to failing crops, famine and emigration.

From 1850 to 1855, climate played a less significant role in emigration. The Crimean War from 1853 to 1856 drove up food prices since France banned food exports, which put pressure on German grain markets.

"Migration in the 19th century was a complex process influenced by multiple factors," Glaser concluded in a statement. "Lack of economic perspectives, social pressure, population development, religious and political disputes, warfare, family ties and the promotion of emigration from different sides influence people's decision to leave their home country."

"Nevertheless, we see clearly that climate was a major factor."

Correction: An earlier version of this story said President Trump's father immigrated to the U.S. from Germany. It was President Trump's grandfather, Friedrich, who immigrated, not his father.