Introduction

Impacts of the climate crisis on food security, economic growth, and living conditions comprise one of the greatest wicked problems facing humanity in the 21st century1. Both climatic trends and weather extremes negatively impact the sustainability and consistency of plant-based food production2,3,4,5,6,7,8, animal-based food, seafood9,10,11,12,13, and beverage production14. The United Nations defines food security as the state in which all people, at all times, have physical, social, and economic access to sufficient, safe, and nutritious food that meets their dietary needs15. Despite calls for inclusion of social and economic assessments, prima facie metrics promulgating food security dogmatically persist in biophysical dimensions, such as food required to supply sufficient energy and nutrient intake16,17. Even though food security is an emergent property of the balance between food production (supply side) and food needs (demand side; Fig. 1), the vast majority of studies on the impact of climate change on food security focused on the supply side, perhaps because demand-side measures are more difficult to reliably quantify18,19.

Fig. 1: National food security as a function of food supply and demand.
figure 1

Schematic depicts the balance between climate-change influence on food supply and effects of dietary choice on food demand. Central panel shows six possible dimensions of food security, considering plausible supply changes caused by climate change (X-axis) and demand change caused by dietary preference (Y-axis). Scenarios I, II, and VI (shaded red zone) indicate a negative impact on food security, while blue zones indicate scenarios (III, IV, and V) likely to positively impact food security. Detailed descriptions are provided in Supplementary Table 1.

Climate change and vicissitudes of the weather have significant bearing on seasonal and annual food supply, as does land use, management, crop and livestock genotype, environment, and interactions therein9,20,21,22,23,24,25. On the demand side, variation in food demand (per capita demand for different food groups) is governed by the rate of population growth and trends in dietary choices, amongst other factors26. Previous studies have shown that climate change and variability negatively impact food supply, although historically for grain detrimental impacts of the weather have been outweighed by productivity gains underpinned by advancements in technology, practices, and machinery27. However, such observations may be worth revisiting, because anthropogenic dietary preferences were not well accounted for in such studies.

Dietary patterns, i.e.,  the types and quantities of food consumed by individuals or populations, vary among countries as well as among geographic or socioeconomic demographics within and across countries28. Globalization and growing affluence of the middle class have seen more people adopting diets comprised by greater proportions of carbohydrates and animal-based proteins, potentially yielding health benefits in the short term29. In the long run, however, shifting toward plant-based diets may reduce detrimental health outcomes, such as the rate of overweight/obesity, the risk of malnourishment, and non-communicable diseases28,30,31,32. A study on the Italian population found that healthier diets were realized by increasing consumption of plant-based foods like pulses, fruits, and vegetables while decreasing consumption of animal-based foods such as red and/or processed meat33,34,35. Shifting toward sustainable and more plant-based diets, together with reducing food loss and waste could be strategies for reducing environmental pressure on food systems and mitigating climate change without compromising on nutritional status and dietary health32,36,37,38,39,40,41,42. Reducing the demand side through dietary change would appear to be a promising avenue for attaining a future characterized by enduring and sustainable food security36.

Previous scholars have focused on either the impact of climate change or the impact of dietary changes on food security, but rarely on both. The present study demonstrates conceptualization of a comprehensive approach for evaluating country-level food security considering both climate change and dietary changes (Fig. 1). Overall, food security could be theoretically improved (impaired) by three key scenarios: (1) Increasing food supply and decreasing food demand (decreasing food supply and increasing food demand); (2) Faster (slower) gains in food supply than in food demand over time; (3) Slower (faster) reduction in food supply than in food demand (Fig. 1 and Supplementary Table 1).

We focused on the ten largest food categories: nuts, eggs, vegetables, fish, meat, milk, fruits, pulses, grains, and starchy roots. We used a resource-based cereal equivalents (CE) measure to aggregate food supply and demand, enabling us to compare the effects. Since climate is considered to be a type of resource for producing crop- and animal-based food products, but their resource efficiencies vary, and this was accounted for through the use of CE coefficients. Country-level food supply data were sourced from FAOSTAT’s “Food Balances” (supply side), and country-level dietary pattern data (demand side) were derived from the Global Dietary Database 2018 (GDD2018) in grams per day for the period from 1990 to 2018. We employed a panel model to estimate the effects of year-to-year climate variations on CE food supply. Additionally, we assessed the impact of dietary changes on food demand by analyzing CE per capita demand in conjunction with national population data. Based on the conceptual framework illustrated in Fig. 1, we evaluated country-level food security by considering both climate change and dietary changes during the historical period of 1990–2018 and the future climate horizon of 2060. The climate conditions spanning these two periods could be universally adapted in future studies.

