---
title: "Projected warming will exceed the long-term thermal limits of rice cultivation"
author: 
  - name: Nicolas Gauthier
    affiliations:
      - name: University of Florida, Florida Museum of Natural History
        id: 1
    email: nicolas.gauthier@ufl.edu
    attributes:
        corresponding: true
  - name: Ornob Alam
    affiliations:
      - name: New York University, Center for Genomics and Systems Biology
        id: 2
        city: New York
        state: NY
  - name: Michael D. Purugganan
    affiliations:
    - ref: 2
    - name: New York University, Center for the Study of the Ancient World
      id: 3
      city: New York
      state: NY
  - name: "Jade d'Alpoim-Guedes"
    affiliations:
    - name: University of Washington, Department of Anthropology
      city: Seattle
      state: WA
      id: 4
editor: visual
abstract: |
  Rice is a staple food for a significant portion of the global population, particularly in Asia, where over one billion people rely on it for daily subsistence. Understanding rice’s historical thermal limits is imperative for predicting how it will respond to future shifts in global climate. Here, we integrate diverse records of contemporary rice cultivation extent, archaeological data spanning rice’s long-term history since its earliest cultivation, and temperature projections for the past, present, and future to assess how warm temperatures have influenced and may continue to influence rice’s geographical distribution, productivity, and the adaptive strategies employed by human societies to sustain this important crop. Our findings indicate a consistent pattern over the past 10,000 years: domesticated Asian rice varieties have seldom thrived in regions where the mean annual temperature exceeds 28°C or warm-season maximum temperature exceeds 33°C. By the end of this century, climate projections estimate that the land area exceeding this thermal threshold in Asia's major rice-producing nations could expand by ten to thirty times. Our findings have significant implications for global food security, as regions heavily reliant on rice cultivation may encounter unprecedented challenges in staple crop production under projected warming.
bibliography: references.bib
csl: science.csl
# csl: _extensions/nature/csl/springer-basic-author-date.csl
---

```{r}
#| label: setup
#| include: false
#knitr::opts_chunk$set(dev = 'png', echo = FALSE, results = FALSE, message = FALSE, warning = FALSE)

library(tidyverse)
library(sf)
library(stars)
library(ggridges)
library(patchwork)
# if installing the rnaturalearth libraries yields an error, uncomment and run the lines below
# remotes::install_github("ropensci/rnaturalearthhires") 
library(rnaturalearth)
library(rnaturalearthdata)
library(here)
library(units)
library(eks)
library(gt)

theme_set(theme_bw())

# define the study area
asia_bbox_sf <- st_bbox(c(xmin = 60, xmax = 150, ymin = -11, ymax = 54), crs = 4326)
world_bbox_sf <- st_bbox(c(xmin = -130, xmax = 155, ymin = -40, ymax = 60), crs = 4326)

# get country boundaries shapefile for plotting
sf_use_s2(FALSE)
countries <- ne_countries(scale = 'large') %>% 
  st_crop(asia_bbox_sf)
countries_small <- ne_countries() %>%
  st_crop(asia_bbox_sf)
coasts <- ne_coastline() %>%
  st_crop(asia_bbox_sf)
coasts_world <- ne_coastline() %>% 
  st_crop(world_bbox_sf)
countries_world <- ne_countries(scale = 'large') %>% 
  st_crop(world_bbox_sf)
sf_use_s2(TRUE)

chelsa <- readRDS(here('data/derived/chelsa_asia.rds'))

load(here('data/derived/occurrence_data.RData'))

arch_trace_dat <- readRDS(here('data/derived/arch_trace.rds')) |>
  mutate(mil = (med_age - med_age %% 1000) / 1000 + 1) |>
  filter(between(mil, -9, -2)) |> # reduces to 542 unique sites
  mutate(mil = as.factor(mil)) 

cmip6_maps <- readRDS(here('data/derived/cmip6_data.rds'))
country_stats <- readRDS('data/derived/country_stats.rds') # country level stats
```

{{< pagebreak >}}

# Introduction

Members of the grass family (*Poaceae*), which include staples like rice, maize, wheat, and barley, provide a majority of the global human caloric intake. However, these crops face a looming threat: the rate of anticipated climate change eclipses that of historical niche adaptations in grasses. By 2070, temperatures are projected to rise at a rate 5,000 times faster than what most varieties of *Poaceae* have experienced throughout their evolution [@cang2016]. Historically, *Poaceae* experienced temperature shifts ranging from 1-8°C per million years, yet future projections anticipate changes as swift as 0.02°C annually [@cang2016]. Among these vital crops, domesticated Asian rice (*Oryza sativa*) serves as a primary food source for over half the global population. More than 90% of the world's rice is grown in Asia, and one fifth of the world's population—more than 1 billion people—depend on rice cultivation for their livelihood.

*Oryza sativa* has a deep history of cultivation and domestication beginning at least 7,000 years ago. Over the course of its domestication and subsequent spread, Asian rice has made several adaptations to changes in climate and has expanded well beyond its original range of cultivation. Yet despite this expansion, rice exhibits a high degree of niche conservatism compared to its wild progenitor [@yang2022]. Although human selection—and, in recent decades, scientific breeding—can accelerate the development of new traits far more rapidly than the thousands of years wild plant species often require to adapt to new climatic conditions, these advances have not successfully expanded rice's thermal tolerance. Notably, as global temperatures rise, rice farming has shifted from warmer areas to cooler ones rather than adapting to increased heat [@sloat2020]. Apparent increases in rice's harvested area over recent decades largely reflect advances in farming technology rather than an expansion of its climatic tolerance. For example, rice cultivation in the People's Republic of China has gradually extended northward from Central China into cooler regions, a shift that, combined with intensified irrigation in the country's hottest zones, has modestly increased rice yields and masked the adverse effects of rising temperatures [@sloat2020; @wang2019].

While some areas may benefit from warming temperatures [@gao2025cost], this trend is not universal. In many regions, smallholder farmers rely on rice cultivation as their main source of income. Indeed, mismatches between rice-harvested areas and overall environmental suitability suggest that subsistence farming in low-income regions has already stretched rice cultivation to its climatic boundaries [@mahaut2022]. To put this into perspective, projections indicate that 15-40% of India's current rainfed rice cultivation zones will experience a reduction in climatic suitability by 2050 [@singh2017]. Since 1974, 88% of rice-harvested areas show significant shifts in yield due to climatic factors, with climate change reducing consumable food calories from rice by 0.4% compared to historical climate conditions [@ray2019].

However, these findings are constrained by the current distributions of rice cultivation and prevailing temperature. Few regions of the world today experience the elevated temperatures projected in many future climate-change scenarios. This makes it challenging to distinguish between inherent thermal limits for rice growth and the practical geographic constraints set by recent temperature distributions [@welch2010; @soberón2017]. Global temperatures have already exceeded known temperatures over the past 2,000 years and we are living in the warmest centuries of at least the past 100,000 years [@masson-delmotte2021]. Contemporary studies of the thermal niche of rice have provided crucial insights into specific regions and production systems, but those with a global scope have often been reliant on limited datasets that may not capture the full diversity of rice distributions. Challenges include the potential underrepresentation of temperate rice varieties in China, uneven sampling of rainfed or upland varieties, and the geographic scope of the studies, which do not always encompass broad thermal ranges [@welch2010; @singh2017; @wang2019]. Archaeological studies have been instrumental in documenting the timing and geographic trajectory of rice's domestication and spread across Asia [@fuller2009; @long2022; @crema2022; @silva2015; @weber2010]. Recent integration of archaeological rice records with spatial paleoclimate reconstructions has revealed that climate change played a major role in the early diversification and spread of rice [@dalpoimguedes2018; @gutaker2020], but the implications for rice's future adaptability have yet to be fully explored.

Here, we integrate multiple lines of evidence from the extensive history of rice cultivation to characterize the thermal range of rice and gauge its potential adaptability to impending climate changes. By integrating diverse records of the current extent of rice cultivation with archaeological data on the distribution of rice since its earliest cultivation and domestication, we aim to establish *O. sativa's* thermal limits—the temperature conditions under which rice has been consistently cultivated throughout its domestication history. We estimate long-term thermal limits associated with rice cultivation by comparing contemporary estimates of rice extent with well-dated archaeological rice occurrences, and complement this with genetic analyses of adaptation potential in rice subspecies. We focus specifically on Asian rice (*O. sativa*) rather than African rice (*O. glaberrima*), as Asian rice comprises the vast majority of global production and consumption and has the extensive archaeological record necessary for long-term analysis. We use these results to assess the impact of projected climate changes by the end of this century. Together, our analyses confirm that imminent changes in climate conditions may force large regions of today's primary rice producers to confront mean annual, seasonal, and monthly peak temperatures unprecedented in the history of rice cultivation and domestication.

# Results

We assess thermal limits on rice growth by comparing contemporary rice extents estimated from satellite imagery, agricultural censuses, and herbarium collections to indicators of annual and seasonal temperature (@fig-overview). Our analysis combines present-day rice extent data from diverse sources: satellite-based assessments of paddy rice extent in Asia [@nelson2015], hybrid satellite/census evaluations of global paddy rice cropping areas around the year 2000 [@monfreda2008], and global point occurrences derived from herbarium records and germplasm accessions [@civán2018, @gutaker2020, @yang2022, @ramirez-villegas2022]. These datasets span a range of spatial scales, time periods, production systems (e.g. irrigated vs. rainfed), and data collection methods with complementary biases, allowing us to test the robustness of these thermal limits across methodologically independent data sources. We supplement this empirical work with reviews of rice's response to warm temperatures from prior field and lab-based agronomic studies.

