Introduction

Agriculture is an important part of the national economy, and the products of this sector are the basis of economic development and guarantee the survival of human beings (Sutherland et al. 2015). The effects of the agricultural sector are widespread and growing, but food production is currently weakening due to land degradation, water scarcity, and climate change (Olawuyi 2020; Lu et al. 2021). Furthermore, striking the proper balance between serving endless requirements and limited resources has resulted in a slew of environmental concerns and problems such as climate change, water scarcity, air pollution, and acid rain (Ikram et al. 2021). Almost half of the world’s vegetated land is used for agriculture, also agricultural activities and land use change account for a quarter of the annual greenhouse gases (GHGs) emissions (Searchinger et al. 2019). The role of the environment in economic development has always been important and has attracted the attention of researchers in developing and developed countries. The agricultural sector, including crops, livestock, fisheries, and forestry, plays an important role in the economic well-being of developing countries (Zafeiriou and Azam 2017). On the other hand, challenges such as rapid global population growth, increasing urbanization, changes in diets, traditional farming practices, limited agricultural lands, increasing fertilizer consumption, and climate change seem to have placed many constraints on the agricultural sector (Koondhar et al. 2021a). Forecasts indicate that if current consumption patterns continue, food, water, and energy demand for a population of 10 billion people will increase by 50, 80, and 60%, respectively, by 2050 (Olawuyi 2020; Lu et al. 2021).

As is the case in many developing countries, agriculture plays a significant role in the Iranian economy (Raeeni et al. 2019). More specifically, the agricultural sector accounts for 11.6% of GDP, 18% of employment, and about 20% of Iran’s nonoil exports (Central Bank of Iran. 2020). Also, the per capita carbon emissions of Iran’s agricultural sector have increased from 4193 kilotons in 1990 to 7823 kilotons in 2018 (International Energy Agency Report 2020). Electricity consumption in the agricultural sector accounts for 15.3% of total country consumption, and per capita energy consumption in Iran’s agricultural sector is 3.3 times that of the global average (Energy Balance Sheet. 2017). Furthermore, the average temperature change in Iran has increased from (− 0.05) Celsius in 1970 to (+ 1.6) Celsius in 2019, indicating that the country has become warmer (Food and Agriculture Organization of the United Nations. 2020). The population has likewise increased from 28 million in 1970 to over 84 million in 2020 (world bank, 2021). Iran, on the other hand, is considered one of the countries with low water resources due to its location in the world’s dry and semi-arid region. Iran’s average annual rainfall is roughly 251 mm, which is over one-third of the global average. Furthermore, the rate of evaporation of water resources in Iran is three times greater than the global average (Khatibi and Arjjumend 2019). Thus, despite tremendous increases in agricultural production, these statistics reveal that this sector has a number of issues, including increased environmental contamination, climate change, a lack of technology, a lack of water resources, and a rising population.

The inevitable increase in resource consumption to increase production in parallel with population growth leads to a decrease in environmental quality and depletion of resources. Therefore, there is an urgent need to implement efficient systems that move within the framework of sustainable development (Namany et al. 2019). Therefore, resource depletion and scarcity put increasing pressure on the “Nexus” of water-food-energy (Yi et al. 2020). In recent years, the water-energy-food nexus approach has received increasing attention in international policy, academic research, and other fields. The term “Nexus” was first used at the World Economic Forum in 2008, where global challenges to economic development were examined from the perspective of the food-energy-water nexus (Zhang et al. 2018). “Nexus” represents a systemic approach that seeks to optimize resource use by focusing on resource interdependence (Hoff 2011; Namany et al. 2019). The correlation between inputs, production, and environmental pollution of the present study is shown in Fig. 1.

Fig. 1
figure 1

Source: Authors

Production-energy-environment nexus.

The per capita production of agricultural products in Iran has increased from about 740 to 1500 kg during the years 1978–2019 with a growth of 103% (Ministry of Agricultural Jihad of Iran 2020). This statistic means an increase in the consumption of agricultural inputs and, naturally, an increase in environmental pollution. Therefore, increasing production, increasing energy consumption, and fertilizer, along with increasing temperature, have created many challenges for the agricultural sector. Figure 2 shows the production trend, energy consumption, fertilizer consumption, and CO2 emissions in Iran’s agricultural sector.

Fig. 2
figure 2

Trend of variables