Results

Shifting historical dietary patterns

Compared with dietary patterns in 1990, the ten largest food categories (i.e., nuts, eggs, vegetables, fish, meat, milk, fruits, pulses, grains, and starchy roots) had higher global demand per capita in 2018 (Fig. 2a and Supplementary Fig. 1). Global nuts demand per capita increased by the greatest extent (composite value of 176%) driven primarily by 447% growth in the increases demand in Latin America & the Caribbean (Supplementary Fig. 2b). By contrast, global demand per capita for pulses, grains, and starchy roots increased only marginally by 4%, 4%, and 1%, respectively (Fig. 2a).

Fig. 2: Dietary trends for ten largest food categories from 1990 to 2018.
figure 2

a Percentage change in food demand per capita in 2018 compared with 1990. b Accumulated cereal equivalent food demand per capita (g d−1) in 1990 and 2018.

To standardize food categories, we aggregated demand and supply into resource-based CE (see “Methods”). On average, global CE food demand per capita increased from 1196 g d−1 in 1990 to 1462 g d−1 in 2018. Of the ten food categories, CE of meat and grain was 611 g d−1 and 323 g d−1, respectively, in 1990, accounting for 78% of total resource consumption; in 2018, CE of meat and grain increased to 778 g d−1 and 334 g d−1, respectively, accounting for 76% of total resource consumption (Fig. 2b). On the food supply side, global production of the ten food categories increased from 1990 to 2018, with total CE rising from 3.3 × 109 tonnes to 6.2 × 109 tonnes, according to FAOSTAT data.

Demand per capita for pulses and grains increased more among females (4%) than males (3%), but demand per capita for the remaining main food categories increased more for males (Supplementary Fig. 2a). Demand per capita for vegetables and nuts unanimously increased across study regions. Increased demand for nuts ranged from 86% in Africa to 447% in Latin America & the Caribbean. In Asia, the demand per capita for vegetables, meat, fish, eggs, and milk increased by 93%, 83%, 64%, 133%, and 56%, respectively. In Europe and North America, demand per capita for starchy roots decreased by 30% and 12%, respectively (Supplementary Fig. 2b). Upper-middle-income countries showed the highest increase in the demand per capita for vegetables (229%), nuts (304%), meat (64%), fish (93%), eggs (141%), and milk (76%) (Supplementary Fig. 2c). High-income countries exhibited lower demand for starchy roots (29% per capita). Low-income countries reduced their collective demand for fruit (4% per capita) and vegetables (7% per capita) but increased demand for grains (20% per capita, which was higher than high-, upper-middle-, and low-middle-income countries). Across age groups, demand per capita for starchy roots, meat, eggs, and milk decreased with age, while demand per capita for the other six food categories (fruit, vegetable, nuts, pulse, grain, and fish) remained stable across age groups (Supplementary Fig. 2d).

Integrated dietary and climate change impact on national food security from 1990 to 2018

From 1990 to 2018, dietary changes increased country-level CE food demand with a median of 18% (Supplementary Fig. 3). CE food demand increased to the greatest extent in Asia (median value 19%, p < 0.05) and the least in North America and Europe (medians of 3% and 4%, respectively, p < 0.05) (Supplementary Fig. 3a). Changes in CE food demand due to dietary changes were smaller in high-income countries (median of 6%, p < 0.05) than upper-middle, lower-middle, and low-income countries (medians of 23%, 23%, and 30%, respectively) (Supplementary Fig. 3b).

Climate change detrimentally impacted on food supply in 92% of the countries with a median reduction of 1% (Supplementary Fig. 4). The negative impact of climate change on food supply showed the highest in Asia (Supplementary Fig. 4a, p < 0.05). Climate change impacts on food supply were lower in high-income countries compared to the other three income-level groups (Supplementary Fig. 4b, p < 0.05), revealing a cruel irony in which developed countries (who have contributed the most to historical global warming) are the least impacted by the changing climate.