```{r}
#| label: fig-overview
#| fig-asp: 0.7
#| fig-width: 12
#| fig-cap: Observed rice extent data and thermal predictors. A) Map of lowland rice extent in Asia from the International Rice Research Institute based on estimates from MODIS satellite imagery [@nelson2015] (black) overlain by archaeological sites with evidence for rice cultivation (red). B) Point based rice occurrences from global herbarium records and genetic accessions. C) Satellite-based estimates of rice cropped area in the year 2000 from [@monfreda2008]. D) Maps of mean annual temperature, mean maximum daily temperature of the warmest month, and mean maximum daily temperature of the warmest quarter from CHELSA V2.1 averages for 1981-2010 [@karger2017; @Karger2018; @brun2022].

a <- ggplot(irri_occ) +
  geom_sf(data = countries, color = NA) +
  geom_sf(size = 0.01, alpha = 0.1) +
  geom_sf(data = arch_trace_dat |> 
  group_by(geometry) |> 
  summarize(), color = 'red', size = .5) +
  coord_sf(expand = FALSE)

b <- ggplot(occ_dat) +
  geom_sf(data = countries_world, color = NA) +
  geom_sf(size = 0.05, alpha = 0.5) +
  coord_sf(expand = FALSE)

c <- ggplot(monfreda_occ) +
  geom_sf(data = countries_world, color = NA) +
  geom_sf(size = 0.0001, alpha = 0.1) +
  coord_sf(expand = FALSE)

d <- ggplot() +
  geom_stars(data = chelsa[countries_small]) +
  facet_wrap(~attributes, nrow = 1) +
  scale_fill_viridis_c(option = 'magma', name = '°C', na.value = NA, limits = c(0, NA), oob = scales::squish, labels = function(x) ifelse(x == 0, "<0", x)) +
  geom_sf(data = coasts) +
  labs(x = '', y = '') +
  coord_sf(expand = FALSE)

(a + (b / c)) / d + plot_annotation(tag_levels = 'A', tag_suffix = ')') + plot_layout(heights = c(1.51))
```

We define the "thermal limits" of rice cultivation as the 95% central range of three temperature indicators at all sampled rice occurrence locations in a given dataset—the temperature thresholds beyond which the likelihood of rice cultivation significantly deceases due to a combination of physiological, cultural, and economic factors. This empirical approach emphasizes the long-term feasibility of crop cultivation rather than short-term variations in yield or harvested area. By focusing on these broader climatic measures, we can integrate a wider array of data sources from the past and present to reveal the upper temperature thresholds of rice cultivation over time.

Our approach offers a parsimonious tool for estimating future crop suitability [@hatfield2011; @Gourdji2012] that complements process-based crop models. While such models can extrapolate yield responses to climate change, they are sensitive to assumptions about meteorological inputs, agronomic and physiological parameters, and cultural practices like planting dates and varietal preferences over the long term [@zhang2008; @vanoort2011; @li2015; @koehler2013; @heinicke2022]. Translating these localized projections to global scales introduces additional challenges, as does calibrating and validating their outputs using limited and inconsistent yield data from the recent or more distant past. Ultimately, a better understanding of baseline thermal limits and their uncertainty through time and space can contribute to the development of future process-based models, many of which incorporate temperature thresholds for pivotal crop development phases.

We focus primarily on temperature rather than precipitation or soil moisture, as water availability can be more readily controlled through human interventions such as irrigation and paddy field construction. These adaptations have allowed rice cultivation to expand beyond its original aquatic and semi-aquatic environments. In contrast, adapting to new thermal conditions is more challenging and often requires changes in planting dates or crop varieties, which have their own limitations, particularly in higher latitudes where daylight variations restrict growing seasons.

```{r}
#| label: quantiles-modern

fig2_dat <- irri_occ %>%
  st_drop_geometry() %>%
  select(bio1, bio5, bio10) %>%
  mutate(across(everything(), ~set_units(.x, 'degree_C')))

quantiles <- c(0.01, 0.025, 0.05, 0.1, 0.9, 0.95, 0.975, 0.99)

quants_mod <- fig2_dat %>%
  reframe(across(everything(), 
                   ~quantile(.x, quantiles, type = 8))) %>%
  round(1) %>%
  mutate(quantile = quantiles, .before = 1)

quant_975 <- filter(quants_mod, quantile == 0.975)
bio1_limit <- quant_975$bio1
bio5_limit <- quant_975$bio5
bio10_limit <- quant_975$bio10
```

## Contemporary rice extents are constrained by high temperatures

Contemporary rice extents fall within a relatively restricted thermal range. We use mean annual temperature (MAT), mean maximum daily temperature of the warmest quarter (TWARM), and mean maximum daily temperature of the warmest month (TMAX) to estimate upper boundary temperatures for contemporary rice occurrences. The vast majority of contemporary rice is grown in regions with MAT below `r bio1_limit`℃, TWARM of `r bio10_limit`℃, and TMAX of `r bio5_limit`℃ (@fig-kde-modern). Although we primarily report results from the satellite-based estimates of lowland rice extent over Asia produced by the International Rice Research Institute [@nelson2015] due to its favorable balance of spatial resolution and extent, results from other rice extent datasets with variable spatial extent, resolution, and time span are consistent with these findings (Supplementary @tbl-quantiles). There is much more variability across data sources in lower temperature thresholds—reflecting the greater adaptability of rice to colder temperatures through breeding, management, and growing season—than upper temperature thresholds.

```{r}
#| label: fig-kde-modern
#| fig-height: 7
#| fig-width: 6
#| fig-cap: "Kernel density estimates of temperature distributions over rice growing landscapes in Asia. A) One-dimensional kernel density estimates of mean annual temperature and mean maximum daily temperature of the warmest month in grid cells with lowland rice crops, based on data from the International Rice Research Institute (fig. 1). Vertical black lines indicate the 95% central range of the temperature values, and transparent black points indicate the raw occurrence data used in the calculation of the kernel density estimates. B) Two dimensional kernel density estimates for the same variables as in A."

a <- fig2_dat %>%
  pivot_longer(bio1:bio10, names_to = 'var') %>%
  mutate(name = factor(case_when(var == 'bio1' ~ 'Mean annual',
                                 var == 'bio5' ~  'Max month',
                                 var == 'bio10' ~  'Max quarter'),
                        levels = c('Mean annual', 
                                   'Max quarter',
                                   'Max month'))) %>%
  ggplot(aes(value, name)) +
  scale_y_discrete(limits = rev) +
  geom_density_ridges(alpha = 0.75, 
                      scale = 1, 
                      jittered_points = TRUE, 
                      position = 'raincloud', 
                      point_alpha = 0.02, 
                      point_size = 0.5, 
                      quantile_lines = TRUE, 
                      vline_size = .8,
                      quantiles = c(0.025, 0.975))+
  labs(x = 'Temperature', y = '') +
  theme(axis.text.y = element_text(vjust = 0)) +
  coord_cartesian(clip = 'off')

b <- fig2_dat %>%
  ggplot(aes(bio1, bio5)) +
  stat_density_2d(geom = 'polygon', aes(alpha = after_stat(level))) +
  labs(x = 'Mean annual temperature', y = 'Max temp. of warmest month') +
  scale_alpha_continuous(guide = 'none') +
  coord_fixed() +
  scale_x_units(limits = set_units(c(2, 30), degree_C))

a / b + plot_layout(heights = c(1.5, 2)) + plot_annotation(tag_levels = 'A', tag_suffix = ')')
```

These empirical thresholds are consistent with physiological parameters inferred from field-scale agronomic studies and expert knowledge, which estimate that the optimum temperature range for reproductive yield in rice is 23℃-26℃, biomass and pollen viability declines when maximum temperatures exceed 33℃, and crop viability reaches zero at approximately 40℃ when photosynthesis begins to shut down in C3 plants like rice [@hatfield2011, @ren2023]. In other words, rice today is rarely grown in regions where the mean annual temperature exceeds its optimum temperature for reproduction, warm-season maximum temperatures exceed its optimum for pollen viability, and summer heat extremes will reliably stop photosynthesis.

These broad climate indices, while not capturing all nuances of local growing conditions, serve as useful heuristics for identifying regions prone to thermal stress. This approach provides a complementary perspective to typical empirical crop models, which often use fixed monthly or seasonal predictors tied to the timing of the growing season. These predictors depend on planting dates, which are themselves cultural adaptations to past and present climate. As planting times and growing seasons shift with climate change, statistical analyses based solely on "growing season" temperatures may become less reliable for long-term historical comparison. Our approach provides a stable benchmark for integrating archaeological and contemporary data across different time periods and cultivation practices, helping identify where adaptations in growing seasons, crop types, genetics, or irrigation practices may become necessary.

## High-temperature constraints are consistent across 9,000 years of rice cultivation

Although upper temperature limits on rice growth estimated from contemporary crop occurrences are consistent with previous agronomic studies, it is not yet clear how well these thresholds will predict crop responses to future temperature changes. For example, there are few places today that experience mean annual temperatures beyond 28℃ (Supplementary Figure [-@fig-current-limits]), and contemporary correlations between mean annual temperatures and monthly or seasonal extremes may not hold in a changing climate. The archaeological record of rice cultivation in Asia, including direct dates of botanical remains and contextual dating of concurrent archaeological sites, provides a unique opportunity to assess the robustness of these temperature limits over the long term. During the mid Holocene ca 8000-4000 calibrated years BP (cal. BP), warm-season temperatures were generally warmer than present, reflecting increased summertime insolation in the Northern Hemisphere due to shifts in Earth's orbit and consequent feedbacks in the global climate system [@berger1991]. Although not an exact analogue for projected future warming caused by greenhouse gas emissions, this period provides a baseline for rice's response to shifting climates during the critical period of its domestication and dispersal.