Energy and fertilizer consumption in the agricultural sector, despite the positive impact on production, has also increased the environmental pollution caused by the consumption of inputs and, along with climate change, has created many challenges for the production sector and sustainable development in Iran. Therefore, it is very important to study the factors affecting the agricultural sector. In the past, research has been done on the subject of this paper, but studies have often relied on energy consumption or a few specific products. But a comprehensive study has not been done considering all the effective dimensions (production, energy, fertilizer, environment, and climate change). The present study will for the first time examine the effects of input consumption on agricultural production in the form of positive and negative shocks. The study of positive and negative shocks will be effective in determining the type of impact of inputs consumption and the existence of excess consumption. The use of a nonlinear approach in this field of research focusing on the nexus of resources in Iran will be done for the first time. Finally, the results of this research will help policymakers reform existing policies and change approaches.

Therefore, the purpose of this study is to fill the research gap on the issue under discussion, especially in Iran, and also provide policies for policymakers to reduce energy and fertilizer consumption and the effects of climate change in the agricultural sector and contribute to sustainable development. This study will probably help the existing literature to determine the effects of energy consumption, fertilizer consumption, and climate change on the production of Iran’s agricultural sector in the framework of the nexus approach. Examining the relationships between production, the environment, and inputs in the context of “Nexus” is a necessity, as its absence can lead to misleading results. For this purpose, the NARDL model will be used. The NARDL model is capable of identifying asymmetric and nonlinear effects in both the short and long term. Also, considering the importance of energy consumption and fertilizer consumption in agricultural production and environmental pollution, the exact causal relationship between the variables will be determined. The hypotheses of the present study are the following: (I) Energy consumption has a positive effect on Iran’s agricultural sector. (II) The negative effect of the energy consumption shock on agricultural production is significant. (III) The positive shock effect of fertilizer consumption on the agricultural sector is positive. (IV) Increasing the production of the agricultural sector leads to an increase in environmental pollution. This study is divided into the following sections:Section “Literature review”, in which the research literature and previous studies in three sections involved in (1. energy consumption- production-environment, 2. production-environment-climate change, and, 3. fertilizer consumption-production-environment) are collected to examine and find the research gap. Section “Methodology” provides information about the methodology and data and model information. The estimated results and discussion are available in the section “Results and discussion”. Section “Conclusion and policy implications” is the last part of the present study in which conclusions and policy recommendations will be presented.

Literature review

Energy consumption-production-environment

The agricultural sector plays a significant role in the global food system, thus identifying the effects of increased energy consumption on agricultural production provides an opportunity to prevent some environmental problems (Ali et al. 2019). It is undeniable that greenhouse gas emissions from industry, agriculture, and transportation are a significant contributors to global warming (Rehman et al. 2021). Agricultural production accounts for approximately 30% of global energy consumption, 92% of global water consumption, and more than 20% of global greenhouse gases emissions (Nie et al. 2019). Moving towards modern agriculture itself is a challenge for the environment. This, in addition to increasing carbon emissions due to increased energy and fertilizer consumption, also has a significant impact on agricultural production (Koondhar et al. 2021a). The importance of energy as one of the basic inputs in the growth process of the agricultural sector cannot be denied (Sebri and Abid 2012).

Furthermore, the agricultural sector is an energy-intensive industry that contributes significantly to climate change (Koondhar et al. 2020). As a result, reducing fossil fuel consumption in order to reduce greenhouse gas emissions improves environmental sustainability performance significantly (Jum’a et al. 2022). Agricultural production, on the one hand, produces 20 to 35% of the world’s greenhouse gases and, on the other hand, is a vital factor in meeting human food needs. Although agriculture has become increasingly efficient in terms of global greenhouse gases emissions, total greenhouse gases emissions from this sector continue to increase at a rate of about 1% per year. Therefore, the issue of how to ensure food security in the face of population growth and control of greenhouse gases emissions is an obvious and major challenge for the agricultural sector. (Fan et al. 2020). The agricultural sector is also one of the main consumers of energy resources. Increased use of energy inputs in agriculture has led to several environmental problems, including high consumption of nonrenewable energy sources, loss of biodiversity, and pollution of water resources by chemical fertilizers and pesticides (Yousefi et al. 2014). Because, on the one hand, energy, water, and land are all necessary resources for economic development. On the other hand, food production requires a significant quantity of water, land, energy, fertilizers, pesticides, agricultural equipment, and other inputs, all of which contribute to significant environmental impacts. Hence, resource management in a sustainable way and by balancing economic development and environmental pollution is a desirable thing (Li et al. 2019).