Using six plausible scenarios of food security when considering both climate change and dietary changes (Fig. 1 central panel), we integrated the food demand change caused by dietary changes, with food supply perturbation caused by climate change (Fig. 3). We found that food security was negatively affected in 70% of countries, impacting on some 4.6 billion people (62% of the global population). Situation I in Fig. 1 (where detrimental impacts of climate change on food supply were exacerbated by increasing food demand) occurred in about 60% of countries and impacted 4.4 billion people (59% of the global population), of which 1.4 billion were in China, 0.3 billion in Indonesia, and 0.1 billion in Mexico (these countries are upper-middle-income countries). Situation II (positive impact of climate change on food supply was insufficient to meet increasing food demand) affected 0.1 billion people (2% of the global population). Situation VI (negative impact of climate change on food supply exceeded the decreasing food demand) occurred in 5 countries (Kenya, Latvia, Madagascar, Malaysia, and Uruguay) and impacted 0.1 billion people (2% of the global population). Food security was positively affected in the remaining 40% of countries. Situation IV (positive impact of climate change on food supply outweighed the increasing food demand) occurred in two countries (Russia and Tanzania), affecting 0.2 billion people (3% of the global population). Situation V (negative impact of climate change on food supply more than offset by decreasing food demand) occurred in 28% of countries, affecting 36% of the global population. We found no cases of situation III (positive impact of climate change on food supply outweighing increasing food demand).

Fig. 3: Integrated impact of dietary changes and climate change on national food security from 1990 to 2018.
figure 3

a Geographical locations of the study countries categorized for the six possible situations of food security from 1990 to 2018. b Combinations of dietary pattern shifts and climate change affect the counts of population across the regions from 1990 to 2018. c Combinations of dietary pattern shifts and climate change affect the counts of the population across the national income levels from 1990 to 2018.

Projected global food demand and supply during the period of 2031–2060

We computed global CE food demand from 2031 to 2060 for the fixed diet as in 2018 scenario as well as eight dietary change scenarios. The eight dietary change scenarios included shifting the diet in 2018 toward business as usual (BAU), two classic local diets (Chinese Food Guide Pyramid and Mediterranean diet), three recommended diets (Global Dietary Guideline, National Recommended Diet by region, National Recommended Diet by income), and two sustainable diets (Flexitarian diet and EAT-Lancet diet). Regardless of population dynamics, there was a 74% increase in global CE demand under BAU diet scenario compared to the baseline diet of 2018, observed during the future period of 2031–2060 (Supplementary Fig. 5). Under the two classic local diets and three recommended diets, global CE demands increased by 1–41% relative to 2018, which would be lower than that under BAU scenario. The sustainable diets (Flexitarian diet and EAT-Lancet diet) would reduce total demand by 15% and 9%, respectively, compared with 2018; as well, such diets are recommended because they are nutritionally balanced and also have relatively low environmental impacts.

We applied the historical climate-CE food supply panel model to the climate change projection under two different combinations of shared socioeconomic pathways and Representative Concentration Pathways (SSP-RCP) scenarios (SSP2-4.5 and SSP5-8.5) from six climate models. Then we projected the global CE food supply that is driven by climate change for the periods of 2031–2060 and compared it with the global CE food supply under 2018 (Supplementary Fig. 6). On average, all six models projected a reduction in the global CE food supply under the two SSP-RCP scenarios. As compared with 2018, average model results showed that global CE food supply would be reduced by 3% (up to 7%) under SSP2-4.5 and 4% (up to 8%) under SSP5-8.5 during the period of 2031–2060, respectively.

With the integration of the projected food demand change caused by dietary changes with the food supply change caused by climate change, we assessed the six possible situations of food security under the eight dietary change scenarios and two SSP-RCP scenarios (Fig. 4 and Supplementary Fig. 7). Under the ‘medium mitigation’ middle of the road pathway (SSP2-4.5), negative effects of Situation I, II, and VI would occur in 82%, 2%, and 6% of the study countries with BAU scenario, covering 90%, 5%, and 0.1% of the global population. By changing the dietary patterns, fewer countries and less population would face the negative effects on food security. The Situation I (in which the negative impact of climate change on food supply was exacerbated by increasing food demand) could be substantially replaced by Situation V (in which the negative impact of climate change on food supply was more than offset by decreasing food demand), especially in Asia and Latin America & the Caribbean. In addition, negative effects would occur in less than 50% of the study countries under the two sustainable diets (31% for Flexitarian diet and 38% for EAT-Lancet diet) covering 53% and 60% of the global population. Similar results were projected under the ‘no mitigation’ high-emission pathway (SSP5-8.5, Supplementary Fig. 7).