*O. sativa* has been domesticated a number of times in prehistory. Archaeological data shows that wild forms of rice were distributed as far north as northern China in the early Holocene (ca 9000 cal. BP) and gathered by foraging populations [@fuller2011]. Tropical varieties of *O. sativa japonica* were first cultivated in the middle and lower Yangtze and Yellow River valleys in China by at least 7000 cal. BP [@huang2012; @choi2017; @choi2018] (@fig-arch-kde A), where they began to exhibit traits of domestication (e.g. the development of a non-shattering rachis) by roughly 5000 cal. BP [@fuller2009; @Silva2015]. *Oryza sativa indica* rices on the other hand were likely domesticated in South Asia sometime around 4000 cal. BP [@fuller2016; @bates2022], after which it spread throughout southeast Asia and China (@fig-arch-kde A). There is substantially less archaeobotanical data, however, that speaks to the cultivation and subsequent domestication of this subspecies [@bates2022]. This period of initial cultivation and domestication corresponds to the warmer mid-Holocene thermal maximum.

Between roughly 5000-4000 BP, rice spread both north- and eastward in China [@lanehart2011; @dalpoimguedes2015] and westward onto the Chengdu Plain [@dalpoimguedes2013] and highlands of Southwest China [@dalpoimguedes2014; @dalmartello2018] (@fig-arch-kde A). Genetic and paleoclimate modeling have suggested that regional cooling around 4200 BP played an important role in this spread resulting in strong pressure for tropical *O. japonica* to develop temperate adaptations [@gutaker2020]. Estimated divergence time for tropical and temperate *O. japonica* is indeed estimated at around 4100 BP [@gutaker2020]. Following the development of temperate *O. japonica* varieties, rice spread to both Korea [@crawford2003; @ahn2010] and Japan [@crema2022] (@fig-arch-kde A). At the same time, it appears that the area that tropical varieties of *O. japonica* were able to occupy shifted southwards to southern China [@yang2017; @deng2022] and southeast Asia [@castillo2018; @higham2015; @dalpoimguedes2020] (@fig-arch-kde A), largely representing the dispersal of existing tropical varieties rather than novel adaptations to new thermal extremes. Indeed between 4000-3000 BP, rice farming spread into Thailand [@dalpoimguedes2020], Laos, Bhutan, and then via maritime routes to Taiwan, the Philippines, Malaysia, and Indonesia [@gutaker2020] (@fig-arch-kde A). A clear split in the distribution of rice with regards to temperature is evident following 4000 BP and we see a clear split into two populations: temperate varieties which occupy a mean annual temperature niche between roughly 8-18℃ and tropical varieties which occupy a niche between 22-27℃ (@fig-arch-kde B).

```{r}
#| label: fig-arch-kde
#| fig-width: 9
#| fig-height: 8
#| cache: true
#| fig-cap: Archaeological remains of rice and corresponding temperature distributions throughout the Holocene. A.) Archaeological records of rice distribution over time. See Materials and Methods for archaeological data sources. Time units are thousands of years before present (1950 CE). B.) Kernel density estimates of the thermal distribution by millennium, with raw data points indicated in black and contemporary rice thermal limits in red. Rice occurrence data were derived from sources listed in the Materials and Methods. Temperature data are derived from CHELSA-TraCE21k V1.0 (Karger et al. 2023).

arch_map <- arch_trace_dat %>%
  ggplot() +
  geom_sf(data = countries, color = 'white') +
  geom_sf(size = 1, alpha = 0.75) + 
  facet_wrap(~mil, ncol = 4) +
  coord_sf(expand = FALSE)

arch_dens_mat <- arch_trace_dat %>%
  ggplot(aes(MAT, mil)) +
  scale_y_discrete(limits = rev) +
  geom_density_ridges(aes(fill = mil), 
                      panel_scaling = TRUE, 
                      scale = 2, 
                      alpha = 0.5, 
                      jittered_points = TRUE, 
                      point_alpha = 0.25, 
                      point_size = 0.5) +
  labs(y = 'Millennium BP', x = 'Mean annual temperature') +
  geom_vline(xintercept = as.numeric(bio1_limit), linetype = 2, color = 'red') +
  scale_fill_brewer(palette = 'Spectral', guide = 'none')

arch_dens_tmax <- arch_trace_dat %>%
  ggplot(aes(tmax, mil)) +
  scale_y_discrete(limits = rev) +
  geom_density_ridges(aes(fill = mil), 
                      panel_scaling = TRUE, 
                      scale = 2, 
                      alpha = 0.5, 
                      jittered_points = TRUE, 
                      point_alpha = 0.25, 
                      point_size = 0.5) +
  labs(y = 'Millennium BP', x = 'Max temp. of the warmest month') +
  geom_vline(xintercept = as.numeric(bio5_limit), linetype = 2, color = 'red') +
  scale_fill_brewer(palette = 'Spectral', guide = 'none')

arch_dens_twarm <- arch_trace_dat %>%
  ggplot(aes(twarm, mil)) +
  scale_y_discrete(limits = rev) +
  geom_density_ridges(aes(fill = mil), 
                      panel_scaling = TRUE, 
                      scale = 2, 
                      alpha = 0.5, 
                      jittered_points = TRUE, 
                      point_alpha = 0.25, 
                      point_size = 0.5) +
  labs(y = 'Millennium BP', x = 'Max temp. of the warmest quarter') +
  geom_vline(xintercept = as.numeric(bio10_limit), linetype = 2, color = 'red') +
  scale_fill_brewer(palette = 'Spectral', guide = 'none')

arch_map / 
  (arch_dens_mat + arch_dens_tmax + arch_dens_twarm + plot_layout(guides = 'collect', axes = 'collect')) +
  plot_annotation(tag_levels = 'A', tag_suffix = ')') + 
  plot_layout(heights = c(2, 1))
```

These repeated instances of rice's diversification and shifting ranges throughout its history primarily reflect genetic and cultural adaptations to cooler temperatures and shorter growing seasons. In contrast, movements into warmer regions generally involved range shifts by varieties already suited to such conditions rather than novel adaptations. Across these shifts, rice's upper temperature limits have remained consistent. Out of 803 archaeological sites with rice remains, none have experienced MAT of greater than `r bio1_limit`℃ during the Holocene (@fig-arch-kde B), in spite of warmer summer temperatures overall. Only a handful of sites experienced a TMAX of greater than `r bio5_limit`℃ (@fig-arch-kde C), primarily in arid regions of northern India and Pakistan where archaeological dating is less certain and long-distance trade rather than local cultivation is more plausible. Regardless, the archaeological record of rice cultivation is consistent with the thermal limits estimated from contemporary data, and these results are robust to uncertainty in the dating of these archaeological remains and spatial biases in archaeological site preservation and recovery [Supplementary Figure -@fig-bootstrap], as well as across different climate reconstructions with varying degrees of mid-Holocene warmth (Supplementary Figures [-@fig-recon-timeseries] - [-@fig-kde-lgmr]).

## Currently cultivated rice areas are projected to exceed these thermal limits over the next century

Although rice has spread to warmer environments since its domestication, the magnitude of this change over the past 9,000 years is small relative to anticipated changes by the end of this century. Multiple climate-model projections and future socioeconomic and emissions scenarios show large shifts in annual and warm-season temperatures in regions where rice is currently cultivated intensively, particularly in South, Southeast and Island Southeast Asia (@fig-future-densities). Mean annual temperature will exceed `r round(bio1_limit)`℃ for a substantial area of current occurrences in the years 2070-2100. Large parts of South, Southeast, and Island SE Asia will experience temperature conditions for which there is no analogue in the history of the cultivation and domestication of rice over at least the past 9,000 years (@fig-future-maps, Supplementary Figure [-@fig-country-summaries], Supplementary Tables 2-4). Although the extent of these projected shifts vary among climate models and emissions scenarios, the overall direction of this change is consistent (Supplementary Figures 6-8).

```{r}
#| label: fig-future-densities
#| fig-cap: "Predicted changes in biologically relevant temperature indicators over currently cultivated rice areas in Asia, relative to contemporary thermal thresholds (red dashed line). Shared socioeconomic pathways (SSPs) are scenarios of projected socioeconomic global changes used to derive greenhouse gas emission scenarios. SSP1 is a best case scenario where global cooperation and social and technological innovation are able to reduce greenhouse gas emissions. SSP3 is a middle-range scenario characterized by high population growth and global competition that hinders social and technological innovation. SSP5 is a worst-case scenario characterized by rapid economic growth and carbon emissions. All temperature estimates are derived from CMIP6 climate model ensemble mean estimates for the years 2071-2100, selected based on the ISIMIP3b protocol and downscaled by the CHELSA-V2.1 algorithm."

fig5_quantile_data <- quants_mod %>%
               filter(quantile == 0.975) %>%
               pivot_longer(-quantile,
                            names_to = 'variable',
                            values_to = 'temperature') %>%
   mutate(variable = factor(
           case_when(variable == 'bio1' ~ 'Mean annual temperature',
                     variable == 'bio5' ~  'Max temperature of the warmest month',
                     variable == 'bio10' ~ 'Max temperature of warmest quarter'),
           levels = c('Mean annual temperature', 
                      'Max temperature of the warmest month', 
                      'Max temperature of warmest quarter')))

readRDS(here('data/derived/fig_4_data.rds')) %>%
  bind_rows(pivot_longer(fig2_dat, everything(), 
                         names_to = 'variable', values_to = 'temperature') %>%
              mutate(ssp = 'present')) %>%
  mutate(ssp = factor(ssp, 
                      levels = c('SSP5-8.5', 'SSP3-7.0', 'SSP1-2.6', 'present')),
         variable = factor(
           case_when(variable == 'bio1' ~ 'Mean annual temperature',
                     variable == 'bio10' ~ 'Max temperature of warmest quarter',
                     variable == 'bio5' ~  'Max temperature of the warmest month'),
           levels = c('Mean annual temperature', 
                      'Max temperature of warmest quarter',
                      'Max temperature of the warmest month'))) %>%
  ggplot(aes(temperature)) +
  geom_density(aes(fill = ssp), alpha = 0.5) +
  scale_fill_brewer(palette = 'Spectral', direction = 1, name = '') +
  facet_wrap(~variable, ncol = 1, scales = 'free_y') +
  geom_vline(data = fig5_quantile_data, 
             aes(xintercept = temperature), linetype = 2, color = 'red', linewidth = 1.2) +
  labs(x = 'Temperature')
```