Energy consumption in the agricultural sector is done directly and indirectly. Direct energy consumption is mainly to supply energy to motor pumps as well as fuel for agricultural machinery. Indirect consumption also includes energy consumption in the process of producing consumer and intermediate inputs required by the agricultural sector, such as the production of fertilizers, and pesticides (Koondhar et al. 2020; Martinho. 2020). In addition to a significant increase in food production, energy consumption in agricultural production has also increased due to the use of machinery, fossil fuels, overuse of fertilizers, and pesticides (Koondhar et al. 2021a). Most agricultural equipment and tools use fossil fuels, and these are key factors in emitting greenhouse gases and increasing global warming (Ur Rahman et al. 2019). The literature on the use of energy in Iranian agriculture and its effects on the actual production of this sector is not rich. Some studies have revealed a long-term relationship between agricultural growth and energy consumption (Moghaddasi and Anoushe pour, 2016). Pishgar-Komleh et al. (2012) investigated the relationship between energy consumption, CO2 emissions, and potato production in Iran. The results showed that the effect of seeds, irrigation, fossil fuels, and chemical fertilizers on potato yield is positive. Khoshnevisan et al. (2014) examined the relationship between energy consumption, pollution emissions, and strawberry production in Iran and compared it in both open fields and greenhouses. The results showed that optimizing energy consumption will lead to a significant reduction in pollution emissions in crop production. Moghaddasi and Anoushe pour (2016) in a study examined the relationship between energy consumption and productivity of Iran’s agricultural sector and finally found that with increasing energy consumption, the productivity of the agricultural sector decreases. According to Ozturk (2017), increased energy poverty leads to a decline in agricultural value-added in African countries. Furthermore, increasing food poverty reduces CO2 emissions. Kardoni et al. (2018) examined energy consumption in Iranian cereal production and found that in the studied years 1365–1387, the energy consumption of cereal production has an upward trend, and this part is dependent on nonrenewable energy sources such as fossil fuels. Shabani and Shahnazi (2019) researched the relations between energy consumption, GDP, communication technology, and CO2 emissions in different economic sectors of Iran. They concluded that in the long run, energy consumption increases pollution emissions. It was also found that in the agricultural sector, there is unidirectional causality from energy production and consumption to CO2 emissions. Ziaabadi and Zare Mehrjerdi (2019) in examining the factors affecting energy consumption in Iran’s agricultural sector showed that with the increase in production in the agricultural sector, energy consumption has also increased. Raeeni et al. (2019) investigated the connection between energy consumption and the development of Iran’s agricultural sector using an econometric method and discovered that a 1% rise in energy consumption results in a 1.29% increase in the agriculture sector’s growth. Zhang et al. (2019) examined the relationship between agricultural growth, energy consumption, and CO2 emissions in China. The results of the causality test showed that there is bidirectional causality between the CO2 emissions and the economic growth in the short and long term. There is also a unidirectional causality relationship between agricultural energy consumption and carbon. Ali et al. (2019) examined the effects of energy consumption and environmental pollution on the agricultural production of India and Pakistan and found that in both countries, with increasing energy consumption, the level of environmental pollution such as acidification, CO2, and PO4 concentrations has increased. Koondhar et al. (2021a) investigated the nonlinear relationships of agricultural production, energy consumption, and pollution emissions in Pakistan. The nonlinear causality results showed that there is unidirectional causality from food production to energy consumption and CO2 emissions. Also, it is revealed that there is one-way causality from fertilizer application to food production. Also, NARDL model indicated that increasing energy and fertilizer has a decreasing effect on agricultural production. Using the dynamic ARDL approach, Koondhar et al. (2021c) argued that a 10% positive change in agricultural pollution emission decreased food production, while a 10% decrease in agricultural pollution emission increased food production. Furthermore, there is a one-way causality between food production and agricultural pollution emissions.

Production-environment-climate change

Climate change has had a significant impact on human survival and development. Economic development and excessive use of resources have also led to increased emissions of carbon dioxide and other greenhouse gases, exacerbating climate problems such as global warming (Zhang and Zhang. 2021). The agricultural sector is the most vulnerable to climate change due to its size and high sensitivity to climate parameters, and as a result, this issue leads to large and significant economic effects. On the other hand, the type of climate in the study area is effective in mitigating the effects of climate change on the agricultural sector (Mendelsohn. 2008; Malhi et al. 2021). The constant increase in CO2 emissions raises the temperature level and, in the long run, leads to fluctuations in weather conditions. The reason for paying more attention and focusing on CO2 is due to its effect on the potential of global warming and creating numerous problems in the field of human health and environmental sustainability. In South Asia, the effects of rising CO2 emissions on rising temperatures, unpredictable rainfall, severe weather, and rising sea levels are visible and continuing to increase. (Ikram et al. 2020). Therefore, mitigating the negative effects of climate change and the environmental consequences of economic growth is among the topics that have long been debated and is at the heart of governments’ development programs (Gurbuz et al. 2021).