Fig. 4: Impact of dietary changes and climate change on global food security during the future periods (2031–2060) under SSP2-4.5.
figure 4

The top eight panels represent the geographical locations of the study countries categorized for the six possible situations of food security in Fig. 1 with the balance between the supply change under future climate change and food demand change under the eight dietary change scenarios (i.e., BAU, Chinese Food Guide Pyramid, Mediterranean diet, Global Dietary Guideline, National Recommended Diet by Region, National Recommended Diet by Income, Flexitarian diet, and EAT-Lancet diet); the bottom panel represent the combinations affect the counts of population across the eight dietary change scenarios.

Discussion

We reveal that considering the impact of climate change on food production alone is a serious oversimplification of food security assessments. It is critical that such assessments accurately and holistically account for changes in food demand, especially those caused by dietary changes. We comprehensively assessed national food security at the global scale by considering both climate change and dietary changes. Depending on the sign and magnitude of the changes in food supply and food demand, we theorized six possible scenarios for food security. Food demand per capita for the ten main food categories showed an increase in 2018 compared to 1990. In high-income countries, consumption of animal products was already above optimum43; the increase in the animal-based food demand (e.g., meat, fish, eggs, and milk) was relatively low, as well as the relatively small population, hence lower impact of dietary changes on food demand in such countries (with a median of 6%). By contrast, inhabitants of low-income countries relied heavily on carbohydrates and starchy roots43 and due to lower affluence, were more concerned with survival and prosperity and less concerned with bespoke nutrition1,44; such that increase in grain demand was relatively high (20%).

Climate change negatively impacted on CE food supply in 92% of countries from 1990 to 2018, with median value of 1%. Such trends are lower than those reported in many previous studies2,3,6,45,46,47,48,49,50,51. This could be explained by national food productions were focused in the previous studies, while climate impacts on the national food supply could be mitigated by technologies21,52,53 (e.g., improved fertilization and genetics) as well as international trade, which were integrated considered in this study. In 28% of countries (with 36% of the global population), the negative impact of climate change on food supply was offset by decreasing food demand, and food security was not threatened after all. By contrast, 2% of the global population did not benefit from the positive impact of climate change on food supply because their dietary changes caused a faster increase in food demand. Therefore, it is not enough to only consider the impact on the supply side, and dietary changes thus play a vital role in the food security under climate change.

In the future, extreme weather events are expected to be more frequent, intense, and widespread; under the high and low emission scenarios, a once-per-hundred-year extreme climate event may cause an additional 20–36% and 11–33% population, respectively, to face hunger54,55,56,57,58. In this study, we projected that climate change would reduce the global food supply by 3% (up to 7%) under SSP2-4.5 and 4% (up to 8%) during 2031–2060, respectively. Without accounting for dietary changes, the sole influence of population growth would result in a 24.1% escalation in global food demand, thereby compounding the adverse effects of climate change on food production. As the regional economy developed, nutrients were focused on to ensure an adequate intake in the projected diet under BAU37. Regardless of the changing population, global CE demand would increase by 73.8% under BAU scenario relative to continuing the same dietary in 2018. Shifting toward healthy and sustainable diets could be essential for safeguarding the Earth’s natural resources and reducing diet-related mortality39,59. Healthy diets are dominated by low intake of animal products and high intake of plant-based nutrition like fruits, vegetables, legumes, nuts, and whole grains37,60. Compared to the situation in 2018, shifting toward the healthy and sustainable Flexitarian39 and EAT-Lancet61 diets would decrease global CE demand in by 15% and 9%, respectively. Such food demand decrease would help partially offset the negative impacts of climate change and population growth on food security. Shifts towards plant-based diets may also include cultivation of oilseeds, legumes, grains, and tubers, and this may have implications for soil carbon storage19. In the integrated assessment of the projected food demand change caused by dietary changes with the food supply change caused by climate change, the two sustainable diets (Flexitarian and EAT-Lancet) dominated by higher intakes of plant-based nutrition and lower intakes of animal products could mitigate the food security threats with 42% and 35% of the global population, respectively. Sustainable diets mean less environmental impact62,63 through reducing the greenhouse gas emissions and water footprint37,40,62,64, which may cause an interaction between climate and dietary patterns.