```{r}
#| label: fig-future-maps
#| fig-cap: "Land areas projected to exceed each temperature threshold by 2071-2100 from CMIP6 simulations, based on the ISIMIP3b protocol and downscaled by CHELSA-V2.1. Color intensity corresponds to the count of climate model ensemble members surpassing the given threshold at each grid cell."
#| fig-width: 11.5
#| fig-height: 8
#| cache: true

fig5_map_data <- cmip6_maps |>
  split('variable') %>%
  mutate(
    bio1 = bio1 > units::drop_units(bio1_limit),
    bio10 = bio10 > units::drop_units(bio10_limit),
    bio5 = bio5 > units::drop_units(bio5_limit)
  ) %>%
  rename(`Mean annual temperature` = bio1,
         `Max temperature of warmest quarter` = bio10,
         `Max temperature of warmest month` = bio5) %>%
  merge(name = 'variable') |>
  st_apply(c('x', 'y', 'ssp', 'variable'), sum) %>%
  mutate(sum = factor(sum)) 

ggplot() +
  geom_stars(data = fig5_map_data) +
  facet_grid(ssp~variable) +
  scale_fill_brewer(palette = 'OrRd', direction = 1, 
                    name = 'Models', 
                    na.value = NA, na.translate = FALSE) +
  geom_sf(data = coasts) +
  labs(x = '', y = '') +
  coord_sf(expand = FALSE)
```

While our spatial analyses reveal clear thermal boundaries in rice distributions, understanding the potential genetic capacity for adaptation provides added context to projected climate shifts. A genetic offset analysis assessing the potential maladaptation of *O. sativa* subspecies to future climate scenarios, correlating contemporary genetic variation with annual and seasonal temperature, indicates both subspecies are at a significantly higher risk of maladaptation under projected temperature regimes of the coming century (@fig-offsets). Genetic offset analysis estimates how climatically mismatched rice populations may become under future warming by calculating the multidimensional distance between current allele frequencies and those predicted to be adaptive under projected climate conditions. The analysis produces unitless distance values where larger numbers indicate populations whose current genetic makeup is more divergent from what would be optimal for future climates, suggesting higher vulnerability to climate-driven fitness declines. These distance metrics synthesize information across multiple climate-responsive genetic variants to forecast which populations face the greatest adaptive challenges under temperature increases. When projecting to future climates across Asia, optimal growing locations for rice landraces (traditional crop varieties maintained by farmers and adapted to local conditions) of both subspecies show a greater skew away from the equator in the likeliest emissions scenarios (Supplemental Figure [-@fig-displacement]). For both *japonica* and *indica*, the degree of maladaptation increases with worsening emissions scenarios, but is generally greater than at any point experienced throughout the Holocene.

```{r}
#| label: fig-offsets
#| fig-width: 10
#| fig-height: 5
#| cache: true
#| fig-cap: Estimated genetic offsets of sampled rice landraces for past and future scenarios relative to current baseline. Each point represents a distinct population sampled for genetic analysis. Higher genetic offsets indicate a greater degree of maladaptation to the particular temperature regime. The "past" scenario reflects the highest modeled temperature at each location over the past 12,000 years. The future scenarios are averaged across all climate models in the ensemble.

offset_2.6 <- readRDS("data/derived/genetics_plotting/offset_2.6_PC1_K8.rds")
offset_7.0 <- readRDS("data/derived/genetics_plotting/offset_7.0_PC1_K8.rds")
offset_8.5 <- readRDS("data/derived/genetics_plotting/offset_8.5_PC1_K8.rds")
offset_past <- readRDS("data/derived/genetics_plotting/offset_past_PC1_K8.rds")
ind_offset_2.6 <- readRDS("data/derived/genetics_plotting/ind_offset_2.6.rds")
ind_offset_7.0 <- readRDS("data/derived/genetics_plotting/ind_offset_7.0.rds")
ind_offset_8.5 <- readRDS("data/derived/genetics_plotting/ind_offset_8.5.rds")
ind_offset_past <- readRDS("data/derived/genetics_plotting/ind_offset_past.rds")

inds_geotagged <- readRDS("data/derived/genetics_plotting/indica_geotagged.rds")
japs_geotagged <- readRDS("data/derived/genetics_plotting/japonica_geotagged.rds")


# this is the order of the japonica accessions in the genotype matrix
japs <- read.table("data/derived/genetics_plotting/japs_order.txt")
inds <- read.table("data/derived/genetics_plotting/inds_order.txt")

indica_dat <- tibble(inds$V1,
                  ind_offset_2.6$offset,ind_offset_2.6$distance,
                  ind_offset_7.0$offset,ind_offset_7.0$distance,
                  ind_offset_8.5$offset,ind_offset_8.5$distance,
                  ind_offset_past$offset,ind_offset_past$distance) %>%
  setNames(c("ID","SSP1-2.6","rona_2.6",
                   "SSP3-7.0","rona_7.0",
                   "SSP5-8.5","rona_8.5",
                   "Holocene", "rona_past"
                   )) %>%
  left_join(inds_geotagged, by = 'ID') %>%
  select(-starts_with('rona')) %>%
  pivot_longer(starts_with('SSP') | starts_with('Hol')) %>%
  arrange(value) %>%
  rename(scenario = name)

japonica_dat <- tibble(japs$V1,
                  offset_2.6$offset,offset_2.6$distance,
                  offset_7.0$offset,offset_7.0$distance,
                  offset_8.5$offset,offset_8.5$distance,
                  offset_past$offset,offset_past$distance) %>%
  setNames(c("ID","SSP1-2.6","rona_2.6",
                   "SSP3-7.0","rona_7.0",
                   "SSP5-8.5","rona_8.5",
                   "Holocene", "rona_past"
                   )) %>%
  left_join(japs_geotagged, by = 'ID') %>%
  select(-starts_with('rona')) %>%
  pivot_longer(starts_with('SSP') | starts_with('Hol')) %>%
  arrange(value) %>%
  rename(scenario = name)

offset_dat <- list(Indica = indica_dat,
     Japonica = japonica_dat) %>%
  bind_rows(.id = 'var')

ggplot(offset_dat) +
  geom_sf(data = countries_small, color = 'white') +
  geom_point(aes(LON, LAT, color = value)) +
  scale_color_viridis_c(option = 'magma', name = 'Offset') +
  facet_grid(var~scenario) + 
  labs(x = '', y = '') +
  coord_sf(expand = FALSE)
```

# Discussion

There is a clear upper limit of mean annual temperature over `r round(bio1_limit)`℃ and warm-season maximum temperature over `r round(bio10_limit)`℃ for rice that has rarely been crossed since its domestication. Forward looking climate projections show that areas that currently house some of the highest densities of rice cultivation on Earth will surpass this limit by the end of this century (@fig-future-maps). Today, 675 million people live in Southeast Asia and 1.9 billion people live in South Asia. By the end of this century, it is estimated that at least this number of people will live in the region that will surpass these thresholds. Today, mean annual temperatures greater than `r round(bio1_limit)`℃ are distributed across only a very small area of the planet which includes only a small portion of the gulf desert and the Sahara [@Xu2020]. Beyond the impact of this heat on rice cultivation, this study raises serious concerns about the viability of other temperature-sensitive crops in regions which will be impacted. The predictions for these areas of the world are out of the historic sample of distribution for rice and have no analogue in the present climate.

While some regions, including parts of northern China and southern Russia, may become climatically suitable for rice cultivation and could even see yield gains as temperatures approach current optima [e.g. @wang2020emergent; @minoli2022global; @gao2025cost], such potential benefits will be highly localized. Even if aggregate yields were to stabilize or increase in some growing regions, they would not offset the immediate livelihood and food security risks faced in regions projected to exceed current thermal limits. Shifting rice production north to regions currently too cold to grow rice will be insufficient to buffer these projected impacts. Beyond the potential for unanticipated social and environmental impacts [@hannah2020], this response would do little for the billions of people who live in these hotter regions whose lives and livelihoods are directly threatened. This response would also ignore that rice cultivation requires extensive niche construction through the construction of paddies and that abiotic factors such as sufficient water for irrigation and soils which can accommodate paddy rice. Indeed, many areas where rice is currently cultivated are already at the limit of these secondary agronomic adaptations [@mahaut2022]. Ethnographic work has shown that in Southeast Asia and China rice paddy soils have been formed over thousands of years of continuous farming which has increased their fertility [@netting1993]. Such long-term processes of niche construction cannot be easily replaced.

Although we do not directly assess yields, regions projected to warm beyond rice's historical thermal limits are likely to experience sustained productivity declines without further adaptation, while some cooler areas could benefit as temperatures approach present-day optima. Both outcomes underscore the importance of adaptation strategies to sustain production under shifting climatic conditions. Shifts in planting dates to winter may provide solutions in some regions, but higher temperatures are still a concern as rice is also sensitive to warmer nighttime temperatures in the early growing period [@peng2004]. While breeding for traits that improve resistance to heat stress, such as early flowering [@ren2023], offers some promise, large-scale socio-cultural adaptations to new crop varieties—and, in some cases, shifts in dietary preferences or staple composition [@willett2019food]—imply significant downstream impacts on regional cultures and economies that can be difficult to anticipate and mitigate ahead of time. Additionally, tropical varieties of *O. japonica* will likely need to shift northwards to higher latitudes, yet these varieties are highly sensitive to day length, and the development of non-photosensitive temperate *O. japonica* may have taken thousands of years. More recent efforts, however, such as the Green Revolution in Asia, achieved rapid advances—including the development of non-photosensitive varieties that enabled the expansion of rice cultivation into new latitudes [@eliazer2019impact]. A major breeding objective for the coming decades will thus not only be to develop non-photosensitive varieties of tropical rice but also matching cultivation strategies [e.g. @wang2022] and associated food system strategies and cultural norms.