While agriculture leads to global climate change by increasing greenhouse gases emissions, climate change is also affecting agricultural production through changes in crop growth, yield, and food quality. With the increasing concentration of CO2 in the atmosphere and global warming, the study of the impact of climate change on agricultural production and food security has become an important research topic (Bai et al. 2019). Thereby, rising temperatures and CO2 emissions can be a major challenge for farmers and have always been a significant threat to agriculture and food security (Yadav et al. 2021). Increasing the temperature has been shown to reduce yield, while increasing precipitation may offset or reduce the effect of increasing temperature (Malhi et al. 2021). The positive or negative effects of climate change, such as rising temperatures, changes in rainfall, and CO2 concentration, on agricultural performance, vary according to the type of crop, place of cultivation, and the rate of change of environmental and climatic parameters and adaptability (Karimi et al. 2018; Yadav et al. 2021). Numerous studies have considered the effects of climate change on the agricultural sector to be negative, and the majority of these studies has studied one or more crops. But few studies have concluded that the effects of climate change are positive. Wang et al. (2009) in their study of the effects of temperature changes on China’s agricultural sector concluded that global warming is harmful to rain-fed fields and beneficial to irrigated fields. The negative effects will be mild at first, but the damage will increase over time. The effects also vary by region. Ray et al. (2019) investigated the effects of climate change on selected agricultural products on different continents. The results showed that the effects of climate change in Europe, South Africa, and Australia are negative but generally positive in Latin America. Climate effects in Asia, North, and Central America are also negative for some crops and positive for others. Zhang et al. (2021) studied and predicted the effects of climate change and increasing CO2 concentrations on major crops in China’s agricultural sector. Under different climatic scenarios (temperature increase and precipitation changes), it was determined that the yield of the main crops would remain stable until 2050 or even increase slightly throughout China. Koondhar et al. (2021d), by using a dynamic ARDL model in China, argued that in the short and long term, the 10% of positive and negative shock of carbon CO2 emission has no effect on agricultural economic growth.

Fertilizer consumption-production-environment

The world agricultural sector is dependent on fertilizers, and the demand for fertilizers for agricultural production in most countries is increasing due to modern and intensive farming systems. Over the period 1961–2019, global consumption of nitrate, phosphate, and potash fertilizers increased by 845, 299, and 334%, respectively (Food and Agriculture Organization of the United Nations 2020). Chemical fertilizers play an important role in increasing soil fertility and crop productivity. However, prolonged and excessive use of chemical fertilizers has reduced the content of soil organic matter, reduced the quality of agricultural soil, and even increased soil acidification and environmental pollution (Ning et al. 2017; Simonne et al. 2017). In general, farmers believe that more fertilizer consumption equals higher yields, which cannot be too far from the truth (Prabakaran et al. 2018). However, long-term and inappropriate use of chemical fertilizers reduces soil quality and increases soil degradation and environmental effects (Patnaik 2010). Increasing agricultural production has negative effects on the environment and can contaminate ecosystems and damage plants and animals while upsetting the balance of the food chain. Fertilizers also increase soil fertility and productivity by providing essential plant nutrients; therefore, they have a significant contribution to the economic production of products. On the other hand, food production in proportion to population growth, without increasing resource use or environmental degradation, is a necessity (Aziz et al. 2015).

Methodology

Data

According to the objectives of the present study, based on the study of the relationship between production energy and environment in Iran’s agricultural sector, the variables of production (LPRD), energy consumption (LENR), per capita fertilizer consumption in agriculture (FRL), carbon dioxide emissions (LCO2), and the average annual temperature change (CLM) during the years (1961–2019) have been used. In the production sector of the agricultural sector (LPRD), the sum of the production of the main agricultural and horticultural products was used. The fertilizer application (FRL) variable was obtained from the sum of the per capita consumption of three fertilizers: nitrogen, phosphate, and potash. For the carbon dioxide emission variable (LCO2), the sum of the pollution emissions from the use of various chemical fertilizers and various energy sources was obtained. For climate change (CLM), the proxy of average temperature changes in Iran was used. All variables are collected from the Food and Agriculture Organization of the United Nations (FAO). In order to investigate the relationships of the mentioned variables, the nonlinear autoregressive distributed lags (NARDL) approach has been used, which will be examined in detail in the following (Fig. 3).

Fig. 3
figure 3

Source: Authors

Conceptual framework.

Model specification