Food security relies on the balance between food production (supply side) and food needs (demand side)65. Our study addresses the impact of climate change on food security while also considering dietary changes. Previous studies on dietary changes and climate change have primarily focused on the reduction of GHG emissions to mitigate climate change41. Our pioneering global scale analyses revealed that dietary changes greatly affected food demand and hence played a vital role for food security. However, some limitations remain in our assessments. First, food waste accounts for 29% of the total cost64,66 and has a substantial effect on the food demand67 in the current diet, which was not considered in our study. Reducing food loss and waste would not only improve agri-food systems and help achieve food security, food safety, and food quality but also contribute significantly to the reduction of GHG emissions, as well as pressure on land and water resources. Second, although the panel model has been widely used to depict the impact of climate change on food security, it does not consider the role of prices and markets. Changes in the balance between food supply and demand can also affect prices and the international food market, subsequently influencing food trade, affordability, and overall food security68. Third, demand data is sourced from the Global Dietary Database (GDD), and supply data is sourced from FAOSTAT. However, these two sources measure different aspects: GDD presents global intake information using food consumption recall surveys, while FAOSTAT uses a food balance approach. The differences between these data sources may increase uncertainties and affect comparability. To address the limitations, we used CE instead of calories or monetary measures in the analyses because a) on calorie from meat requires more resources to produce than one calorie from cereals does; b) the use of monetary values is hindered by exchange rate issues, and many countries either lack relevant price data or include service and convenience cost factors (which are not related to the basic resource use) in the price data69. In addition, the relative effects of climate change on food supply and dietary change on food demand were evaluated by a panel model and the data process, instead of the absolute values.

Methods

Data and processing