The stored germplasm of landraces will thus serve as important genetic resources to breed climate-adaptive loci into high-yielding commercial rice varieties [@nomura2021; @vasconcelos2013; @mcnally2023]. Compared to modern cultivars, landraces contain higher genetic diversity [@hour2020; @thomson2007] and adaptations to a wider range of climates [@vasconcelos2013]. This genetic diversity can also be harnessed using traditional varietal mixtures and diversified planting systems [@mcalvay2022], where growing complementary crop varieties with different heat tolerances together can buffer against temperature extremes. Maladaptation of rice landraces under future climates may thus be amplified in modern cultivars and cropping systems [@keneni2012]. Although there is uncertainty in genomic offset estimates due to model averaging across climate scenarios and statistical uncertainty in genotype-environment associations, they remain powerful predictors of maladaptation in projected climates [@gain2023]. A warming climate also threatens wild relatives of rice and the genetic resources they contain, which are currently largely limited to South and Southeast Asia and cannot disperse as quickly without human intervention [@cang2016].

Our focus here on annual and seasonal temperature indicators allows for the integration of a broader array of data and provides a more flexible analysis that is less sensitive to uncertainty in cultivar type, growing season, and local management practices. However, future work could explore this variability further by developing new thermal indicators more sensitive to the unique requirements of various cultivars, growing seasons, and agro-ecological contexts. Temperature is not the only climate variable that influences rice growth. Others like soil moisture and solar radiation are also critical to rice growth in ways that, likewise, depend on cultivar type, growing season, and management practices. Extending this analysis to the global and regional climatic drivers of local climate response of these multiple variables, such as the influence of sea surface temperature variability and atmosphere-ocean teleconnections, could provide further opportunities to incorporate long-term climate reconstructions and projections of climate impacts on rice viability. A more precise estimation of the long-range correlations among key climate indicators in space and time, based on long-term insights from the archaeological and paleoclimatological record, would be particularly useful for developing holistic recommendations for future agronomic and genetic adaptations.

Our interdisciplinary approach highlights a pressing reality: the vast historical perspective of rice cultivation combined with past and present climate data provide a sobering outlook for food security during future climatic shifts. Staple food resources entrenched in centuries or millennia of cultural and socio-economic development face unprecedented challenges in the coming decades. The implications of these challenges extend beyond agriculture and resonate through economic systems, trade and migration flows, and deep-rooted cultural practices. The potential displacement of rice cultivation zones suggests not merely a change in global food patterns but a profound disruption of human societies rooted in these agronomic traditions. Before us lies an urgent necessity for international research, collaboration, and adaptive policy-making to strengthen the resilience of this crop that sustains billions.

# Materials and Methods

## Climate Data

We used high-resolution gridded climate data from version 2.1 of the CHELSA product [@karger2017, @Karger2018, @brun2022, @brun]. CHELSA incorporates bias-corrected outputs from the ERA5 reanalysis [@hersbach2020] with high-resolution terrain data using mechanistic relationships between local climate and terrain. Compared to other global gridded climate products, CHELSA offers superior performance in mountainous regions, and its reliance on high-quality reanalysis data instead of raw weather station data ensures greater accuracy and internal consistency among climate variables.

For present-day observed climate, we used the CHELSA V2.1 product spanning the period 1981-2010 at a 1km resolution. We further aggregated the native 1km data to 5km and 10km grids to assess the sensitivity of our results to the scale of the analysis, given the variable spatial support of the contemporary rice extent data. In all cases we used standard temperature indicators used in ecological niche modeling studies [@brun], derived from monthly climatologies of minimum and maximum temperature, which collectively represent annual means, monthly extremes, and seasonality. Future climate model ensembles were derived from phase six of the Coupled Model Intercomparison Project (CMIP6) [@eyring2016], using the subset of bias-corrected models and scenarios used in phase 3b of the Inter-Sectoral Impact Model Intercomparison Project (ISIMIP) [@lange2019], bilinearly interpolated to the CHELSA V2.1 basemap using the delta change approach [@brun, @brun2022].

Past climate data were primarily derived from the CHELSA-TraCE21k product, a downscaled version of TraCE-21k simulation of the CCSM3 climate model spanning the last 21,000 years, at 100-year intervals [@karger2023, @He2011]. This product uses the older CHELSA V1.2 algorithm, along with a trend-preserving bias correction and topographic correction for shifting ice sheets across the deglacial period. While TraCE-21k has known limitations [@Marcott2013; @Liu2014b; @he2022; @zhang2022], particularly in representing mid-Holocene warmth, it was chosen for its unique combination of high spatial resolution and seasonal temporal resolution necessary for assessing rice cultivation conditions. To validate these findings, we compared our results with other low-resolution mean annual temperature reconstructions that show varying levels of mid-Holocene warmth [@osman2021; @erb2022a]. Despite differences in overall temperature trends, the key patterns in rice cultivation temperature distributions remained consistent between reconstructions (fig. S3).

## Contemporary Rice Distribution Data

We collected rice occurrence data from a variety of sources combining information from satellite imagery, administrative statistics, and herbarium collections to assess the sensitivity of our results to various modes of data collection, sampling, spatiotemporal scale, and other potential sources of bias. These three distinct data types sample different aspects of rice distribution with complementary biases. Satellite estimates provide continuous spatial coverage but can misclassify certain land cover types; census data offer detailed regional production information but suffer from administrative reporting issues and boundary effects; herbarium records provide precise, ground-truthed identifications across diverse production systems but show spatial bias in field accessibility and collection priorities. When these data types with different sampling approaches converge on similar thermal limits despite their distinct limitations, this suggests the patterns are less likely to be methodological artifacts. The specific datasets were:

-   Satellite-based estimates of lowland rice extent in Asia from the International Rice Research Institute [@nelson2015]. This dataset employs high-resolution (500m) presence-absence markers from MODIS observations (2000-2012) and offers relatively uniform sampling across both temperate and tropical regions. It provides a more objective approach than spatially biased occurrence records. However, its coverage is limited to East and Southeast Asia and it may poorly distinguish intercropped wheat and rice in Northeast China and natural wetlands and paddy rice cultivation in Indonesia. To minimize such sampling issues, we aggregated the 500m data into 5km grid cells, dropping occurrences with less than 20% coverage to minimize false positives from low-pixel observations. Subsequent analyses of these data proved robust to the exact resolution and coverage threshold used.

-   Estimates of paddy rice harvested areas around the year 2000 [@monfreda2008]. This dataset, integrates satellite-based estimates of cropland with sub-national statistics for rice harvested areas. It utilizes geospatial cropland maps to downscale harvest area and yield census data and offers global coverage at approximately 10km resolution. Countries that lack detailed administrative data at the subnational level, such as Laos and Kazakhstan, can exhibit overly smoothed areas. The use of harvested area as a metric can be misleading in regions with multiple annual harvests, leading to double or triple counting, but this is mitigated when converted to binary occurrence data.

-   Geolocated, point-based occurrence records for rice and its wild progenitor synthesized from previous studies [@civán2018; @gutaker2020; @yang2022; @ramirez-villegas2022], originally sourced from GBIF, the Rice Haplotype Map project, and other datasets based on herbarium specimens or germplasm samples from international genebank databases. Given their direct identification, these occurrence records generally offer greater reliability than area-averaged crop occurrences derived from satellites and sub-national statistics. Nonetheless, they are susceptible to spatial sampling bias. For instance, regions like China are underrepresented in GBIF in terms of sampling effort compared to neighboring countries with similar geographical extent, and herbarium collections may more accurately sample upland rice varieties at the expense of larger paddy fields. After creating the full combined datasets, geolocations were checked for anomalous entries then thinned to a uniform grid to minimize irregular spatial sampling.

We extracted the contemporary CHELSA climate data at each set of occurrence points for each data type to calculate temperature distributions and quantiles. We explored various combinations of grid/point resolution for the climate and occurrence datasets from 1-10km, but found this did not impact the upper temperature threshold estimates.

## Archaeological Rice Distribution Data

We used past rice occurrence data sourced from archaeological sites in Asia, as synthesized in @Guedes2018 and @long2022 and primarily derived from version 2 [@silva2015] and 3 (Dorian Fuller 2023, personal communication) of the Rice Archaeological Database. We also included observations from @crema2022 to increase data coverage in Japan. These records are typically of botanical remains, believed to represent *O. sativa japonica* from these archaeological sites, with less intensive sampling of *indica* varieties from northern India. However, based on their chronology, some occurrences might instead reflect cultivation of wild-type *O. rufipogon* or *O. nivara*. After data harmonization—which involved eliminating potential outliers, correcting misclassifications, and removing duplicated site data (see supplemental analysis code repository for the reproducible workflow)—we were left with 1,595 dates from 803 archaeological sites. These datasets comprise a mixture of direct radiocarbon dates on rice remains, alongside dates for archaeological phases associated with rice remains that were not directly dated. For these indirectly dated samples, we used median dates and minimum/maximum date ranges for the archaeological strata or contexts in which the rice remains were found. We employed the Intcal20 calibration curve for recalibrating all radiocarbon dates, barring a single site in the southern hemisphere where we utilized SHcal20. We then extracted temperature variables from the CHELSA-TraCE21k v1.0 dataset at each sampled location in time and space. To account for chronological uncertainty, we generated 5,000 bootstrap replicates, sampling from the radiocarbon dates' posterior density distribution and a uniform density for the dates based on archaeological phases. Finally, we constructed unique kernel density estimates of the temperature distributions at each rice occurrence point for every bootstrap replicate and temperature variable.