Shin et al. introduced nonlinear autoregressive distributed lags (Shin et al. 2014). The NARDL model is a developed variant of the ARDL approach of Pesaran and Smith (2001). The basic ARDL model does not account for the potential of independent variable changes influencing the dependent variable. While the NARDL model displays not only the positive or negative changes in the explanatory variables but also the changes in the dependent variable and allows for the estimate of cointegration in a single equation, additionally, this model is very adaptable and does not need the same degree of integration for all variables (Koondhar et al. 2021a). Some studies in economics, energy, and the environment have employed the NARDL method, including Baz et al. (2019), Munir and Riaz (2019) and Rahman and Ahmad (2019), Ur Rahman et al. (2019), Ullah et al. (2020b), and Koondhar et al. (2021a). The variables in this model may be I(0), I(1), or a mix of the two. The NARDL model is capable of identifying asymmetric and nonlinear effects in both the short and long term (Ullah et al. 2020a). Also, this approach allows us to discover a variety of connections involving positive or negative changes by decomposing explanatory variables into the sum of positive and negative relative changes (Li et al. 2020). According to Shin et al. (2014), the following is the long-term asymmetric equilibrium relationship:

$$yt={\beta }^{+}{x}_{t}^{+}+{\beta }^{-}{x}_{t}^{-}+{\varepsilon }_{t}$$
(1)

β+ and β represent the asymmetry parameters in the long run. yt is a dependent variable and x is a k ˟ 1 vector of independent variables.

$$xt={x}_{0}+{x}_{t}^{+}+{x}_{t}^{-}$$
(2)

xt and xt+ are the partial sum of positive and negative changes in xt that can be expanded as follows:

$${x}_{j}^{+}=\sum\limits_{j=1}^{t}\Delta {x}_{j}^{+}=max\left({x}_{j},0\right)$$
(3)
$${x}_{j}^{-}=\sum\limits_{j=1}^{t}\Delta {x}_{j}^{-}=min\left({x}_{j},0\right)$$
(4)

Shin et al. (2014) combined Eq. (1) and the ARDL model (p, q) in the unbound state to present the asymmetric error correction model as follows (Li et al. 2020):

$$\Delta yt={a}_{0}+{ry}_{t-1}+{\theta }^{+}{x}_{t-1}^{+}+{\theta }^{-}{x}_{t-1}^{-}+\sum\limits_{j=1}^{p-1}{l}_{j}\Delta {y}_{t-j}+\sum\limits_{j=0}^{q-1}{\left({\pi }_{j}^{+}\Delta {x}_{t-j}^{+}+{\pi }_{j}^{-}\Delta {x}_{t-j}^{-}\right)}^{-}$$
(5)

The Eq. (5) can be used to specify the asymmetric relationship between xt and yt. , indicating the degree of the short-run asymmetric dynamics of and long-run asymmetric coefficients of xt. Therefore, the NARDL model in the present study is the developed model from the studies of Ullah et al. (2020a) and Koondhar et al. (2021a), which is as follows:

$$\begin{array}{c}\Delta \mathrm{LPRD}={a}_{0}+{\mathrm{rLPRD}}_{t-1}+{\omega }^{+}\mathrm{LEN}{R}_{t-1}+{\omega }^{-}\mathrm{LEN}{R}_{t-1}+{\varphi }^{+}{\mathrm{FRL}}_{t-1}+{\varphi }^{+}{\mathrm{FRL}}_{t-1}+{\lambda }^{+}\mathrm{LCO}{2}_{t-1}\\ +{\lambda }^{-}LCO{2}_{t-1}+{\tau }^{+}{\mathrm{CLM}}_{t-1}+{\tau }^{-}{\mathrm{CLM}}_{t-1}+\sum\limits_{j=1}^{p-1}{n}_{j}\Delta {\mathrm{LPRD}}_{t-j}\\ \begin{array}{c}+\sum\limits_{j=0}^{q-1}\left({\theta }_{j}^{+}\Delta {\mathrm{LENR}}_{t-j}^{+}+{\theta }_{j}^{-}\Delta {\mathrm{LENR}}_{t-j}^{-}\right)+\sum\limits_{j=0}^{q-1}\left({\delta }_{j}^{+}\Delta {\mathrm{FRL}}_{t-j}^{+}+{\delta }_{j}^{-}\Delta {\mathrm{FRL}}_{t-j}^{-}\right)\\ +\sum\limits_{j=0}^{q-1}\left({\upsilon }_{j}^{+}\Delta LCO{2}_{t-j}^{+}+{\upsilon }_{j}^{-}\Delta LCO{2}_{t-j}^{-}\right)+\sum\limits_{j=0}^{q-1}\left({\varrho }_{j}^{+}\Delta CL{M}_{t-j}^{+}+{\varrho }_{j}^{-}\Delta CL{M}_{t-j}^{-}\right)\end{array}\end{array}$$
(6)