We focused on ten food categories in this study: cereals, fruits, pulses, starchy roots, nuts, vegetables, meat, eggs, dairy, and fish. For the study period of 1990–2018, we obtained country-level food supply data from FAOSTAT “Food Balances” (supply side) (FAO of the United Nations; http://www.fao.org/faostat/en/#data). The national export and import share data were used as the country-level trade situations from the World Integrated Trade Solution database (WITS) (https://wits.worldbank.org/CountryProfile/en/Country/). The agricultural water input and agricultural land data were from the AQASSTAT database (https://www.fao.org/aquastat/en/). We used the Global Dietary Database 2018 (GDD2018; https://www.globaldietarydatabase.org/) in grams per day to derive the country-level dietary pattern data (demand side) from 1990 to 201870. We acquired population data for both historical and future periods from the United Nations (https://population.un.org/wpp/Download/Standard/CSV/). We used the products of dietary patterns and populations for males and females in 22 age groups (Supplementary Table 2) to analyze differences in food demand. Based on the data availability on both supply and demand sides in 155 countries, we aggregated food into ten commodities: fruits, non-starchy vegetables, starchy roots, nuts (or seeds), pulses, grains, meat, fish, eggs, and dairy (Supplementary Table 3). Dietary patterns differ among countries and also among geographic districts within the same country28. Therefore, we divided the study countries (where income information is available) into four income levels as defined by the World Bank (https://datahelpdesk.worldbank.org/knowledgebase/articles/906519) and six geographic regions according to the FAOSTAT database (Supplementary Table 4).

Historical climate data from 1990 to 2018 were derived from NASA Power at the resolution of 0.5° × 0.625° (https://power.larc.nasa.gov/). Climate data during the future period of 2031–2060 were generated from six models of Coupled Model Intercomparison Project phase 6 (CMIP6, https://esgf-node.llnl.gov/projects/cmip6/), including INM-CM4-8, INM-CM5-0, MIROC6, MRI-ESM1-2-HR, MRI-ESM2-0, and NESM3. Two SSP-RCP scenarios were chosen to project the future climate change on food supply: SSP2-4.5, a “medium mitigation” middle-of-the-road pathway; and SSP5-8.5, a “no mitigation” high-emission pathway. For both historical and future climate data, climate conditions (annual mean temperature and annual precipitation) were calculated from the daily data. To represent the national climate conditions, we aggregated the mean grid-scale values in each country.

Cereal-equivalent coefficient

Land is the form of suitable soil and climate is considered to be a type of resource for producing crop- and animal food products, but their land-based resource efficiencies vary, and this was accounted for through the use of cereal equivalent (CE) coefficients. In this study, we therefore selected a resource-based CE measure67 to aggregate food supply and demand, which made it possible to compare the effects of climate change and dietary changes. We adopted the CE coefficients developed by Rask and Rask66,67 and converted all ten food categories into CE. CE coefficient for crop-based products is computed simply by matching their caloric content to those of an equal weight of cereals. CE coefficient for animal products is the quantity of feedstuff used to produce one unit of animal products in terms of the dietary energy equivalent of a unit of grain maize, considering not only grains consumed but also other types of feed such as protein supplements, forage (including pasture) and other feeds (Supplementary Table 5)71. Based on the FAOSTAT production database, we calculated the annual weighted mean of CE coefficient for the meat categories (i.e., bovine, mutton and goat, pigmeat, and poultry meat) in 1990 and 2018 (Supplementary Table 5).

Historical dietary changes impact on food demand

We calculated annual country-level food demand by multiplying the diet patterns per person per day with the national population and total days in the year (Eq. (1)). In this study, we assumed that climate change did not impact the dietary patterns and used CE demand to indicate the food demand. In 1990 and 2018, we converted all ten study food categories for different dietary patterns, males and females, and 22 age groups from GDD2018 to total CE consumption in the 155 study countries; we multiplied the CE per capita demand with the national population to obtain the national food demand.

$$F{D}_{j}={\sum}_{i=1}^{10}Die{t}_{ij}\times C{E}_{i}\times 365\times Po{p}_{j}$$
(1)

where FDj indicates the national food demand in country j; Dietij denotes the daily demand for food category i per person in country j, g d−1; CEi denotes CE coefficient of food category i; Popj denotes the population in country j.

To eliminate the effect of changing population on national food demand, we used Eq. (2) to assess the changes in food demand (%) in 2018 compared to 1990 that were attributable to dietary changes:

$$\Delta F{D}_{1990\_2018} =\frac{\big[{\sum}_{i,j,k}(Die{t}_{2018}\times Po{p}_{2018})-{\sum}_{i,j,k}(Die{t}_{1990}\times Po{p}_{1990})\big]\times 365-\big[{\sum}_{i,j,k}(Die{t}_{1990}\times Po{p}_{2018})-{\sum}_{i,j,k}(Die{t}_{1990}\times Po{p}_{1990})\big]\times 365}{{\sum}_{i,j,k}(Die{t}_{1990}\times Po{p}_{1990})\times 365}\times 100 \% \\ \, =\frac{\big[{\sum}_{i,j,k}(Die{t}_{2018}\times Po{p}_{2018})-{\sum}_{i,j,k}(Die{t}_{1990}\times Po{p}_{2018})\big]}{{\sum}_{i,j,k}(Die{t}_{1990}\times Po{p}_{1990})}\times 100 \% \\ \, =\frac{{\sum}_{i,j,k}\big[(Die{t}_{2018}-Die{t}_{1990})\times Po{p}_{2018}\big]}{{\sum}_{i,j,k}(Die{t}_{1990}\times Po{p}_{1990})}\times 100 \%$$
(2)

Historical impact of climate change on food supply

Based on the FAOSTAT “Food Balances” database from 1990 to 2018, we converted the national supply of the ten study food categories into CE.

$$F{P}_{j,t}={\sum}_{i=1}^{10}Pro{d}_{i,j,t}\times C{E}_{i}$$
(3)

where FPj,t indicates the national CE food supply in country j in year t; Prodi,j,t denotes the supply of food category i in country j in year t; CEi denotes CE coefficient of food category i.

As the CE food supply follows a log-normal distribution and its variance stays comparable in relative instead of absolute terms, we transform the CE food supply to log values to result in a more normally distributed variable3. Then, we build the panel model for the country-level CE food supply to estimate the effects of year-to-year climate variations (a country-specific quadratic trend) and international trade on CE food supply as follows:

$$log(F{P}_{j,t})={\alpha }_{1,j}t+{\alpha }_{2,j}{t}^{2}+countr{y}_{j,t}+\beta {X}_{j,t}+{\varepsilon }_{j,t}$$
(4)

where FPj,t indicates the national CE food supply in country j in year t; α1,jt + α2,jt2 indicates the country-specific quadratic trends; countryj,t is the country-specific fixed-effect with all time-invariant and country-specific factors. βXj,t is a set of explanatory variables potentially affecting FPj,t. Climate change impacts on feed (e.g., maize and soybean) outside a country can affect its livestock production due to the feed trade. Since feed trade impacts are primarily driven by economic and policy factors rather than climate change, we accounted for these impacts in the country-specific fixed effects (countryj,t).

In this study, we used a quadratic function of annual mean temperature (T) and annual precipitation (P) to characterize the potential nonlinear effect of temperature and precipitation. To account for the compensation effect of agricultural water input on temperature and water stress, the annual agricultural water input (AWI) was interacted with temperature and precipitation. At the country scale, international trade should also be considered in the assessment of food supply. Therefore, annual indices of export products share (EPS) and import products share (IPS) were included in the estimated model of the CE food supply (Eq. (5)). In addition, the panel model was also weighted by the country-level areas of agricultural land from AQASSTAT database.

$$\beta {X}_{j,t}= \,\, {\beta }_{1}{T}_{j,t}+{\beta }_{2}{T}_{j,t}^{2}+{\beta }_{3}{P}_{j,t}+{\beta }_{4}{P}_{j,t}^{2} \\ + \,{\beta }_{5}IP{S}_{j,t}+{\beta }_{6}EP{S}_{j,t}+{\beta }_{7}{T}_{j,t}\cdot AW{I}_{j,t}+{\beta }_{8}{P}_{j,t}\cdot AW{I}_{j,t}$$
(5)

To estimate the performance of our panel model, we conducted a cross-validation with 1000 bootstraps. Each time, 80% of country-year observations are randomly sampled as the training data to build the panel model (Eqs. (4) and (5)) while the remaining 20% country-year observations are used as test data. The comparison between predicted logarithm-transformed and observed CE food supply in the test data were shown in Supplementary Fig. 8.

We estimate best-fit parameters for (Eqs. (4) and (5)) with data during the historical period of 1990–2018. To compute the change country-level CE food supply due to climate change, we compared the mean of the differences in annual CE food supply with the only historical climate variables (T and P) from NASA Power database and other variables fixed in 1990.

Future dietary changes impact on food demand

To exclude the effect of population growth on food demand, we used the dietary pattern for the 22 age groups in 2018 and the projected population during the period of 2031–2060 to calculate the future global food demand (Eq. (1)). We calculated the change in global CE demand during the future period compared to 2018 that was due to population growth. We projected global food demand for the scenarios when the dietary pattern in 2018 was shifted toward eight widely focused diets: BAU, two classic local diets (Chinese Food Guide Pyramid and Mediterranean diet), three recommended diets (Global Dietary Guideline, National Recommended Diet by region, National Recommended Diet by income), and two sustainable diets (Flexitarian diet and EAT-Lancet diet). For the ten food categories, we converted the amount (g d−1) per person and into CE. The food reference quantities were from previously published studies: BAU, Global Dietary Guideline, and Flexitarian37, Mediterranean72, EAT-Lancet61. Reference values for Chinese Food Guide Pyramid are from Chinese Dietary Reference Intakes-Scientific Report (2021)73. Reference values for the national recommended diet in 37 nations were extracted from Behrens et al. 59, which were collected from the national organizations tasked with providing dietary advice. We averaged the reference values for the national recommended diet in 37 nations based on the income levels and geographic regions. National recommended diet information was absent in low-income countries, so we used the recommended diet in lower-middle-income countries instead. In the study diet scenarios, we scaled the recommended reference values in each age group based on the estimated energy need for 5-year age groups from USDA29 (Supplementary Table 6).

Future impact of climate change on food supply

We projected the future CE food supply with the panel model (Eqs. (4) and (5)) with the climate outputs from the six climate models in CMIP6 under SSP2-4.5 and SSP5-8.5 and other variables fixed in 1990. The six climate models were structurally independent in terms of their ocean and atmosphere model components. The estimated vector of coefficients during the historical period was used to project the future periods. To reduce uncertainties among the six models, we presented the mean values in the figures. We compared the differences between mean CE food supply during 2031–2060 and 1990–2018 which are exclusively caused by climate change with the assumption of no new adaptation between now and then or holding technology equivalent to current levels.