## Genetic Offset Analysis

To assess the adaptive capacity of rice varieties beyond simple distributional limits, we performed a genetic offset analysis to evaluate the potential maladaptation of *Oryza sativa* subspecies *indica* and *japonica* under projected climate change scenarios. Genetic offset metrics provide a complementary perspective to geographical threshold analyses by identifying where genetic adaptation may or may not keep pace with changing thermal conditions. Landraces are representative of the extant genetic diversity of crop species, and frequently exhibit local adaptations from sustained cultivation in specific geographic localities. We leveraged previously published genomic datasets of geotagged rice landraces belonging to the subspecies *O. sativa ssp. Indica* [@gutaker2020] and *O. sativa ssp. Japonica* [@alam2021], containing genome-wide biallelic single nucleotide polymorphisms (SNPs) filtered for quality and imputed for missing genotypes. The workflow entailed a gene-environment association analysis focusing on the first principal component of the three temperature variables (MAT, TWARM, TMAX), which explained over 84% of the environmental variance across the locations of both rice subspecies. Using the first principal component addresses multicollinearity among the temperature variables while retaining most environmental variation. The gene-environment association analysis was performed using the `lfmm2` function from the R package LEA (v3.12.2)—on the two subspecies separately—to identify variants associated with variation in temperature [@gain2021]. To correct for population structure in the GEA, we provided the number of ancestral populations, K, as the number of latent factors in our latent factor mixed models [@gain2021]. We selected the number of ancestral populations based on the number of principal components of the genotype matrix that explain a large proportion of the variance, the cross-entropy—a measure of model fit—of different values of K, and information from prior studies [@gutaker2020; @alam2021]. Variants identified in the GEA were clumped within 100 kilobases of each other, selecting the variant with the lowest p-value as the candidate SNP from each linkage group. The genetic offset, indicative of maladaptation to predicted climates [@gain2023], was calculated using these loci. These offset values indicate the Euclidean distance between current genomic composition and the composition theoretically required for adaptation to projected climate conditions. We averaged model predictions across multiple climate models (UKESM, MRI, IPSL, etc.) in the ensemble for each Shared Socioeconomic Pathway (SSP).

We used the `genetic.offset` function of the R package LEA [@gain2021] to calculate genomic offset statistics for rice landraces of *O. sativa ssp. Indica* and *O. sativa ssp. Japonica* while considering the temperature-associated variants as putative adaptive variants under the SSP1, SSP3, and SSP5 projected pathways that are used to derive greenhouse gas emission scenarios. We also calculated genomic offset statistics under the maximum estimated temperature at each location in the past 12,000 years.

To make predictions about where the climate is likely to be optimal for rice-growing in the future, we sampled 10,000 grids from across Asia and calculated genomic offset scores for each individual in the environment of each grid, for the three SSP scenarios. We interpret the grid with the lowest offset score as a possible future optimal location for each rice individual. As a measure of the extent of movement that would be required for adaptation, we subtract the absolute value of the current latitude of each rice individual from the absolute value of the centroid latitude of the optimal grid; positive values of this absolute latitudinal distance indicate movement away from the equator.

# References