The nj, θj, , and are the short-run coefficients, and r, , , and are the long-run coefficients. LPRD is the amount of agricultural production, LENR is the energy consumption of the agricultural sector, FRL is the per capita consumption of fertilizer, LCO2 is the amount of carbon dioxide emissions of the agricultural sector, and CLM is the average temperature change in the country as a proxy for climate change. Also, LPRD+, LENR+, FRL+, LCO2+, and CLM+ are the partial cumulative sums of the positive changes of the mentioned variables, and LPRD, LENR, FRL, LCO2, and CLM are the partial cumulative sums of the negative changes of the variables.

In the NARDL model, it must be ensured that none of the variables are I(2) (Baz et al. 2019). In the present study, Kwiatkowski, Phillips, Schmidt, and Shin (KPSS) and Phillips and Peron (PP) tests were used to evaluating the stationarity of the variables. In common unit root tests, such as the augmented Dickey-Fuller and the Philips-Prone, the null hypothesis of the test is the existence of a unit root. But in the KPSS test, the null hypothesis is the absence of a unit root (Shin and Schmidt 1992). Also, in the present study, due to the importance of structural breaks in examining the unit roots of variables, the Lee-Strazicich test with two endogenous structural breaks has been used to investigate Stationarity (Lee and Strazicich 1999).

Results and discussions

Unit root test with and without structural break

The results of the KPSS and PP unit root tests are presented in Table 1. According to the table and according to the computational statistics and their comparison with critical values, production variables (LPRD), energy consumption (LENR), per capita fertilizer consumption (FRL), and LCO2 emissions are nonstationary at the level of 95%. Only the temperature variable (CLM) is stationary at this level. Therefore, the variables LPRD, LENR, FRL, and LCO2 are I(1), and the CLM is I(0).

Table 1 Kwiatkowski, Phillips, Schmidt, and Shin (KPSS) and Phillips and Peron (PP) stationarity test results

The results of the Lee-Strazicich unit root test with two structural breaks are presented in Table 2. As the results of the unit root test without structural breaks, the variables LPRD, LENR, FRL, and LCO2 are I(1), and the CLM is I(0). For the LPRD variable, two breaks in 1981 and 2007 are shown. Examining the data, it was found that in 1981, the decline in production occurred due to the outbreak of war, and due to related problems, the production of the agricultural sector decreased. In 2007, according to studies, the implementation of some policies in the agricultural sector, such as the development plan for mechanization of the agricultural sector, waste reduction, and reasonable prices for guaranteed purchase of products, led to increased production in the agricultural sector. The LENR variable shows the years 1978 and 1980 as breakpoints, which represent two important events of the revolution and the beginning of the imposed war. The break years of the FRL and LCO2 were similar and occurred in 2005, 2006, and 2010. Examining the trend of data related to these variables, it was found that in 2005 and 2006, the per capita fertilizer consumption increased, followed by the spread of pollution, and in 2010, with the decrease in per capita fertilizer consumption due to the increase in its price, the emission decreased.

Table 2 Structural breaks unit root test (Lee-Starzicich) results

BDS test

Now we need to determine with a test whether the nonlinear test can be used. The applicability of the BDSFootnote 1 test (1996) requires the use of time intervals in data assessment (Zeraibi et al. 2020). The BDS analysis indicated that the time sequence included a nonlinear interplay. According to the results of Table 3, the null hypothesis of the BDS test can be rejected. This indicates that the residuals are identically and independently distributed. Therefore, a dynamic asymmetric framework like the NADL model must be applied to consider the nonlinear relationships between variables.

Table 3 BDS test results

Diagnostics tests

Diagnostic tests have been conducted to determine whether the model is functional or not. The results from the diagnostic tests indicate the correct functional form. Because the Ramsey test’s prob is greater than 0.05. Also, there is no indication of serial correlation and heteroscedasticity, because the probability of Breusch-Godfrey serial correlation LM test and Breusch-Pagan-Godfrey test are less than 0.05. The results of the diagnostic test are indicated in Table 4.

Table 4 Diagnostic tests

Short-run NARDL

Short-term results are presented in Table 5. The positive shock of energy consumption in the short term with a coefficient of (0.07) has a positive effect on production in the agricultural sector. Negative energy shock is also insignificant. The positive and negative shock coefficients of carbon dioxide emissions are insignificant. The positive shock of fertilizer application with a coefficient of 0.005 had a negative effect on production. But the effect of negative shock on production is positive with a coefficient of 0.003. This result indicates that part of the fertilizer consumed is not a real need of the agricultural sector, and even by reducing consumption, production can be increased. Finally, the positive shock of temperature changes with a coefficient (0.05) has a positive effect on production. But the negative shock had a negative effect on production. Another important point in the table of short-term coefficients is the error correction model (ECM), the sign of which is expected (negative) and is also statistically confirmed. A negative coefficient smaller than one indicates that short-term imbalances move towards equilibrium in the long run. Since the data used in this study is annual, it can be said that 65% of the imbalance disappears each year, and the process of adjusting the shocks takes about 2 years.

Table 5 NARDL short-run estimation results

According to the results of the asymmetric short-term effects test in Table 6, the null hypothesis for the variables of energy consumption and fertilizer consumption has been rejected, and the pollution emission has been confirmed. In other words, the effects of negative and positive shocks to energy consumption and fertilizer consumption will be asymmetrical.

Table 6 Test to check short-run asymmetries

Long-run NARDL

The results of long-term estimates are presented in Table 7. The effect of positive and negative energy shocks on agricultural production is significant. According to the obtained coefficients, with a 1% increase in energy consumption, the production rate increases by 0.1. This result is consistent with Moghaddasi and Anoushe pour (2016), Raeeni et al. (2019), and Koondhar et al. (2021d). Also, with a 1% reduction in energy consumption, production would increase by 0.78%. Comparison of positive and negative shock coefficients shows that the effect of negative shock is greater than the effect of positive shock on energy consumption. This finding is in line with research of Koondhar et al. (2021a). This result demonstrates that by reducing energy usage, agricultural production can be boosted. In other words, the agricultural industry consumes far too much energy. According to statistics, Iran’s agricultural sector consumes nearly three times the global average in terms of energy consumption per capita (Energy Balance Sheet 2017). The positive shock of CO2 emission has a negative effect, and the negative shock of CO2 emission has a positive effect on production, but the positive shock is insignificant. By reducing pollution by 1%, production goes up by 1.8%. This finding is in line with the research of Koondhar et al. (2021c). The negative shock of fertilizer consumption is insignificant. With an increase of one unit in fertilizer consumption, the production rate increases by 0.005 units. This finding is consistent with the research of Parhizkari and Sabuhi (2014) and Rehman et al. (2019). This result demonstrates that, in addition to having a significant impact on production, fertilizer consumption has a significant environmental impact due to energy consumption in fertilizer production and distribution. As a result, agricultural policies can play an important role in reducing pollution levels in the environment. Positive and negative shocks from temperature changes are significant, and with one unit of increase and decrease in temperature changes, the amount of production increases and decreases by 0.06 and 0.12, respectively. This result is consistent with those of Ray et al. (2019) and Zhang et al. (2021). Comparison of positive and negative shock coefficients of temperature changes shows that the effect of negative shock was greater than positive shock. Climate change has always been considered as a factor affecting the agricultural sector, and various indicators have been used in research. When the positive and negative shock coefficients of temperature changes are compared, it is clear that the negative shock has a greater effect than the positive shock.

Table 7 NARDL long-run estimation results

According to the results of the asymmetric effects test in the long run in Table 8, the null hypothesis for the variables of energy consumption and fertilizer consumption has been rejected and has been confirmed for CO2 emissions and temperature changes. In other words, the effects of negative and positive shocks on energy consumption and fertilizer consumption will not be different (symmetric), while the effects of negative and positive shocks on pollution emissions and temperature changes are asymmetric.

Table 8 Test to check long-run asymmetries

The cumulative sum (CUSUM) and cumulative sum square (CUSUMQ) are presented to evaluate the NARDL model stability in the short and long term. According to Fig. 4, the estimated model has stability. Because the trend line is between the lower and upper critical limits. In other words, the null hypothesis of the test is rejected at the 95% level, and the model has acceptable stability.

Fig. 4
figure 4

NARDL Cusum and Cusumq

Granger causality test in the frequency domain

While the Granger causality test is extensively employed in the literature, it does have significant drawbacks. Granger causality tests performed in the traditional manner compute a single test statistic over time. As a result, such tests are incapable of examining causality at varied frequencies. However, Geweke (1982) devised the Wald test procedure, which imposes linear constraints on coefficient parameters to determine Granger causality over a given frequency range. Breitung and Candelon (2006) have developed this approach (Aydin 2018). The results of the causality test between the dependent variable (production) and the explanatory variables (energy consumption, carbon dioxide emissions, temperature changes, and fertilizer consumption) are presented in the form of Fig. 5. In this causality test, the type of relationships can be determined in terms of frequency, short term, medium term, and long term. In this way, the frequencies of 2.5, 1.5, and 0.5 show short-term, medium-term, and long-term relationships, respectively. In other words, frequency 0.5 indicates stable causality, and frequency 2.5 indicates temporary causality. There is no causality relationship from production to carbon dioxide emissions (a). But there is a short-term and medium-term unidirectional causality from carbon dioxide emissions to production (b). There is a bidirectional causality relationship between energy consumption and production (c, d) which is in line with Kargar Dehbidi and Tarazkar. (2020). In fact, at the level of 90%, there is a medium-term and long-term causality from energy consumption to production, and a short-term and long-term causality can be observed from production to energy consumption. There is a unidirectional causality relationship from fertilizer consumption to production in the short and long term (e). This finding is in line with the research of Koondhar et al. (2021a). There is no causality from production to fertilizer consumption (f). There is also a unidirectional causality between production and climate change in the long run and short run (h).