::: {#refs}
:::

# Acknowledgements {.appendix}

**Funding:** This work was supported by a grant from the Zegar Family Foundation.

**Author contributions:** Conceptualization: NG, JDG. Methodology: NG, OA, MP, JDG. Software: NG, OA. Formal Analysis: NG, OA. Validation: NG, JDG. Data Curation: NG, OA, JDG. Writing—original draft: NG, JDG. Writing—review and editing: NG, OA, MP, JDG. Visualization: NG. Supervision: MP, JDG. Funding Acquisition: MP, JDG.

**Competing interests:** The authors declare that they have no competing interests.

**Data and materials availability:** All analyses carried out in `R` [@base]. The analysis is run via reproducible `.qmd` notebooks available [here](https://github.com/nick-gauthier/rice). All data required to reproduce the main analysis and figures are included with the linked code repository or available from public sources referenced therein.

{{< pagebreak >}}

\newpage
\appendix
\renewcommand{\thefigure}{S\arabic{figure}}
\renewcommand{\thetable}{S\arabic{table}}
\setcounter{figure}{0}
\setcounter{table}{0}

# Supplementary Materials {.appendix}

Supplementary Materials for **Projected warming will exceed the long-term thermal limits of rice cultivation**

Nicolas Gauthier, Ornob Alam, Michael D. Purugganan, Jade d'Alpoim Guedes

Corresponding author: nicolas.gauthier\@ufl.edu

**This PDF file includes:**

-   Figures S1 to S9

-   Tables S1 to S4

{{< pagebreak >}}

```{r}
#| label: fig-current-limits
#| fig-width: 6
#| fig-height: 5
#| cache: true
#| fig-unnumbered: true
#| fig-cap: "Present day geographic distribution of temperature thresholds in CHELSA V2.1 data. A) Mean annual temperature greater than 28.2°C. B) Mean maximum temperature of the warmest month greater than 40.4°C. C) Mean maximum temperature of the warmest quarter greater than 32.7°C."
chelsa_wrld <- readRDS(here('data/derived/chelsa_world_downsampled.rds'))

current_limits_1 <- ggplot() +
  geom_stars(data = chelsa_wrld[1] >= units::drop_units(bio1_limit)) +
  scale_fill_manual(values = c('#fee8c8', '#e34a33'), 
                    name = paste0('MAT > ', bio1_limit), 
                    na.value = NA, na.translate = FALSE) +
  geom_sf(data = coasts_world) +
  labs(x = '', y = '') +
  coord_sf(expand = FALSE)

current_limits_5 <- ggplot() +
  geom_stars(data = chelsa_wrld[2] >= units::drop_units(bio5_limit)) +
  scale_fill_manual(values = c('#fee8c8', '#e34a33'), 
                    name = paste0('TMAX > ', bio5_limit), 
                    na.value = NA, na.translate = FALSE) +
  geom_sf(data = coasts_world) +
  labs(x = '', y = '') +
  coord_sf(expand = FALSE)

current_limits_10 <- ggplot() +
  geom_stars(data = chelsa_wrld[3] >= units::drop_units(bio10_limit)) +
    scale_fill_manual(values = c('#fee8c8', '#e34a33'), 
                       name = paste0('TWARM > ', bio10_limit),
                    na.value = NA, na.translate = FALSE) +
  geom_sf(data = coasts_world) +
  labs(x = '', y = '') +
  coord_sf(expand = FALSE)

current_limits_1 / current_limits_5 / current_limits_10 + plot_annotation(tag_levels = 'A', tag_suffix = ')') 
```

{{< pagebreak >}}

```{r}
#| label: fig-bootstrap
#| fig-width: 6
#| fig-height: 4
#| fig-unnumbered: true
#| fig-cap: "A) Bootstrapped kernel density estimates of rice's thermal extent throughout the Holocene. Bootstrap resampling accounts for uncertainty in radiocarbon and phase-based dating of archaeological rice finds. Contemporary temperature thresholds indicated in red. B) Estimated 97.5% quantiles from the bootstrapped dataset. Contemporary quantiles indicated in red."
trace_boot <- readRDS('data/derived/trace_boot.rds')

# contemporary quantiles for plotting
quant_dat <- quant_975 |>
              select(-quantile) |>
              setNames(c('MAT', 'tmax', 'twarm')) |>
              pivot_longer(everything())

boot_1 <- trace_boot %>%
  select(rep, MAT:twarm) %>%
  pivot_longer(MAT:twarm) %>%
  group_by(rep, name) %>%
  tidy_kde() %>%
ggplot(aes(value, estimate)) +
  geom_line(alpha = 0.01, aes(group = rep)) +
  facet_wrap(~name, scales = 'free_y', nrow = 3) +
  geom_vline(data = quant_dat, aes(xintercept = as.numeric(value)), linetype = 2, color = 'red') +
  labs(x = 'Temperature')

boot_2 <- trace_boot %>%
  pivot_longer(MAT:twarm, values_to = 'temperature') %>%
  mutate(temperature = units::set_units(temperature, 'degree_c')) %>%
  group_by(rep, name) %>%
  reframe(value = quantile(temperature, 0.975, type = 8)) %>%
  ggplot(aes(value)) +
    geom_histogram() +
    facet_wrap(~name, scales = 'free_x', nrow = 3) +
    labs(x = 'Temperature') +
    theme_bw() +
    geom_vline(data = quant_dat, aes(xintercept = value), linetype = 2, color = 'red')

rm(trace_boot, quant_dat)

boot_1 + boot_2 +  plot_annotation(tag_levels = 'A')
```

{{< pagebreak >}}

```{r}
#| label: fig-recon-timeseries
#| fig-width: 12
#| fig-height: 6
#| fig-unnumbered: true
#| fig-cap: "Comparison of Holocene temperature trends over Asia from transient climate models and reconstructions. A) Holocene trends in mean annual temperature, relative to the 3-5ka mean, from Osman et al. 2021 (black, one standard deviation uncertainty in grey), Erb et al. 2022 (blue), and CHELSA-TraCE21k (red). B) Comparison of annual, seasonal, and monthly temperature trends over Asia from CHELSA-TraCE21k."
trace_ts <- read_rds(here('data/derived/trace_ts.rds'))

a <- trace_ts |>
  pivot_longer(-time) |>
  mutate(name = factor(case_when(name == 'bio1' ~ 'Mean annual temperature',
                                 name == 'bio5' ~  'Max temperature of warmest month',
                                 name == 'bio10' ~  'Max temperature of the warmest quarter'),
                        levels = c('Mean annual temperature', 
                                   'Max temperature of the warmest quarter',
                                   'Max temperature of warmest month'))) |>
  ggplot() +
  geom_line(aes(time, value, group = name)) +
  facet_wrap(~name, scales = 'free_y', ncol = 1) +
  labs(x = 'Time (ka BP)', y = 'Temperature (C)') +
  scale_x_reverse(breaks = seq(0, 12, 2)) +
  theme_bw()

# Calculate the area-weighted averaged temperatures and uncertainties from the Erb et al. reconstruction and save the results.
erb_rast <- read_rds(here('data/derived/erb_rast.rds'))

erb_area_total <- st_area(erb_rast) |>
  pull(area) |> 
  sum()

erb_ts <- (erb_rast * st_area(erb_rast)) |>
  st_apply(3, sum)  |>
  as_tibble() |>
  mutate(across(-ages, ~units::drop_units(.x / erb_area_total)),
         time = ages / 1000) |>
  select(-ages)

# Do the same for the LGMR, although this is more complicated as we have to calculate the anomalies by hand for comparison to Erb.

lgmr_rast <- read_rds('data/derived/lgmr_rast.rds')

lgmr_mean_reference <- lgmr_rast |>
  filter(between(time, 3000, 5000)) |>
  st_apply(1:2, mean)

lgmr_sd_reference <- lgmr_rast |>
  filter(between(time, 3000, 5000)) |> 
  select(sat_std) |>
  # we need to account for uncertainty in the reference period too
  st_apply(1:2, function(x) sqrt(sum(x^2) / 11) / sqrt(11)) # 11 is the number of time steps

lgmr_uncertainty <- sqrt(lgmr_rast['sat_std'] ^ 2 + lgmr_sd_reference ^ 2)

lgmr_rast_anom <- lgmr_rast['sat'] - lgmr_mean_reference['sat']

lgmr_anomalies <- c(anom = lgmr_rast_anom,
  anom_upper = lgmr_rast_anom + lgmr_uncertainty,
  anom_lower = lgmr_rast_anom - lgmr_uncertainty)

lgmr_area_total <- st_area(lgmr_rast_anom) |>
  as_tibble() |>
  pull(area) |>
  sum()

lgmr_anom_ts <- (lgmr_anomalies * st_area(lgmr_rast_anom)) |>
  st_apply(3, sum)  |>
  as_tibble() |>
    mutate(across(-time, ~units::drop_units(.x / lgmr_area_total)),
           time = time / 1000)

b <- ggplot(data = lgmr_anom_ts, aes(x = time)) +
  geom_line(aes(y = anom)) +
  geom_ribbon(aes(ymin = anom_lower, ymax = anom_upper), alpha = 0.1) +
  geom_line(data = trace_ts, aes(x = time, y = bio1 - 19.737), color = 'red') +
    geom_line(data = erb_ts, aes(y = sat_mean), color = 'blue') +
    geom_ribbon(data = erb_ts, aes(ymin = sat_low , ymax = sat_high), alpha = 0.1, fill = 'blue') +
  scale_x_reverse(breaks = seq(0, 12, 2))  +
  labs(x = 'Time (ka BP)', y = 'Temperature anomaly (C)') 

b + a + plot_layout(guides = 'collect', axes = 'collect') + plot_annotation(tag_levels = 'A', tag_suffix = ')')
```

{{< pagebreak >}}

```{r}
#| label: fig-kde-lgmr
#| fig-width: 10
#| fig-height: 6
#| fig-unnumbered: true
#| fig-cap: "Kernel density estimates of the thermal distribution by millennium across two different temperature datasets, with raw data points indicated in black and contemporary rice thermal limits in red. A) Temperature data are derived from CHELSA-TraCE21k V1.0 (Karger et al. 2023) (same as Figure 3b in main text). B) Temperature data derived from the Last Glacial Maximum Reanalysis (LGMR) dataset (Osman et al. 2022). C) Difference in kernel density estimates of mean annual temperature (MAT) between the CHELSA-TraCE21k and LGMR datasets."
new_lgmr_times <- lgmr_rast |>
  st_get_dimension_values('time') |>
  years() %>%
  `-`(ym('1950-01'), .)

lgmr2 <- lgmr_rast |>
  st_set_dimensions('time', values = (new_lgmr_times)) %>%
  .[,,,61:1]

lgmr_extract_test <- arch_trace_dat |>
  mutate(time = ym('1950-01') - years(as.integer(med_age) * -1)) %>%
  st_extract(lgmr2, ., time_column = 'time', interpolate_time = TRUE) %>%
  st_drop_geometry() %>%
  bind_cols(arch_trace_dat, .) |>
  remove_missing()

arch_dens_mat <- arch_trace_dat %>%
  ggplot(aes(MAT, mil)) +
  scale_y_discrete(limits = rev) +
  geom_density_ridges(aes(fill = mil), 
                      panel_scaling = TRUE, 
                      scale = 2, 
                      alpha = 0.5, 
                      jittered_points = TRUE, 
                      point_alpha = 0.25, 
                      point_size = 0.5) +
  labs(y = 'Millennium BP', x = 'Mean annual temperature') +
  geom_vline(xintercept = as.numeric(bio1_limit), linetype = 2, color = 'red') +
  scale_fill_brewer(palette = 'Spectral', guide = 'none') +
  scale_x_continuous(limits = c(0, 32))

arch_dens_lgmr <- lgmr_extract_test %>%
  ggplot(aes(sat, mil)) +
  scale_y_discrete(limits = rev) +
  geom_density_ridges(aes(fill = mil), 
                      panel_scaling = TRUE, 
                      scale = 2, 
                      alpha = 0.5, 
                      jittered_points = TRUE, 
                      point_alpha = 0.25, 
                      point_size = 0.5) +
  labs(y = 'Millennium BP', x = 'Mean annual temperature') +
  geom_vline(xintercept = as.numeric(bio1_limit), linetype = 2, color = 'red') +
  scale_fill_brewer(palette = 'Spectral', guide = 'none') +
  scale_x_continuous(limits = c(0, 32))

# the difference between Chelsa-TraCE and LGMR ensemble mean at each point in time/space
arch_dens_diff <- lgmr_extract_test %>%
  ggplot(aes(sat - MAT, mil)) +
  scale_y_discrete(limits = rev) +
  geom_density_ridges(aes(fill = mil), 
                      panel_scaling = TRUE, 
                      scale = 2, 
                      alpha = 0.5, 
                      jittered_points = TRUE, 
                      point_alpha = 0.25, 
                      point_size = 0.5) +
  labs(y = 'Millennium BP', x = 'Difference (C)') +
  geom_vline(xintercept = 0, linetype = 2, color = 'red') +
  scale_fill_brewer(palette = 'Spectral', guide = 'none')

# why don't the tags work here?
(arch_dens_mat / arch_dens_lgmr + plot_layout(axes = 'collect')) | arch_dens_diff + plot_layout(widths = c(1, .1))  + plot_annotation(tag_levels = 'A', tag_suffix = ')') 
```

{{< pagebreak >}}

```{r}
#| label: fig-country-summaries
#| fig-width: 8
#| fig-height: 6
#| fig-unnumbered: true
#| fig-cap: "Projected increases in land area surpassing key temperature thresholds in each of the top 15 rice-producing countries in east Asia."
country_stats %>% 
  ggplot(aes(ssp, percent, group = variable, color = variable)) +
  facet_wrap(~name) +
  scale_color_manual(values = c('#abdda4', '#fdae61', '#d7191c'
)) +
  geom_line(linewidth = .8) +
  geom_point() +
  theme(axis.text.x = element_text(size = 6, angle = 45, hjust = 1))
```

{{< pagebreak >}}

```{r}
#| label: fig-niche-all-models-bio1
#| cache: true
#| fig-width: 6
#| fig-height: 5
#| fig-unnumbered: true
#| fig-cap: "Predicted changes in mean annual temperature over currently cultivated rice areas in Asia for multiple CMIP6 ensemble members."
ggplot() +
  geom_stars(data = slice(cmip6_maps, 'variable', 1) > units::drop_units(bio1_limit)) +
  facet_grid(model~ssp) +
  scale_fill_manual(values = c('#fee8c8', '#e34a33'), 
                    name = paste0('MAT > ', bio1_limit), 
                    na.value = NA, na.translate = FALSE) +
  geom_sf(data = coasts) +
  labs(x = '', y = '') +
  theme(
    axis.text.x = element_text(size = 5, angle = 45, hjust = 1),
    axis.text.y = element_text(size = 5)
  )
```

{{< pagebreak >}}

```{r}
#| label: fig-niche-all-models-bio10
#| cache: true
#| fig-width: 6
#| fig-height: 5
#| fig-unnumbered: true
#| fig-cap: "Predicted changes in mean maximum temperature of the warmest quarter over currently cultivated rice areas in Asia for multiple CMIP6 ensemble members."
ggplot() +
  geom_stars(data = slice(cmip6_maps, 'variable', 2) > units::drop_units(bio10_limit)) +
  facet_grid(model~ssp) +
  scale_fill_manual(values = c('#fee8c8', '#e34a33'), 
                       name = paste0('TWARM > ', bio10_limit),
                    na.value = NA, na.translate = FALSE) +
  geom_sf(data = coasts) +
  labs(x = '', y = '')+
  theme(
    axis.text.x = element_text(size = 5, angle = 45, hjust = 1),
    axis.text.y = element_text(size = 5)
  )
```

{{< pagebreak >}}

```{r}
#| label: fig-niche-all-models-bio5
#| cache: true
#| fig-width: 6
#| fig-height: 5
#| fig-unnumbered: true
#| fig-cap: "Predicted changes in mean maximum temperature of the warmest month over currently cultivated rice areas in Asia for multiple CMIP6 ensemble members."
ggplot() +
  geom_stars(data = slice(cmip6_maps, 'variable', 3) > units::drop_units(bio5_limit)) +
  facet_grid(model~ssp) +
  scale_fill_manual(values = c('#fee8c8', '#e34a33'), 
                    name = paste0('TMAX > ', bio5_limit), 
                    na.value = NA, na.translate = FALSE) +
  geom_sf(data = coasts) +
  labs(x = '', y = '') +
  theme(
    axis.text.x = element_text(size = 5, angle = 45, hjust = 1),
    axis.text.y = element_text(size = 5)
  )
```

{{< pagebreak >}}

```{r}
#| label: fig-displacement
#| fig-width: 6
#| fig-height: 3
#| fig-unnumbered: true
#| fig-cap: "Estimated displacement of the optimal growing location of rice landraces away from the equator, based on genetic offset analysis across three future temperature scenarios. The x-axis indicates the difference between the absolute projected latitude in the future scenario and the absolute latitude today, with positive values indicating a shift in the optimal growing location of a given population away from the equator."
list(japonica = readRDS(here('data/derived/japonica_lat_shift.rds')),
     indica = readRDS(here('data/derived/indica_lat_shift.rds'))) |>
  bind_rows(.id = 'landrace') |>
  mutate(ssp = case_when(name == 'diff2.6' ~ 'SSP1-2.6',
                         name == 'diff7.0' ~ 'SSP3-7.0',
                         name == 'diff8.5' ~ 'SSP5-8.5')) |>
ggplot(aes(x = value, fill = ssp)) +
  geom_density(alpha = 0.3) +
  facet_grid(landrace ~ ssp) +
  geom_vline(xintercept = 0, linetype = 2) +
  scale_fill_brewer(palette = 'Spectral', direction = -1) +
  labs(x = 'Latitudinal displacement (degrees)')
```

{{< pagebreak >}}

```{r}
#| label: tbl-quantiles
#| tbl-cap: "Present-day rice extent quantiles (in °C) across three datasets of varying resolution and spatiotemporal support, compared to those calculated from archaeological sites in Asia throughout the Holocene."
quants_mod_monfreda <- monfreda_occ %>%
  st_drop_geometry() %>%
  select(bio1, bio5, bio10) %>%
  mutate(across(everything(), ~set_units(.x, 'degree_C'))) %>%
  reframe(across(everything(), 
                   ~quantile(.x, quantiles, type = 8))) %>%
  round(1) %>%
  mutate(quantile = quantiles, .before = 1)

quants_mod_gbif <- occ_dat %>%
  st_drop_geometry() %>%
  select(bio1, bio5, bio10) %>%
  mutate(across(everything(), ~set_units(.x, 'degree_C'))) %>%
  reframe(across(everything(), 
                   ~quantile(.x, quantiles, type = 8))) %>%
  round(1) %>%
  mutate(quantile = quantiles, .before = 1)

quants_arch <- arch_trace_dat %>%
  st_drop_geometry() %>%
  select(bio1 = MAT, bio5 = tmax, bio10 = twarm) %>%
  mutate(across(everything(), ~set_units(.x, 'degree_C'))) %>%
  reframe(across(everything(), 
                   ~quantile(.x, quantiles, type = 8))) %>%
  round(1) %>%
  mutate(quantile = quantiles, .before = 1)


# left_join(quants_mod, quants_mod_monfreda, by = 'quantile') %>%
#  left_join(quants_mod_gbif, by = 'quantile') %>%
#  left_join(quants_arch, by = 'quantile') %>%
#  drop_units() %>% # do we want celsius units?
#  mutate(quantile = set_units(quantile * 100, '%')) %>%
#  select(quantile, bio1.x, bio1.y, bio1.x.x, bio1.y.y, bio5.x, bio5.y, bio5.x.x, bio5.y.y, bio10.x, bio10.y, bio10.x.x, bio10.y.y) %>%
#   setNames(c('Quantile', rep(c('IRRI', 'Mon.', 'GBIF', 'Arch.'), 3))) %>%
#   knitr::kable(format = 'pipe') |>
#   #knitr::kable(format = fmt, booktabs = knitr::is_latex_output(), align = "c") |>
#   kableExtra::add_header_above(tibble(names = c('', 'MAT', 'TMAX', 'TWARM'), spans = c(1,4,4,4)))
#  # kableExtra::kable_styling(full_width = FALSE, latex_options = c("hold_position"))


left_join(quants_mod, quants_mod_monfreda, by = 'quantile') %>%
 left_join(quants_mod_gbif, by = 'quantile') %>%
 left_join(quants_arch, by = 'quantile') %>%
 drop_units() %>%
 mutate(quantile = set_units(quantile * 100, '%')) %>%
 select(Quantile = quantile, bio1.x, bio1.y, bio1.x.x, bio1.y.y, bio5.x, bio5.y, bio5.x.x, bio5.y.y, bio10.x, bio10.y, bio10.x.x, bio10.y.y) %>%
 gt() %>%
 tab_spanner(label = "MAT", columns = 2:5) %>%
 tab_spanner(label = "TMAX", columns = 6:9) %>%
 tab_spanner(label = "TWARM", columns = 10:13) %>%
 cols_label(
   bio1.x = "IRRI", bio1.y = "Mon.", bio1.x.x = "GBIF", bio1.y.y = "Arch.",
   bio5.x = "IRRI", bio5.y = "Mon.", bio5.x.x = "GBIF", bio5.y.y = "Arch.",
   bio10.x = "IRRI", bio10.y = "Mon.", bio10.x.x = "GBIF", bio10.y.y = "Arch."
 ) %>%
 cols_align(align = "center")

```

{{< pagebreak >}}

```{r}
#| label: tbl-country-summaries-table1
#| tbl-cap: "Projected increases in percent land area surpassing MAT thresholds in each of the top 15 rice-producing countries in east Asia."
# this is total land area??
# country_stats %>%
#   filter(variable == 'Mean annual temperature') %>%
#   select(-percent, -area) %>%
#   pivot_wider(names_from = ssp, 
#               values_from = sum) %>%
#   select(Country = name, Present = present, `SSP1-2.6`:`SSP5-8.5`) %>%
#   summarise(across(Present:`SSP5-8.5`, ~sum(.x))) %>%
#   mutate(across(everything(), ~.x / Present))
#fmt <- if (knitr::is_latex_output()) "latex" else "html"

country_stats %>%
  mutate(percent = round(percent)) %>%
  filter(variable == 'Mean annual temperature') %>%
  select(-sum, -area) %>%
  pivot_wider(names_from = ssp, values_from = percent) %>%
  select(Country = name, Present = present, `SSP1-2.6`:`SSP5-8.5`) %>%
  knitr::kable(format = 'pipe')
```

{{< pagebreak >}}

```{r}
#| label: tbl-country-summaries-table2
#| tbl-cap: "Projected increases in percent land area surpassing TWARM thresholds in each of the top 15 rice-producing countries in east Asia."
country_stats %>%
  mutate(percent = round(percent)) %>%
  filter(variable == 'Max temperature of warmest quarter') %>%
  select(-sum, -area) %>%
  pivot_wider(names_from = ssp, values_from = percent) %>%
  select(Country = name, Present = present, `SSP1-2.6`:`SSP5-8.5`) %>%
  knitr::kable(format = 'pipe')
```

{{< pagebreak >}}

```{r}
#| label: tbl-country-summaries-table3
#| tbl-cap: "Projected increases in percent land area surpassing TMAX thresholds in each of the top 15 rice-producing countries in east Asia."
country_stats %>%
  mutate(percent = round(percent)) %>%
  filter(variable == 'Max temperature of warmest month') %>%
  select(-sum, -area) %>%
  pivot_wider(names_from = ssp, values_from = percent) %>%
  select(Country = name, Present = present, `SSP1-2.6`:`SSP5-8.5`) %>%
  knitr::kable(format = 'pipe')
```

```{r}
#| include: false
knitr::knit_exit()
```

# Supplementary Materials {.appendix}

Supplementary Materials for **Projected warming will exceed the long-term thermal limits of rice cultivation**

Nicolas Gauthier, Ornob Alam, Michael D. Purugganan, Jade d'Alpoim Guedes

Corresponding author: nicolas.gauthier\@ufl.edu

**This PDF file includes:**

-   Figs. S1 to S9

-   Tables S1 to S4

{{< pagebreak >}}

## Fig. S1.

{{< embed supplementary_materials.qmd#fig-current-limits >}}

{{< pagebreak >}}

## Fig. S2.

{{< embed supplementary_materials.qmd#fig-bootstrap >}}

## Fig. S3.

{{< embed supplementary_materials.qmd#fig-recon-timeseries >}}

{{< pagebreak >}}

## Fig. S4.

{{< embed supplementary_materials.qmd#fig-kde-lgmr >}}

{{< pagebreak >}}

## Fig. S5.

{{< embed supplementary_materials.qmd#fig-country-summaries >}}

{{< pagebreak >}}

## Fig. S6.

{{< embed supplementary_materials.qmd#fig-niche-all-models-bio1 >}}

{{< pagebreak >}}

## Fig. S7.

{{< embed supplementary_materials.qmd#fig-niche-all-models-bio10 >}}

{{< pagebreak >}}

## Fig. S8.

{{< embed supplementary_materials.qmd#fig-niche-all-models-bio5 >}}

{{< pagebreak >}}

## Fig. S9.

{{< embed supplementary_materials.qmd#fig-displacement >}}

{{< pagebreak >}}

## Table S1.

{{< embed supplementary_materials.qmd#tbl-quantiles >}}

{{< pagebreak >}}

## Table S2.

{{< embed supplementary_materials.qmd#tbl-country-summaries-table >}}

{{< pagebreak >}}

## Data S1. (separate file)

`main.qmd` -- A quarto notebook containing the R code sufficient to reproduce the figures in the main analysis.

## Data S2. (separate file)

`supplementary_materials.qmd` -- A quarto notebook containing the R code sufficient to reproduce the supplementary figures and tables.

## Data S3. (separate file)

`preprocessing.qmd` -- A quarto notebook containing the R code to reproduce computationally intensive data import and preprocessing steps outlined in the Materials and Methods.