Fig. 5
figure 5

Granger causality test in the frequency domain

Conclusion and policy implications

The purpose of this study was to investigate the relationship between production, energy consumption, and the environment in the context of nexus in Iran during 1961–2019 using the NARDL model and frequency domain causality. The results showed that the effect of a negative energy consumption shock is greater than that of a positive energy consumption shock according to long-term results. Also, it was found that in Iran there is a two-way causal relationship between energy consumption and agricultural production. The agricultural sector’s environmental dimension is very important because of the significant consumption of fossil fuels consumption and the high consumption of chemical fertilizers and pesticides. The fertilizer use effects showed that a positive shock has an increasing effect on production. There is also a unidirectional causality between fertilizer consumption to agricultural production. The impact of CO2 emissions’ negative shock on agricultural production is positive. From CO2 emissions to production, there is also a unidirectional causality. As a result, when the sources of carbon dioxide production are also reduced, carbon dioxide emissions are reduced. Also, the positive shock effect of temperature changes was positive, while the negative shock effect was negative, according to the findings. Based on the findings of this study, the following policies and recommendations are presented in the context of achieving sustainable development.

I. Cheap energy prices, on the other hand, have always been one of the issues, as well as one of the main causes of high agricultural consumption and a refusal to cut energy consumption (Yousefi et al. 2014; Ziaabadi and Zare Mehrjerdi 2019). Reforming energy prices, investing in agricultural mechanization, transitioning to renewable energy consumption, and selecting cultivars suitable for different regions of the country are all important policies that will reduce energy and chemical fertilizer consumption, pollution, and increase productivity. II. Policymakers should be considered the use of organic fertilizers. Organic fertilizers have the potential to minimize the usage of chemical fertilizers, which contribute significantly to agricultural carbon emissions. Furthermore, organic fertilizer derived from agricultural waste recycling improves soil fertility while reducing soil degradation (Koondhar et al. 2020, Koondhar et al. 2021b). To promote the use of organic fertilizers, agricultural specialists must first determine the right cultivars for cultivation, as well as the plant’s genuine requirement for inputs such as fertilizers and water for traditional farmers, based on the region’s climatic and irrigation conditions. Farmers must also be educated on the benefits of organic fertilizers in terms of production and environmental effectiveness, and they must be made available at a fair cost. As a protectionist policy, the government may contemplate higher purchase prices for organic products than for products fed with chemical fertilizers. III. In general, the impact of climate change on agricultural performance varies depending on the type of crop, location of cultivation, and rate of change of environmental and climatic parameters, as well as adabptability. As a result, future research can study the effects of climate change on a regional scale, employing single or many products to acquire more precise results. In general, the impact of climate change on agricultural performance varies according to crop type, cultivation site, and pace of change of environmental and climatic parameters, as well as adaptability. IV. Green growth is also one of the very good answers to the environmental crisis, as it helps to deliver maximum advantages to the population while achieving long-term economic growth (Barbier 2016; Abid et al. 2021). It is advised that policymakers in the production sector, particularly in Iran, consider the green growth strategy as a successful technique of maintaining resource sustainability and minimizing environmental pollution within the context of sustainable development. V. In recent years, the agricultural sector’s production in Iran has expanded dramatically, resulting in a number of environmental catastrophes such as groundwater depletion, soil erosion, and other comparable occurrences. This suggests that in the agricultural sector, the climatic conditions of the producing area, ecological capacity, soil recovery ability, and water resources have all been disregarded. Maintaining productivity while minimizing the agricultural sector’s sensitivity to climate change will be a major problem for Iran’s long-term development under existing resource and input use patterns. As a result, if specialists and researchers do not undertake a one-dimensional and thorough examination of the many dimensions in the agricultural sector (production, allocation, and best use of resources and the environment), the problems will increase.

We faced data restrictions at the provincial level in our investigation. Furthermore, aggregate data for several crucial variables, such as water consumption, were unavailable. As a result, in future research with a nexus focus, the dimensions of water consumption, population, climate change, and other significant elements can be entered and studied in the model. Furthermore, the topic of this paper can be investigated at the provincial or regional levels. To assess the exact status of energy consumption and pollution in the agricultural sector, the issue can also be investigated independently by kind of energy. Finally, the nexus issue can be investigated for other economic sectors, such as industry.