diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff-check.yml similarity index 89% rename from .github/workflows/ruff.yml rename to .github/workflows/ruff-check.yml index 4403aab8..d6f49207 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff-check.yml @@ -1,4 +1,4 @@ -name: Ruff +name: Ruff check on: [push, pull_request] jobs: ruff: diff --git a/.github/workflows/ruff-format.yml b/.github/workflows/ruff-format.yml new file mode 100644 index 00000000..3a5f2a17 --- /dev/null +++ b/.github/workflows/ruff-format.yml @@ -0,0 +1,10 @@ +name: Ruff format +on: [push, pull_request] +jobs: + ruff: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: chartboost/ruff-action@v1 + with: + args: 'format --check' \ No newline at end of file diff --git a/docs/ODD/ODD_protocol.md b/docs/ODD/ODD_protocol.md index 4e5aca8c..f3bbb734 100644 --- a/docs/ODD/ODD_protocol.md +++ b/docs/ODD/ODD_protocol.md @@ -1,4 +1,4 @@ -ODD+D protocol. Based on the protocol by Müller et al. (2013) +ODD+D protocol. Based on the protocol by @muller2013describing # Overview @@ -6,7 +6,7 @@ ODD+D protocol. Based on the protocol by Müller et al. (2013) ### 1.1.1 What is the purpose of the study? -The purpose of the study is to analyze dynamic drought risk over consecutive droughts. To do so, we use the Geographical, Environmental, and Behavioral model GEB (De Bruijn et al., 2023) . The model includes adaptive behavior of heterogeneous farmer agents that changes in response to varying hydroclimatic and socioeconomic conditions, while in turn also affecting those socio-hydrological conditions. The study is performed in the Bhima basin, India. +The purpose of the study is to analyze dynamic drought risk over consecutive droughts. To do so, we use the Geographical, Environmental, and Behavioral model GEB [@debruijn2023geb]. The model includes adaptive behavior of heterogeneous farmer agents that changes in response to varying hydroclimatic and socioeconomic conditions, while in turn also affecting those socio-hydrological conditions. The study is performed in the Bhima basin, India. ### 1.1.2 For whom is the model designed? @@ -16,7 +16,7 @@ The model is designed for scientists and practitioners, particularly those inter ### 1.2.1 What kinds of entities are in the model? -GEB includes an agent-based model (ABM) that governs the behavior of farmers and their interaction with the water cycle, as well as reservoir operators who manage water outflow from reservoirs. The ABM is coupled with a hydrological model Community Water Model (CWatM) that simulates the water cycle, availability and demand from non-agricultural sectors (e.g., domestic, energy, industry and livestock). Additionally, CWatM and the ABM are coupled to MODFLOW, which simulates the subsurface hydrology. For a full overview of CWatM and MODFLOW see (Burek et al., 2020) and (Langevin et al., 2017). +GEB includes an agent-based model (ABM) that governs the behavior of farmers and their interaction with the water cycle, as well as reservoir operators who manage water outflow from reservoirs. The ABM is coupled with a hydrological model Community Water Model (CWatM) that simulates the water cycle, availability and demand from non-agricultural sectors (e.g., domestic, energy, industry and livestock). Additionally, CWatM and the ABM are coupled to MODFLOW, which simulates the subsurface hydrology. For a full overview of CWatM and MODFLOW see @burek2020development and @langevin2017documentation. ### 1.2.2. By what attributes (i.e. state variables and parameters) are these entities characterized? @@ -27,14 +27,14 @@ GEB includes an agent-based model (ABM) that governs the behavior of farmers and | **Farm size** | How large their farm size is. | Classes are: 'Below 0.5' acres, '0.5-1.0', '1.0-2.0', '2.0-3.0', '3.0-4.0', '4.0-5.0', '5.0-7.5', '7.5-10.0', '10.0-20.0', '20.0 & ABOVE'. Size is randomly generated based on class. | | **Groundwater levels** | How far below the ground the groundwater is situated. (m) below ground | Determined by MODFLOW, CWatM and groundwater extractions | | **Irrigation class** | Whether farmer has used most irrigation water from groundwater, river channel or reservoirs | | -| **Crop rotation** | Which crops the farmer are cultivating during the Kharif, Rabi and Summer seasons | Initially determined based on the Indian Agricultural Census and Indian Human Development Survey (see de Bruijn et al., 2023) | +| **Crop rotation** | Which crops the farmer are cultivating during the Kharif, Rabi and Summer seasons | Initially determined based on the Indian Agricultural Census and Indian Human Development Survey (see @debruijn2023geb) | | **Past yearly yield ratios** | Array of past 20 years of average yield ratio over all seasons where farmer cultivated crops. (-) | Determined by eq. 10 sect | | **Past yearly potential and actual incomes** | Array of past 20 years of potential (if no water shortage) and actual (with water shortage, determined by yield ratio) income after selling crops. (Rs) | Determined by the crop, yield ratio and market prices | | **Past yearly drought probabilities** | Array of past 20 years of average Standardized Precipitation Evapotranspiration Index (SPEI) of all harvests. (-) | ~ +2 to -2 | | **Yearly costs / outstanding loan payments and durations** | Yearly loan amount that farmers have to pay and how long they have to pay it for. Consists of agricultural input loans, microcredit loans and adaptation loans. | Determined by crop choice, past crop failures and well adaptation decisions | | **Social parameters** | See sect. 2.1.4 | | -| **$\sigma$** | Risk aversion | See sect. 2.1.3 Mean: 0.02; STD: 0.82. (Just & Lybbert, 2009) | -| **r** | Discount rate | See sect. 2.1.3 Mean: 0.159; STD: 0.193. (Bauer et al., 2012) | +| **$\sigma$** | Risk aversion | See sect. 2.1.3 Mean: 0.02; STD: 0.82. [@just2009risk] | +| **r** | Discount rate | See sect. 2.1.3 Mean: 0.159; STD: 0.193. [@bauer2012behavioral] | | **r** | Annual interest rate (%), coupled to land size classes. | 16, 11.5, 10, 7.75, 6.5, 6.5, 6.5, 5, 3, 3 | | **Risk perception** | | | | **$\beta$** | Risk perception | See sect. 1.3.1 for calculation | @@ -60,11 +60,11 @@ Table 1 Attributes and their values of farmer agents in GEB. “Min” and “ma Table 2 Reservoir operator agents attributes and their values in GEB -CWatM and MODFLOW attributes. This table shows only the calibrated attributes. Full hydrological settings can be found in the CwatM.ini file on Zenodo (Kalthof & De Bruijn, 2024). +CWatM and MODFLOW attributes. This table shows only the calibrated attributes. Full hydrological settings can be found in the CwatM.ini file on Zenodo [@kalthof_2024_11071746]. | Variable / Parameter | Definition, unit | Value / range | |-------------------------------------------------|--------------------------------------------------------|----------------| -| **Hydrological parameters (CWATM)** | (Burek et al., 2020; De Bruijn et al., 2023) | | +| **Hydrological parameters (CWATM)** | [@burek2020development; @debruijn2023geb] | | | **SnowMeltCoef*** | Snow melt coefficient. *not calibrated as no snow in study area | 0.004 | | **arnoBeta_add** | | 0.14 | | **factor_interflow** | | 0.76 | @@ -81,17 +81,17 @@ Table 3 Calibrated CWatM attributes and their final values in GEB ### 1.2.3. What are the exogenous factors / drivers of the model? -The forcing data consisted of Precipitation (kg/m²/s), Surface Downwelling Longwave Radiation (W/m²), Surface Downwelling Shortwave Radiation (W/m²), Relative Humidity at Surface (%, hurs), Surface Pressure (Pa, ps), Surface Wind Speed (m/s), Near-Surface Air Temperature (K), Daily Maximum Near-Surface Air Temperature (K), Daily Minimum Near-Surface Air Temperature (K) and Wind Speed (m/s). This data was sourced from the CHELSA-W5E5 v1.0 observational climate input data at 30 arcsec horizontal and daily temporal resolution (Karger et al., 2022). +The forcing data consisted of Precipitation (kg/m²/s), Surface Downwelling Longwave Radiation (W/m²), Surface Downwelling Shortwave Radiation (W/m²), Relative Humidity at Surface (%, hurs), Surface Pressure [@baddeley2010herding], Surface Wind Speed (m/s), Near-Surface Air Temperature (K), Daily Maximum Near-Surface Air Temperature (K), Daily Minimum Near-Surface Air Temperature (K) and Wind Speed (m/s). This data was sourced from the CHELSA-W5E5 v1.0 observational climate input data at 30 arcsec horizontal and daily temporal resolution [@karger2023chelsa]. -The routing was determined by identifying the outlet of the Upper Bhima basin and taking all upstream cells of it from the MERIT Hydro elevation map (Yamazaki et al., 2019), upscaled to 30'' (Eilander et al., 2021). Routing maps for river slope and width were also obtained in a similar manner (Eilander et al., 2020). Reservoir and lake footprints came from the HydroLAKES dataset (Messager et al., 2016). Where available, data on flood cushions and reservoir volumes were sourced from the Andhra Pradesh WRIMS database (https://apwrims.ap.gov.in/, last accessed on 7 September 2021). Land cover was determined from the land cover data of Jun et al. (2014). +The routing was determined by identifying the outlet of the Upper Bhima basin and taking all upstream cells of it from the MERIT Hydro elevation map [@yamazaki2019merit], upscaled to 30'' [@eilander2021hydrography]. Routing maps for river slope and width were also obtained in a similar manner [@eilander2021hydrography]. Reservoir and lake footprints came from the HydroLAKES dataset [@messager2016estimating]. Where available, data on flood cushions and reservoir volumes were sourced from the Andhra Pradesh WRIMS database (https://apwrims.ap.gov.in/, last accessed on 7 September 2021). Land cover was determined from the land cover data of @chen2018globeland30. -Historical water demand is taken from CWatM and consists of domestic, industry and livestock demand following the method of Wada et al. (2011). +Historical water demand is taken from CWatM and consists of domestic, industry and livestock demand following the method of @wada2011modelling. -Crop cultivation costs are sourced from the Ministry of Agriculture and Farmers Welfare in Rupees (Rs) per hectare (https://eands.dacnet. Nic.in/Cost_of_Cultivation.htm, last access: 15 July 2022) (De Bruijn et al., 2023). Historical monthly crop market sell prices are sourced from Agmarknet (https://agmarknet.gov.in, last accessed on 27 July 2022) (De Bruijn et al., 2023) in Rupees (Rs) per kg. +Crop cultivation costs are sourced from the Ministry of Agriculture and Farmers Welfare in Rupees (Rs) per hectare ([https://eands.dacnet. Nic.in/Cost_of_Cultivation.htm](https://eands.da.gov.in/Cost_of_Cultivation.htm), last access: 15 July 2022) [@debruijn2023geb]. Historical monthly crop market sell prices are sourced from Agmarknet (https://agmarknet.gov.in, last accessed on 27 July 2022) [@debruijn2023geb] in Rupees (Rs) per kg. ### 1.2.4. If applicable, how is space included in the model? -Each field of a farmer is simulated as a single Hydrological Response Unit (HRU) (De Bruijn et al., 2023). The HRUs are dynamically sized based on the land ownership / field size of each farmer and are independently operated by each agent. This means that land management decisions such as crop rotation, planting dates and irrigation, along with soil processes like percolation, capillary rise, and evaporation, are independently simulated within a HRU for each farmer. This allows for the simulation of multiple independently operated farms within a single grid cell of CWatM (De Bruijn et al., 2023). The smallest HRU is at 30 m x 30 m, which is the resolution of the smallest cell of the land cover map. +Each field of a farmer is simulated as a single Hydrological Response Unit (HRU) [@debruijn2023geb]. The HRUs are dynamically sized based on the land ownership / field size of each farmer and are independently operated by each agent. This means that land management decisions such as crop rotation, planting dates and irrigation, along with soil processes like percolation, capillary rise, and evaporation, are independently simulated within a HRU for each farmer. This allows for the simulation of multiple independently operated farms within a single grid cell of CWatM [@debruijn2023geb]. The smallest HRU is at 30 m x 30 m, which is the resolution of the smallest cell of the land cover map. While vertical hydrological processes like infiltration and percolation are modeled within the HRUs, river discharge and groundwater flow are handled at the grid cell level of 30'' grid size. This requires converting fluxes from HRUs to grid cells. Runoff is calculated for each HRU, aggregated based on their sizes, and then integrated into the grid cell's discharge calculations. @@ -109,9 +109,9 @@ Daily timestep: CWatM simulates all daily hydrological processes depending on, e ![image of model overview](images/model_overview.svg) -Figure 1 Overview of model actions, taken from De Bruijn et al. (2023). The government and NGO agents do not affect the model in this paper. +Figure 1 Overview of model actions, taken from @debruijn2023geb. The government and NGO agents do not affect the model in this paper. -Farmers grow pearl millet, groundnut, sorghum, paddy rice, sugar cane, wheat, cotton, chickpea, maize, green gram, finger millet, sunflower and red gram. Each crop undergoes four growth stages (d1 to d4). The crop coefficient (Kc) is then calculated as follows (Fischer et al., 2021): +Farmers grow pearl millet, groundnut, sorghum, paddy rice, sugar cane, wheat, cotton, chickpea, maize, green gram, finger millet, sunflower and red gram. Each crop undergoes four growth stages (d1 to d4). The crop coefficient (Kc) is then calculated as follows [@fischer2021global]: $$ Kc_t = @@ -123,7 +123,7 @@ Kc_t = \end{cases} $$ -where t represents the number of days since planting, and d1 to d4 are the durations of each growth stage. Each crop has their own set of these parameters. At the harvest stage, the actual yield (Ya) is determined based on a maximum reference yield (Yr; Siebert & Döll, 2010), the water-stress reduction factor (KyT), and the ratio of actual evapotranspiration (AET) to potential evapotranspiration (PET) throughout the growth period (Fischer et al., 2021): +where t represents the number of days since planting, and d1 to d4 are the durations of each growth stage. Each crop has their own set of these parameters. At the harvest stage, the actual yield (Ya) is determined based on a maximum reference yield (Yr; @siebert2010quantifying), the water-stress reduction factor (KyT), and the ratio of actual evapotranspiration (AET) to potential evapotranspiration (PET) throughout the growth period [@fischer2021global]: $$ Y_a = Y_r \times \left( 1 - KyT \times \left( 1 - \frac{\sum_{t=0}^{t=h} \text{AET}_t}{\sum_{t=0}^{t=h} \text{PET}_t} \right) \right) @@ -153,21 +153,21 @@ The modelling approach in GEB is based on a quantitative socio-hydrology framewo ### 2.1.2 On what assumptions is/are the agents’ decision model(s) based? -Agents are boundedly rational and use the subjective expected utility (SEUT) (Savage, 1954) to choose between actions they can take. They are further influenced by the adaptive choices of their neighbors, or “imitation” (source) and by elements of prospect theory (Kahneman & Tversky, 2013; Neto et al., 2023). +Agents are boundedly rational and use the subjective expected utility (SEUT) [@savage1954foundations] to choose between actions they can take. They are further influenced by the adaptive choices of their neighbors, or “imitation” (source) and by elements of prospect theory [@kahneman2013prospect; @ribeiro2023hess]. ### 2.1.3 Why are certain decision models chosen? -The SEUT builds on the EUT (Von Neumann & Morgenstern, 1947), by incorporating the concept of "bounded rationality", where agents remain rational utility maximizers but base their decisions on subjective estimates of drought probability. Their subjective estimates overestimate probabilities following a drought and underestimate probabilities after periods of no drought. Such boundedly rational behavior, observed in reality (Aerts et al., 2018; Kunreuther, 1996), aligns more closely with actual adaptation behavior than fully rational models (Haer et al., 2020; Wens et al., 2020). As the model’s application interest is in consecutive (drought) events, this behavioral theory fit our research goals best. +The SEUT builds on the EUT [@von1947theory], by incorporating the concept of "bounded rationality", where agents remain rational utility maximizers but base their decisions on subjective estimates of drought probability. Their subjective estimates overestimate probabilities following a drought and underestimate probabilities after periods of no drought. Such boundedly rational behavior, observed in reality [@aerts2018integrating; @kunreuther1996mitigating], aligns more closely with actual adaptation behavior than fully rational models [@haer2020safe; @wens2020simulating]. As the model’s application interest is in consecutive (drought) events, this behavioral theory fit our research goals best. -However, literature indicates that human adaptive behavior is also influenced by social factors (Baddeley, 2010; Haer et al., 2016). Thus, agents also make decisions influenced by the (earlier) adaptive decisions and behavior of their neighbors. Lastly, farmers do not necessarily experience a meteorological drought as a drought, but experience drought when they experience crop loss, which is a factor of the meteorological drought, crop choice and irrigation capabilities (Van Loon et al., 2016). Furthermore, farmers also do not judge crop loss as a drought based on whether they have achieved the theoretical maximum yield if they never achieve this. Thus, we set that they only experience a drought if they have a loss against their expected gain or reference point, i.e., if the last 5 years they had on average 60% of total yield, they will experience loss if it is below this 60%. This is based on how people experience loss which is described by elements of prospect theory (Kahneman & Tversky, 2013; Neto et al., 2023). The moving reference point can change based on farmer’s changed situation, e.g., if the farmer now uses irrigation and gets higher yields, if there has not been a drought for some time or if there has been a drought for a longer time (Neto et al., 2023) and yields were higher or if the farmer now has more drought resistant crops. +However, literature indicates that human adaptive behavior is also influenced by social factors [@baddeley2010herding; @haer2016effectiveness]. Thus, agents also make decisions influenced by the (earlier) adaptive decisions and behavior of their neighbors. Lastly, farmers do not necessarily experience a meteorological drought as a drought, but experience drought when they experience crop loss, which is a factor of the meteorological drought, crop choice and irrigation capabilities [@van2016drought]. Furthermore, farmers also do not judge crop loss as a drought based on whether they have achieved the theoretical maximum yield if they never achieve this. Thus, we set that they only experience a drought if they have a loss against their expected gain or reference point, i.e., if the last 5 years they had on average 60% of total yield, they will experience loss if it is below this 60%. This is based on how people experience loss which is described by elements of prospect theory [@kahneman2013prospect; @ribeiro2023hess]. The moving reference point can change based on farmer’s changed situation, e.g., if the farmer now uses irrigation and gets higher yields, if there has not been a drought for some time or if there has been a drought for a longer time [@ribeiro2023hess] and yields were higher or if the farmer now has more drought resistant crops. ### 2.1.4 If the model / a submodel (e.g. the decision model) is based on empirical data, where does the data come from? -Agent initialization: To generate heterogeneous farmer plots and agents with characteristics statistically similar to those observed within the Bhima basin, factors from the India Human Development Survey (IHDS, Desai et al., 2008), such as agricultural net income, farm size, irrigation type or household size, were combined with Agricultural census data (Department of Agriculture & Farmers Welfare India, 2001). For this, we use the iterative proportional fitting algorithm, which reweights IHDS survey data such that it fits the distribution of crop types, farm sizes and irrigation status at sub-district level reported in the Agricultural Census (De Bruijn et al., 2023). The farmer agents and their plots were randomly distributed over their respective sub-districts on land designated as agricultural land (Jun et al., 2014) at 1.5² resolution (50 meter at the equator). There were a total of 1432923 agents. The number of agents remained constant over the simulation period. +Agent initialization: To generate heterogeneous farmer plots and agents with characteristics statistically similar to those observed within the Bhima basin, factors from the India Human Development Survey (IHDS), such as agricultural net income, farm size, irrigation type or household size, were combined with Agricultural census data. For this, we use the iterative proportional fitting algorithm, which reweights IHDS survey data such that it fits the distribution of crop types, farm sizes and irrigation status at sub-district level reported in the Agricultural Census [@debruijn2023geb]. The farmer agents and their plots were randomly distributed over their respective sub-districts on land designated as agricultural land [@chen2018globeland30] at 1.5² resolution (50 meter at the equator). There were a total of 1432923 agents. The number of agents remained constant over the simulation period. -Risk aversion & discount rate: To set risk aversion and discount rate, we first normalized the distribution of agricultural net income. Then, as risk aversion and discount rate correlate with household income (Bauer et al., 2012; Just & Lybbert, 2009; Maertens et al., 2014), we rescaled the normalized income distribution with the mean and standard deviation of the (marginal) risk aversion (0.02, 0.82; Just & Lybbert, 2009) and discount rate r (0.159, 0.193; Bauer et al.2012) of Indian farmers. Noise was added to both to prevent that each present-biased agent is also risk taking by definition. +Risk aversion & discount rate: To set risk aversion and discount rate, we first normalized the distribution of agricultural net income. Then, as risk aversion and discount rate correlate with household income [@bauer2012behavioral; @just2009risk; @maertens2014farmers], we rescaled the normalized income distribution with the mean and standard deviation of the (marginal) risk aversion (0.02, 0.82; @just2009risk) and discount rate r (0.159, 0.193; @bauer2012behavioral) of Indian farmers. Noise was added to both to prevent that each present-biased agent is also risk taking by definition. -Interest rates: To account for the variation in access to credit and interest rates among farmers, we assigned each agent an interest rate based on their total landholding size, with smaller farmers receiving higher and larger farmers lower rates (Table 4, Maertens et al., 2014; P. D. Udmale et al., 2015). This is based on the interest rates observed among Indian farmers (Hoda & Terway, 2015; Udmale et al., 2015). The average for all farmers comes out at approximately 10.6%, near the observed 10.7% of (Udmale et al., 2015). Below is the table relating landholding size to interest rate: +Interest rates: To account for the variation in access to credit and interest rates among farmers, we assigned each agent an interest rate based on their total landholding size, with smaller farmers receiving higher and larger farmers lower rates (Table 4, @maertens2014farmers; @udmale2015did). This is based on the interest rates observed among Indian farmers [@hoda2015credit; @udmale2015did]. The average for all farmers comes out at approximately 10.6%, near the observed 10.7% of [@udmale2015did]. Below is the table relating landholding size to interest rate: | Size class (ha) | < 0.5 | 0.5-1.0 | 1.0-2.0 | 2.0-3.0 | 3.0-4.0 | 4.0-5.0 | 5.0-7.5 | 7.5-10.0 | 10.0-20.0 | > 20.0 | |--------------------|-------|---------|---------|---------|---------|---------|---------|-----------|------------|--------| @@ -179,13 +179,13 @@ Table 4 Interest rates per landholding size Figure 3 Distributions of the farm sizes, risk aversion, discount and interest rates. -Calibration: We calibrated the model from 2001 to 2010 using observed daily discharge data and yield data. The daily discharge data was obtained from 5 discharge stations at various locations in the Bhima Basin from India-WRIS (https://indiawris.gov.in/wris/#/) . The yield data was obtained by dividing the total production by the total cropped area from (ICRISAT, 2015) to determine yield in tons per hectare. This figure was then divided by the reference maximum yield in tons per hectare to calculate the percentage of maximum yield. +Calibration: We calibrated the model from 2001 to 2010 using observed daily discharge data and yield data. The daily discharge data was obtained from 5 discharge stations at various locations in the Bhima Basin from India-WRIS (https://indiawris.gov.in/wris/#/). The yield data was obtained by dividing the total production by the total cropped area from the ICRISAT meso-level database to determine yield in tons per hectare. This figure was then divided by the reference maximum yield in tons per hectare to calculate the percentage of maximum yield. -Crop market prices: Cultivation costs which include expenses such as purchasing seeds, manure, and labor are sourced from the Ministry of Agriculture and Farmers Welfare in Rupees (Rs) per hectare (https://eands.dacnet. Nic.in/Cost_of_Cultivation.htm, last access: 15 July 2022) (De Bruijn et al., 2023). Historical monthly market prices are sourced from Agmarknet (https://agmarknet.gov.in, last accessed on 27 July 2022) (De Bruijn et al., 2023) in Rupees (Rs) per kg. +Crop market prices: Cultivation costs which include expenses such as purchasing seeds, manure, and labor are sourced from the Ministry of Agriculture and Farmers Welfare in Rupees (Rs) per hectare (https://eands.dacnet. Nic.in/Cost_of_Cultivation.htm, last access: 15 July 2022) [@debruijn2023geb]. Historical monthly market prices are sourced from Agmarknet (https://agmarknet.gov.in, last accessed on 27 July 2022) [@debruijn2023geb] in Rupees (Rs) per kg. ### 2.1.5 At which level of aggregation were the data available? -The IHDS is reported at household level (Desai et al., 2008), the agricultural census data available at the sub-district level (Department of Agriculture & Farmers Welfare India, 2001) and the ICRISAT meso-level database are available at the sub-district level yearly (ICRISAT, 2015). Just & Lybbert (2009) and Bauer et al. (2012) were field study experiments done at the village level in Maharastra and Karnataka, respectively. Interest rates were at the national level (Hoda & Terway, 2015). +The IHDS is reported at household level, the agricultural census data available at the sub-district level and the ICRISAT meso-level database are available at the sub-district level yearly. @just2009risk and @bauer2012behavioral were field study experiments done at the village level in Maharastra and Karnataka, respectively. Interest rates were at the national level [@hoda2015credit]. ## 2.2 Individual decision making @@ -295,7 +295,7 @@ The group of neighbors to which farmers compare the expected utility of their ow ### 2.7.1 Do the individuals form or belong to aggregations that affect, and are affected by, the individuals? Are these aggregations imposed by the modeller or do they emerge during the simulation? -For every farmer in the Bhima basin, we model one farmer agent (or “one-to-one” scale), thus there is no initial aggregation of agents. We do this first and foremost because we do not know what a representative agent for our area is (Page, 2012) and by pre-emptively aggregating agents, we may lose interactions that we were not aware existed in the first place (Page, 2012). This is especially true in an area as heterogeneous as the Bhima basin in India, where there are extreme differences in landholder size (Desai et al., 2008), which factor through in other agent attributes such as which crops they initially cultivate (Department of Agriculture & Farmers Welfare India, 2001), their access to credit or their social factors (Hoda & Terway, 2015; Maertens et al., 2014; Udmale et al., 2015). Aggregating while coupling to a hydrological model may also give additional issues. For example, without aggregation, if a small farmer HRU is next to a larger farmer HRU, but share the same modflow cell, they directly experience the additional groundwater decline as a result of the larger farmer extracting. If agents were aggregated and scaled, cells of groundwater would need to be crossed by the water before the decline affects each adjacent farmer. Furthermore, the idea of “representative individuals” is in itself disputed and aggregating agents, even if they are all rational utility maximizers, can lead to wrong conclusions (Axtell & Farmer, 2022; Kirman, 1992). Secondly, the vectorized design of GEB allows us to simulate more agents with only a relatively low increase in computational demand. Lastly, although it is not researched whether this has benefited the current analysis, the first step to determine the effects of aggregation is ensuring that modelling at the highest detail is possible. +For every farmer in the Bhima basin, we model one farmer agent (or “one-to-one” scale), thus there is no initial aggregation of agents. We do this first and foremost because we do not know what a representative agent for our area is [@bauer2012behavioral] and by pre-emptively aggregating agents, we may lose interactions that we were not aware existed in the first place [@bauer2012behavioral]. This is especially true in an area as heterogeneous as the Bhima basin in India, where there are extreme differences in landholder size, which factor through in other agent attributes such as which crops they initially cultivate, their access to credit or their social factors [@hoda2015credit; @maertens2014farmers; @udmale2015did]. Aggregating while coupling to a hydrological model may also give additional issues. For example, without aggregation, if a small farmer HRU is next to a larger farmer HRU, but share the same modflow cell, they directly experience the additional groundwater decline as a result of the larger farmer extracting. If agents were aggregated and scaled, cells of groundwater would need to be crossed by the water before the decline affects each adjacent farmer. Furthermore, the idea of “representative individuals” is in itself disputed and aggregating agents, even if they are all rational utility maximizers, can lead to wrong conclusions [@axtell2022agent; @kirman1992whom]. Secondly, the vectorized design of GEB allows us to simulate more agents with only a relatively low increase in computational demand. Lastly, although it is not researched whether this has benefited the current analysis, the first step to determine the effects of aggregation is ensuring that modelling at the highest detail is possible. During the model run, farmers are aggregated into groups that are similar in terms of well status, basin location and crop rotation. The yearly values of the drought probability and yield of those groups are averaged to determine the drought probability – yield relation. These aggregations are initially imposed by the modeler, but change throughout the simulation as agent’s well status and crop rotation changes. For comparing the expected utility of farmer’s current crop rotation and that of potential different farmer, neighboring farmers with similar irrigation status within a spatial radius of 1 km are searched, from which a random group of max 5 farmers is selected and the expected utilities are compared. @@ -321,7 +321,7 @@ When farmers who do not have a well are grouped based on similarity and check th When searching for neighbors with similar irrigation status (reservoir, channel or groundwater), a random selection of neighbors is taken from the found group each time. To account for stochasticity, the model had been run 60 times and the averages of these runs have been taken. -During initialization, the farmer agents and their plots are randomly distributed over their respective sub-districts on land designated as agricultural land, which is based on the maps of Jun et al. (2014). +During initialization, the farmer agents and their plots are randomly distributed over their respective sub-districts on land designated as agricultural land, which is based on the maps of @chen2018globeland30. ## 2.10 Observation @@ -339,11 +339,11 @@ Details ### 3.1.1 How has the model been implemented? -Python 3 is used to implement the model, incorporating compiled Python libraries like NumPy (Harris et al., 2020) and Numba (Lam et al., 2015) for computationally intensive parts. Additionally, it features optional GPU vectorization of soil components via CuPy. +Python 3 is used to implement the model, incorporating compiled Python libraries like NumPy [@harris2020array] and Numba [@lam2015numba] for computationally intensive parts. Additionally, it features optional GPU vectorization of soil components via CuPy. ### 3.1.2 Is the model accessible and if so where? -The most recent version of the GEB and adapted CWatM model, as well as scripts for data acquisition and model setup can be found on GitHub (github.com/GEB-model). The model inputs, parametrization and code used for this manuscript are accessible through Zenodo (Kalthof & De Bruijn, 2024). This page also includes the averages and standard deviations of the 60 runs of the adaptation and non-adaptation scenario which are featured in all figures. +The most recent version of the GEB and adapted CWatM model, as well as scripts for data acquisition and model setup can be found on [GitHub](https://github.com/GEB-model). The model inputs, parametrization and code used for this manuscript are accessible through Zenodo [@kalthof_2024_11071746]. This page also includes the averages and standard deviations of the 60 runs of the adaptation and non-adaptation scenario which are featured in all figures. ## 3.2 Initialization @@ -371,7 +371,7 @@ Yes, see section 1.2.3. ### 3.4.1 What, in detail, are the submodels that represent the processes listed in ‘Process overview and scheduling’? -For a full overview of CWatM and MODFLOW see (Burek et al., 2020) and (Langevin et al., 2017). +For a full overview of CWatM and MODFLOW see @burek2020development and @langevin2017documentation. The following submodels were not described yet in process overview and scheduling: @@ -488,75 +488,4 @@ $$ Table 5 Well cost parameters and their values in GEB -See table 1, 2, 3 and 4. - -Aerts, J. C. J. H., Botzen, W. J., Clarke, K. C., Cutter, S. L., Hall, J. W., Merz, B., Michel-Kerjan, E., Mysiak, J., Surminski, S., & Kunreuther, H. (2018). Integrating human behaviour dynamics into flood disaster risk assessment. Nature Climate Change, 8(3), 193–199. https://doi.org/10.1038/s41558-018-0085-1 - -Baddeley, M. (2010). Herding, social influence and economic decision-making: Socio-psychological and neuroscientific analyses. Philosophical Transactions of the Royal Society B: Biological Sciences, 365(1538), 281–290. https://doi.org/10.1098/rstb.2009.0169 - -Bauer, B. M., Chytilová, J., & Morduch, J. (2012). Behavioral Foundations of Microcredit : Experimental and Survey Evidence from Rural India Author ( s ): Michal Bauer , Julie Chytilová and Jonathan Morduch Source : The American Economic Review , APRIL 2012 , Vol . 102 , No . 2 ( APRIL 2012 ), pp . Publis. 102(2), 1118–1139. - -Burek, P., Satoh, Y., Kahil, T., Tang, T., Greve, P., Smilovic, M., Guillaumot, L., Zhao, F., & Wada, Y. (2020). Development of the Community Water Model (CWatM v1.04) - A high-resolution hydrological model for global and regional assessment of integrated water resources management. Geoscientific Model Development, 13(7), 3267–3298. https://doi.org/10.5194/gmd-13-3267-2020 - -De Bruijn, J. A., Smilovic, M., Burek, P., Guillaumot, L., Wada, Y., & Aerts, J. C. J. H. (2023). GEB v0. 1: a large-scale agent-based socio-hydrological model–simulating 10 million individual farming households in a fully distributed hydrological model. Geoscientific Model Development, 16(9), 2437–2454. - -Department of Agriculture & Farmers Welfare India. (2001). Agricultural Census India. National Informatics Centre (NIC)| Agriculture Census Division, DAC. agcensus1.da.gov.in - -Desai, S., Dubey, A., Joshi, B. L., Sen, M., Shariff, A., & Vanneman, R. (2008). India human development survey. College Park, Maryland: University of Maryland. https://doi.org/https://doi.org/10.3886 - -Eilander, D., Van Verseveld, W., Yamazaki, D., Weerts, A., Winsemius, H. C., & Ward, P. J. (2021). A hydrography upscaling method for scale-invariant parametrization of distributed hydrological models. Hydrology and Earth System Sciences, 25(9), 5287–5313. - -Eilander, D., Winsemius, H. C., Van Verseveld, W., Yamazaki, D., Weerts, A., & Ward, P. J. (2020). MERIT Hydro IHU, Zenodo [data set]. - -Fischer, G., Nachtergaele, F. O., Van Velthuizen, H. T., Chiozza, F., Franceschini, G., Henry, M., Muchoney, D., & Tramberend, S. (2021). Global agro-ecological zones v4–model documentation. Food & Agriculture Org. - -Haer, T., Botzen, W. J. W., & Aerts, J. C. J. H. (2016). The effectiveness of flood risk communication strategies and the influence of social networks-Insights from an agent-based model. Environmental Science and Policy, 60, 44–52. https://doi.org/10.1016/j.envsci.2016.03.006 - -Haer, T., Husby, T. G., Botzen, W. J. W., & Aerts, J. C. J. H. (2020). The safe development paradox: An agent-based model for flood risk under climate change in the European Union. Global Environmental Change, 60(December 2018), 102009. https://doi.org/10.1016/j.gloenvcha.2019.102009 - -Harris, C. R., Millman, K. J., Van Der Walt, S. J., Gommers, R., Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S., & Smith, N. J. (2020). Array programming with NumPy. Nature, 585(7825), 357–362. - -Hoda, A., & Terway, P. (2015). Credit policy for agriculture in India: An evaluation. Supporting Indian farms the smart way. Rationalising subsidies and investments for faster, inclusive and sustainable growth. Working Paper. - -ICRISAT. (2015). Meso level data for India: 1966-2011, collected and compiled under the project on Village Dynamics in South Asia. https://vdsa.icrisat.org/Include/document/all-apportioned-web-document.pdf - -Jun, C., Ban, Y., & Li, S. (2014). Open access to Earth land-cover map. Nature, 514(7523), 434. - -Just, D. R., & Lybbert, T. J. (2009). Risk averters that love risk? Marginal risk aversion in comparison to a reference gamble. American Journal of Agricultural Economics, 91(3), 612–626. https://doi.org/10.1111/j.1467-8276.2009.01273.x - -Kahneman, D., & Tversky, A. (2013). Prospect theory: An analysis of decision under risk. In Handbook of the fundamentals of financial decision making: Part I (pp. 99–127). World Scientific. - -Kalthof, M. W. M. L., & De Bruijn, J. (2024). Adaptive Behavior of Over a Million Individual  Farmers Under Consecutive Droughts: A Large-Scale Agent-Based Modeling Analysis in the Bhima Basin, India [Data set and Code]. Zenodo. https://doi.org/10.5281/zenodo.11071746 - -Kunreuther, H. (1996). Mitigating disaster losses through insurance. Journal of Risk and Uncertainty, 12, 171–187. - -Lam, S. K., Pitrou, A., & Seibert, S. (2015). Numba: A llvm-based python jit compiler. Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC, 1–6. - -Langevin, C. D., Hughes, J. D., Banta, E. R., Niswonger, R. G., Panday, S., & Provost, A. M. (2017). Documentation for the MODFLOW 6 Groundwater Flow Model. In Techniques and Methods. https://doi.org/10.3133/tm6A55 - -Maertens, A., Chari, A. V., & Just, D. R. (2014). Why farmers sometimes love risks: Evidence from India. Economic Development and Cultural Change, 62(2), 239–274. https://doi.org/10.1086/674028 - -Messager, M. L., Lehner, B., Grill, G., Nedeva, I., & Schmitt, O. (2016). Estimating the volume and age of water stored in global lakes using a geo-statistical approach. Nature Communications, 7(1), 13603. - -Müller, B., Bohn, F., Dreßler, G., Groeneveld, J., Klassert, C., Martin, R., Schlüter, M., Schulze, J., Weise, H., & Schwarz, N. (2013). Describing human decisions in agent-based models–ODD+ D, an extension of the ODD protocol. Environmental Modelling & Software, 48, 37–48. - -Neto, G. G. R., Kchouk, S., Melsen, L. A., Cavalcante, L., Walker, D. W., Dewulf, A., Costa, A. C., Martins, E. S. P. R., & Oel, P. R. Van. (2023). HESS Opinions : Drought impacts as failed prospects. 4217–4225. - -Page, S. E. (2012). Aggregation in agent-based models of economies. In Knowledge Engineering Review (Vol. 27, Issue 2, pp. 151–162). https://doi.org/10.1017/S0269888912000112 - -Savage, L. J. (1954). The foundations of statistics; jon wiley and sons. Inc.: New York, NY, USA. - -Siebert, S., & Döll, P. (2010). Quantifying blue and green virtual water contents in global crop production as well as potential production losses without irrigation. Journal of Hydrology, 384(3–4), 198–217. - -Udmale, P., Ichikawa, Y., Manandhar, S., Ishidaira, H., Kiem, A. S., Shaowei, N., & Panda, S. N. (2015). How did the 2012 drought affect rural livelihoods in vulnerable areas? Empirical evidence from India. International Journal of Disaster Risk Reduction, 13, 454–469. https://doi.org/10.1016/j.ijdrr.2015.08.002 - -Van Loon, A. F., Gleeson, T., Clark, J., Van Dijk, A. I. J. M., Stahl, K., Hannaford, J., Di Baldassarre, G., Teuling, A. J., Tallaksen, L. M., Uijlenhoet, R., Hannah, D. M., Sheffield, J., Svoboda, M., Verbeiren, B., Wagener, T., Rangecroft, S., Wanders, N., & Van Lanen, H. A. J. (2016). Drought in the Anthropocene. Nature Geoscience, 9(2), 89–91. https://doi.org/10.1038/ngeo2646 - -Von Neumann, J., & Morgenstern, O. (1947). Theory of games and economic behavior, 2nd rev. - -Wada, Y., Van Beek, L. P. H., & Bierkens, M. F. P. (2011). Modelling global water stress of the recent past: On the relative importance of trends in water demand and climate variability. Hydrology and Earth System Sciences, 15(12), 3785–3808. https://doi.org/10.5194/hess-15-3785-2011 - -Wens, M., Veldkamp, T. I. E., Mwangi, M., Johnson, J. M., Lasage, R., Haer, T., & Aerts, J. C. J. H. (2020). Simulating Small-Scale Agricultural Adaptation Decisions in Response to Drought Risk: An Empirical Agent-Based Model for Semi-Arid Kenya. Frontiers in Water, 2(July), 1–21. https://doi.org/10.3389/frwa.2020.00015 - -Yamazaki, D., Ikeshima, D., Sosa, J., Bates, P. D., Allen, G. H., & Pavelsky, T. M. (2019). MERIT Hydro: A High-Resolution Global Hydrography Map Based on Latest Topography Dataset. Water Resources Research, 55(6), 5053–5073. https://doi.org/10.1029/2019WR024873 - +# Bibliography \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index e3751727..5a2401a7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -37,6 +37,8 @@ "--pdf-engine=xelatex", "-V", "geometry:margin=1.0in", + "--citeproc", + "--bibliography=../references.bib", ], ) os.chdir("..") @@ -55,6 +57,7 @@ "sphinx_autodoc_typehints", "sphinxcontrib.autoprogram", "sphinxcontrib.autoyaml", + "sphinxcontrib.bibtex", ] # Add any paths that contain templates here, relative to this directory. @@ -76,6 +79,7 @@ napoleon_custom_sections = [("Returns", "params_style")] autoclass_content = "both" autoyaml_level = 3 +bibtex_bibfiles = ["references.bib"] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/docs/references.bib b/docs/references.bib new file mode 100644 index 00000000..2b69c949 --- /dev/null +++ b/docs/references.bib @@ -0,0 +1,370 @@ +@article{aerts2018integrating, + title={Integrating human behaviour dynamics into flood disaster risk assessment}, + author={Aerts, Jeroen CJH and Botzen, Wouter J and Clarke, Keith C and Cutter, Susan L and Hall, Jim W and Merz, Bruno and Michel-Kerjan, Erwann and Mysiak, Jaroslav and Surminski, Swenja and Kunreuther, Howard}, + journal={Nature Climate Change}, + volume={8}, + number={3}, + pages={193--199}, + year={2018}, + publisher={Nature Publishing Group UK London} +} + +@article{axtell2022agent, + title={Agent-based modeling in economics and finance: Past, present, and future}, + author={Axtell, Robert L and Farmer, J Doyne}, + journal={Journal of Economic Literature}, + pages={1--101}, + year={2022}, + publisher={American Economic Association} +} + +@article{baddeley2010herding, + title={Herding, social influence and economic decision-making: socio-psychological and neuroscientific analyses}, + author={Baddeley, Michelle}, + journal={Philosophical Transactions of the Royal Society B: Biological Sciences}, + volume={365}, + number={1538}, + pages={281--290}, + year={2010}, + publisher={The Royal Society} +} + +@article{bauer2012behavioral, + title={Behavioral foundations of microcredit: Experimental and survey evidence from rural India}, + author={Bauer, Michal and Chytilov{\'a}, Julie and Morduch, Jonathan}, + journal={American Economic Review}, + volume={102}, + number={2}, + pages={1118--1139}, + year={2012}, + publisher={American Economic Association} +} + +@article{burek2020development, + title={Development of the Community Water Model (CWatM v1. 04)--a high-resolution hydrological model for global and regional assessment of integrated water resources management}, + author={Burek, Peter and Satoh, Yusuke and Kahil, Taher and Tang, Ting and Greve, Peter and Smilovic, Mikhail and Guillaumot, Luca and Zhao, Fang and Wada, Yoshihide}, + journal={Geoscientific Model Development}, + volume={13}, + number={7}, + pages={3267--3298}, + year={2020}, + publisher={Copernicus Publications G{\"o}ttingen, Germany} +} + +@article{chen2018globeland30, + title={GlobeLand30: Operational global land cover mapping and big-data analysis}, + author={Chen, Jun and Chen, Jin}, + journal={Sci. China Earth Sci}, + volume={61}, + number={10}, + pages={1533--1534}, + year={2018} +} + +@article{debruijn2023geb, + title={GEB v0.1: a large-scale agent-based socio-hydrological model--simulating 10 million individual farming households in a fully distributed hydrological model}, + author={{de Bruijn}, Jens A and Smilovic, Mikhail and Burek, Peter and Guillaumot, Luca and Wada, Yoshihide and Aerts, Jeroen CJH}, + journal={Geoscientific Model Development}, + volume={16}, + number={9}, + pages={2437--2454}, + year={2023}, + publisher={Copernicus Publications G{\"o}ttingen, Germany} +} + +@article{eilander2021hydrography, + title={A hydrography upscaling method for scale-invariant parametrization of distributed hydrological models}, + author={Eilander, Dirk and Van Verseveld, Willem and Yamazaki, Dai and Weerts, Albrecht and Winsemius, Hessel C and Ward, Philip J}, + journal={Hydrology and Earth System Sciences}, + volume={25}, + number={9}, + pages={5287--5313}, + year={2021}, + publisher={Copernicus Publications G{\"o}ttingen, Germany} +} + +@misc{eilander_2023_7936280, + author = {Eilander, Dirk and + Winsemius, Hessel C. and + Van Verseveld, Willem and + Yamazaki, Dai and + Weerts, Albrecht and + Ward, Philip J.}, + title = {MERIT Hydro IHU}, + month = may, + year = 2023, + publisher = {Zenodo}, + version = {1.0}, + doi = {10.5281/zenodo.7936280}, + url = {https://doi.org/10.5281/zenodo.7936280} +} + +@book{fischer2021global, + title={Global agro-ecological zones v4--model documentation}, + author={Fischer, Gunther and Nachtergaele, FO and Van Velthuizen, HT and Chiozza, Federica and Franceschini, Gianluca and Henry, Matieu and Muchoney, Douglas and Tramberend, Sylvia}, + year={2021}, + publisher={Food \& Agriculture Org.} +} + +@article{haer2016effectiveness, + title={The effectiveness of flood risk communication strategies and the influence of social networks—Insights from an agent-based model}, + author={Haer, Toon and Botzen, WJ Wouter and Aerts, Jeroen CJH}, + journal={Environmental Science \& Policy}, + volume={60}, + pages={44--52}, + year={2016}, + publisher={Elsevier} +} + +@article{haer2020safe, + title={The safe development paradox: An agent-based model for flood risk under climate change in the European Union}, + author={Haer, Toon and Husby, Trond G and Botzen, WJ Wouter and Aerts, Jeroen CJH}, + journal={Global Environmental Change}, + volume={60}, + pages={102009}, + year={2020}, + publisher={Elsevier} +} + +@article{harris2020array, + title={Array programming with NumPy}, + author={Harris, Charles R and Millman, K Jarrod and Van Der Walt, St{\'e}fan J and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J and others}, + journal={Nature}, + volume={585}, + number={7825}, + pages={357--362}, + year={2020}, + publisher={Nature Publishing Group UK London} +} + +@techreport{hoda2015credit, + title={Credit policy for agriculture in India: An evaluation. Supporting Indian farms the smart way. Rationalising subsidies and investments for faster, inclusive and sustainable growth}, + author={Hoda, Anwarul and Terway, Prerna}, + year={2015}, + institution={Working Paper} +} + +@article{just2009risk, + title={Risk averters that love risk? Marginal risk aversion in comparison to a reference gamble}, + author={Just, David R and Lybbert, Travis J}, + journal={American Journal of Agricultural Economics}, + volume={91}, + number={3}, + pages={612--626}, + year={2009}, + publisher={Wiley Online Library} +} + +@incollection{kahneman2013prospect, + title={Prospect theory: An analysis of decision under risk}, + author={Kahneman, Daniel and Tversky, Amos}, + booktitle={Handbook of the fundamentals of financial decision making: Part I}, + pages={99--127}, + year={2013}, + publisher={World Scientific} +} + +@dataset{kalthof_2024_11071746, + author = {Kalthof, Maurice WML and + De Bruijn, Jens}, + title = {{Adaptive Behavior of Over a Million Individual + Farmers Under Consecutive Droughts: A Large-Scale + Agent-Based Modeling Analysis in the Bhima Basin, + India [Data set and Code]}}, + month = may, + year = 2024, + publisher = {Zenodo}, + version = 1, + doi = {10.5281/zenodo.11071746}, + url = {https://doi.org/10.5281/zenodo.11071746} +} + +@article{karger2023chelsa, + title={CHELSA-W5E5: Daily 1 km meteorological forcing data for climate impact studies}, + author={Karger, Dirk Nikolaus and Lange, Stefan and Hari, Chantal and Reyer, Christopher PO and Conrad, Olaf and Zimmermann, Niklaus E and Frieler, Katja}, + journal={Earth System Science Data}, + volume={15}, + number={6}, + pages={2445--2464}, + year={2023}, + publisher={Copernicus Publications G{\"o}ttingen, Germany} +} + +@article{kirman1992whom, + title={Whom or what does the representative individual represent?}, + author={Kirman, Alan P}, + journal={Journal of economic perspectives}, + volume={6}, + number={2}, + pages={117--136}, + year={1992}, + publisher={American Economic Association} +} + +@article{kunreuther1996mitigating, + title={Mitigating disaster losses through insurance}, + author={Kunreuther, Howard}, + journal={Journal of risk and Uncertainty}, + volume={12}, + pages={171--187}, + year={1996}, + publisher={Springer} +} + +@inproceedings{lam2015numba, + title={Numba: A llvm-based python jit compiler}, + author={Lam, Siu Kwan and Pitrou, Antoine and Seibert, Stanley}, + booktitle={Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC}, + pages={1--6}, + year={2015} +} + +@techreport{langevin2017documentation, + title={Documentation for the MODFLOW 6 groundwater flow model}, + author={Langevin, Christian D and Hughes, Joseph D and Banta, Edward R and Niswonger, Richard G and Panday, Sorab and Provost, Alden M}, + year={2017}, + institution={US Geological Survey} +} + +@article{maertens2014farmers, + title={Why farmers sometimes love risks: evidence from India}, + author={Maertens, Annemie and Chari, AV and Just, David R}, + journal={Economic Development and Cultural Change}, + volume={62}, + number={2}, + pages={239--274}, + year={2014}, + publisher={University of Chicago Press Chicago, IL} +} + +@article{messager2016estimating, + title={Estimating the volume and age of water stored in global lakes using a geo-statistical approach}, + author={Messager, Mathis Loïc and Lehner, Bernhard and Grill, G{\"u}nther and Nedeva, Irena and Schmitt, Oliver}, + journal={Nature communications}, + volume={7}, + number={1}, + pages={13603}, + year={2016}, + publisher={Nature Publishing Group UK London} +} + +@article{muller2013describing, + title={Describing human decisions in agent-based models--ODD+ D, an extension of the ODD protocol}, + author={M{\"u}ller, Birgit and Bohn, Friedrich and Dre{\ss}ler, Gunnar and Groeneveld, J{\"u}rgen and Klassert, Christian and Martin, Romina and Schl{\"u}ter, Maja and Schulze, Jule and Weise, Hanna and Schwarz, Nina}, + journal={Environmental Modelling \& Software}, + volume={48}, + pages={37--48}, + year={2013}, + publisher={Elsevier} +} + +@article{ribeiro2023hess, + title={HESS Opinions: Drought impacts as failed prospects}, + author={Ribeiro Neto, Germano G and Kchouk, Sarra and Melsen, Lieke A and Cavalcante, Louise and Walker, David W and Dewulf, Art and Costa, Alexandre C and Martins, Eduardo SPR and Van Oel, Pieter R}, + journal={Hydrology and Earth System Sciences Discussions}, + volume={2023}, + pages={1--11}, + year={2023}, + publisher={G{\"o}ttingen, Germany} +} + +@article{page2012aggregation, + title={Aggregation in agent-based models of economies}, + author={Page, Scott E}, + journal={The Knowledge Engineering Review}, + volume={27}, + number={2}, + pages={151--162}, + year={2012}, + publisher={Cambridge University Press} +} + +@article{savage1954foundations, +title = {The foundations of statistics. By Leonard J. Savage, John Wiley \& Sons, Inc., 1954, 294 pp}, +journal = {Naval Research Logistics Quarterly}, +volume = {1}, +number = {3}, +pages = {236-236}, +doi = {https://doi.org/10.1002/nav.3800010316}, +url = {https://onlinelibrary.wiley.com/doi/abs/10.1002/nav.3800010316}, +eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1002/nav.3800010316}, +year = {1954} +} + +@article{siebert2010quantifying, + title={Quantifying blue and green virtual water contents in global crop production as well as potential production losses without irrigation}, + author={Siebert, Stefan and D{\"o}ll, Petra}, + journal={Journal of Hydrology}, + volume={384}, + number={3-4}, + pages={198--217}, + year={2010}, + publisher={Elsevier} +} + +@article{udmale2015did, + title={How did the 2012 drought affect rural livelihoods in vulnerable areas? Empirical evidence from India}, + author={Udmale, Parmeshwar D and Ichikawa, Yutaka and Manandhar, Sujata and Ishidaira, Hiroshi and Kiem, Anthony S and Shaowei, Ning and Panda, Sudhindra N}, + journal={International Journal of Disaster Risk Reduction}, + volume={13}, + pages={454--469}, + year={2015}, + publisher={Elsevier} +} + +@article{van2016drought, + title={Drought in the Anthropocene}, + author={Van Loon, Anne F and Gleeson, Tom and Clark, Julian and Van Dijk, Albert IJM and Stahl, Kerstin and Hannaford, Jamie and Di Baldassarre, Giuliano and Teuling, Adriaan J and Tallaksen, Lena M and Uijlenhoet, Remko and others}, + journal={Nature Geoscience}, + volume={9}, + number={2}, + pages={89--91}, + year={2016}, + publisher={Nature Publishing Group UK London} +} + +@article{von1947theory, + title={Theory of games and economic behavior, 2nd rev}, + author={Von Neumann, John and Morgenstern, Oskar}, + year={1947}, + publisher={Princeton university press} +} + +@article{wada2011modelling, + title={Modelling global water stress of the recent past: on the relative importance of trends in water demand and climate variability}, + author={Wada, Yoshihide and van Beek, Ludovicus PH and Bierkens, Marc FP}, + journal={Hydrology and Earth System Sciences}, + volume={15}, + number={12}, + pages={3785--3808}, + year={2011}, + publisher={Copernicus Publications G{\"o}ttingen, Germany} +} + +@article{wens2020simulating, + title={Simulating small-scale agricultural adaptation decisions in response to drought risk: an empirical agent-based model for semi-arid Kenya}, + author={Wens, Marthe and Veldkamp, Ted IE and Mwangi, Moses and Johnson, J Michael and Lasage, Ralph and Haer, Toon and Aerts, Jeroen CJH}, + journal={Frontiers in water}, + volume={2}, + pages={15}, + year={2020}, + publisher={Frontiers Media SA} +} + +@article{yamazaki2019merit, + title={MERIT Hydro: A high-resolution global hydrography map based on latest topography dataset}, + author={Yamazaki, Dai and Ikeshima, Daiki and Sosa, Jeison and Bates, Paul D and Allen, George H and Pavelsky, Tamlin M}, + journal={Water Resources Research}, + volume={55}, + number={6}, + pages={5053--5073}, + year={2019}, + publisher={Wiley Online Library} +} + +@article{zanaga2022esa, + title={ESA WorldCover 10 m 2021 v200}, + author={Zanaga, Daniele and Van De Kerchove, Ruben and Daems, Dirk and De Keersmaecker, Wanda and Brockmann, Carsten and Kirches, Grit and Wevers, Jan and Cartus, Oliver and Santoro, Maurizio and Fritz, Steffen and others}, + year={2022}, + publisher={Zenodo} +} \ No newline at end of file diff --git a/examples/build.yml b/examples/build.yml index ad89e7f1..434904e3 100644 --- a/examples/build.yml +++ b/examples/build.yml @@ -76,13 +76,182 @@ setup_crop_prices: setup_population: setup_assets: - feature_types: buildings + feature_types: + - buildings + - roads + - rails -# setup_forcing: -# data_source: era5 -# starttime: 2000-01-01 -# endtime: 2023-12-31 +setup_damage_parameters: + parameters: + flood: + land_use: + forest: + curve: + - [0, 0] + - [0.1, 0.1] + - [0.25, 0.3] + - [0.50, 0.55] + - [1.00, 0.65] + - [1.50, 0.7] + - [2.00, 0.9] + - [2.50, 0.92] + - [3.00, 0.95] + - [4.00, 1.00] + - [5.00, 1.00] + maximum_damage: 10.79 + agriculture: + curve: + - [0, 0] + - [0.1, 0.1] + - [0.25, 0.3] + - [0.50, 0.55] + - [1.00, 0.65] + - [1.50, 0.7] + - [2.00, 0.9] + - [2.50, 0.92] + - [3.00, 0.95] + - [4.00, 1.00] + - [5.00, 1.00] + maximum_damage: 1.83 + buildings: + structure: + curve: + - [0, 0] + - [0.1, 0.27] + - [0.5, 0.35] + - [1, 0.37] + - [1.5, 0.42] + - [2, 0.45] + - [2.5, 0.47] + - [3, 0.5] + maximum_damage: 1806 + + content: + curve: + - [0, 0] + - [0.10, 0.5] + - [0.50, 0.55] + - [1.00, 0.6] + - [1.50, 0.65] + - [2.00, 0.67] + - [2.50, 0.7] + - [3.00, 0.72] + maximum_damage: 78787 + rail: + main: + curve: + - [0, 0] + - [0.05, 0.02] + - [0.20, 0.2] + - [1.40, 1] + - [6.00, 1] + maximum_damage: 7022 + road: + residential: + curve: + - [0, 0] + - [0.50, 0.015] + - [1.00, 0.025] + - [1.50, 0.03] + - [2.00, 0.035] + - [6.00, 0.05] + maximum_damage: 5 + unclassified: + curve: + - [0, 0] + - [0.50, 0.015] + - [1.00, 0.025] + - [1.50, 0.03] + - [2.00, 0.035] + - [6.00, 0.05] + maximum_damage: 5 + tertiary: + curve: + - [0, 0] + - [0.50, 0.015] + - [1.00, 0.025] + - [1.50, 0.03] + - [2.00, 0.035] + - [6.00, 0.05] + maximum_damage: 10 + primary: + curve: + - [0, 0] + - [0.50, 0.015] + - [1.00, 0.025] + - [1.50, 0.03] + - [2.00, 0.035] + - [6.00, 0.05] + maximum_damage: 50 + secondary: + curve: + - [0, 0] + - [0.50, 0.015] + - [1.00, 0.025] + - [1.50, 0.03] + - [2.00, 0.035] + - [6.00, 0.05] + maximum_damage: 25 + motorway: + curve: + - [0, 0] + - [0.50, 0.01] + - [1.00, 0.03] + - [1.50, 0.075] + - [2.00, 0.1] + - [6.00, 0.2] + maximum_damage: 4000 + motorway_link: + curve: + - [0, 0] + - [0.50, 0.01] + - [1.00, 0.03] + - [1.50, 0.075] + - [2.00, 0.1] + - [6.00, 0.2] + maximum_damage: 4000 + trunk: + curve: + - [0, 0] + - [0.50, 0.01] + - [1.00, 0.03] + - [1.50, 0.075] + - [2.00, 0.1] + - [6.00, 0.2] + maximum_damage: 1000 + trunk_link: + curve: + - [0, 0] + - [0.50, 0.01] + - [1.00, 0.03] + - [1.50, 0.075] + - [2.00, 0.1] + - [6.00, 0.2] + maximum_damage: 1000 + primary_link: + curve: + - [0, 0] + - [0.50, 0.015] + - [1.00, 0.025] + - [1.50, 0.03] + - [2.00, 0.035] + - [6.00, 0.05] + maximum_damage: 50 + secondary_link: + curve: + - [0, 0] + - [0.50, 0.015] + - [1.00, 0.025] + - [1.50, 0.03] + - [2.00, 0.035] + - [6.00, 0.05] + maximum_damage: 25 -# setup_SPEI: -# calibration_period_start: 2000-01-01 -# calibration_period_end: 2020-12-31 +setup_forcing: + data_source: era5 + starttime: 2000-01-01 + endtime: 2023-12-31 + +setup_SPEI: + calibration_period_start: 2000-01-01 + calibration_period_end: 2020-12-31 diff --git a/examples/model.yml b/examples/model.yml index 41be5158..d0116bde 100644 --- a/examples/model.yml +++ b/examples/model.yml @@ -1,6 +1,6 @@ -# The {GEB} prefix is a special prefix that is replaced by the path to the geb package. +# The {GEB_PACKAGE_DIR} prefix is a special prefix that is replaced by the path to the geb package. # You can also find the reasonable_defaults/model.yml file relative to this file. -inherits: "{GEB}/examples/reasonable_defaults/model.yml" +inherits: "{GEB_PACKAGE_DIR}/examples/reasonable_defaults/model.yml" ### # This section contains several general model settings. diff --git a/geb/agents/crop_farmers.py b/geb/agents/crop_farmers.py index 5c475874..23c18ece 100644 --- a/geb/agents/crop_farmers.py +++ b/geb/agents/crop_farmers.py @@ -254,10 +254,11 @@ def withdraw_channel( water_withdrawal_m: np.ndarray, remaining_irrigation_limit_m3: np.ndarray, channel_abstraction_m3_by_farmer: np.ndarray, + minimum_channel_storage_m3: float = 100, ): # channel abstraction channel_abstraction_cell_m3 = min( - available_channel_storage_m3[grid_cell], + max(available_channel_storage_m3[grid_cell] - minimum_channel_storage_m3, 0), irrigation_water_demand_field * cell_area[field], ) assert channel_abstraction_cell_m3 >= 0 @@ -424,7 +425,6 @@ def abstract_water( activation_order.size, dtype=np.float32 ) - has_access_to_irrigation_water = np.zeros(activation_order.size, dtype=np.bool_) for activated_farmer_index in range(activation_order.size): farmer = activation_order[activated_farmer_index] farmer_fields = get_farmer_HRUs(field_indices, field_indices_by_farmer, farmer) @@ -438,7 +438,6 @@ def abstract_water( continue # Determine whether farmer would have access to irrigation water this timestep. Regardless of whether the water is actually used. This is used for making investment decisions. - farmer_has_access_to_irrigation_water = False for field in farmer_fields: grid_cell = HRU_to_grid[field] @@ -459,10 +458,6 @@ def abstract_water( farmer_has_access_to_irrigation_water = True break - has_access_to_irrigation_water[activated_farmer_index] = ( - farmer_has_access_to_irrigation_water - ) - # Actual irrigation from surface, reservoir and groundwater # If farmer doesn't have access to irrigation water, skip the irrigation abstraction if farmer_has_access_to_irrigation_water: @@ -542,6 +537,7 @@ def abstract_water( irrigation_water_demand_field=irrigation_water_demand_field, remaining_irrigation_limit_m3=remaining_irrigation_limit_m3, channel_abstraction_m3_by_farmer=channel_abstraction_m3_by_farmer, + minimum_channel_storage_m3=100.0, ) assert water_withdrawal_m[field] >= 0 @@ -606,7 +602,6 @@ def abstract_water( water_consumption_m, returnFlowIrr_m, addtoevapotrans_m, - has_access_to_irrigation_water, ) @@ -1515,13 +1510,13 @@ def activation_order_by_elevation(self): # algorithm such that the random shuffling in the previous step is conserved # in groups with identical elevation. activation_order_shuffled = np.argsort(elevation_shuffled, kind="stable")[::-1] - argsort_agend_ids = agent_ids_shuffled[activation_order_shuffled] - # Return the agent ids ranks in the order of activation. - ranks = np.empty_like(argsort_agend_ids) - ranks[argsort_agend_ids] = np.arange(argsort_agend_ids.size) + # unshuffle the agent_ids to get the activation order + activation_order = agent_ids_shuffled[activation_order_shuffled] if self.model.config["agent_settings"]["fix_activation_order"]: - self.activation_order_by_elevation_fixed = (self.n, ranks) - return ranks + self.activation_order_by_elevation_fixed = (self.n, activation_order) + # Check if the activation order is correct, by checking if elevation is decreasing + assert np.diff(elevation[activation_order]).max() <= 0 + return activation_order @property def farmer_command_area(self): @@ -1613,6 +1608,10 @@ def abstract_water( assert (available_groundwater_m3 >= 0).all() assert (available_reservoir_storage_m3 >= 0).all() + self.activation_order_by_elevation_ = AgentArray( + self.activation_order_by_elevation, max_n=self.max_n + ) + if __debug__: irrigation_limit_pre = self.remaining_irrigation_limit_m3.copy() available_channel_storage_m3_pre = available_channel_storage_m3.copy() @@ -1626,7 +1625,6 @@ def abstract_water( water_consumption_m, returnFlowIrr_m, addtoevapotrans_m, - self.has_access_to_irrigation_water, ) = abstract_water( self.model.current_day_of_year - 1, self.n, diff --git a/geb/agents/decision_module.py b/geb/agents/decision_module.py index a3c4e34e..49292d06 100644 --- a/geb/agents/decision_module.py +++ b/geb/agents/decision_module.py @@ -155,7 +155,7 @@ def calcEU_do_nothing( ## Here all y = EU_store x = p_all_events - EU_do_nothing_array = np.trapezoid(y=y, x=x, axis=0) + EU_do_nothing_array = np.trapz(y=y, x=x, axis=0) # People who already adapted cannot adapt, changed to a condition in the function that calls this, need the SEUT of doing nothing of those that have adapted # EU_do_nothing_array[np.where(adapted == 1)] = -np.inf diff --git a/geb/agents/households.py b/geb/agents/households.py index 2125c2aa..6166b21c 100644 --- a/geb/agents/households.py +++ b/geb/agents/households.py @@ -6,10 +6,10 @@ from ..hydrology.landcover import SEALED import pandas as pd from os.path import join -from damagescanner.core import RasterScanner -from damagescanner.core import VectorScanner import json -import xarray as xr + +# from damagescanner.core import RasterScanner +# from damagescanner.core import VectorScanner try: import cupy as cp diff --git a/geb/setup/geb.py b/geb/setup/geb.py index e6cbb66a..450c3c7c 100644 --- a/geb/setup/geb.py +++ b/geb/setup/geb.py @@ -5421,7 +5421,9 @@ def setup_hydrodynamics( esa_worldcover.name = "lulc" esa_worldcover = esa_worldcover.to_dataset() esa_worldcover["_dummy"] = 0 - self.set_forcing(esa_worldcover, name="hydrodynamics/esa_worldcover", split_dataset=False) + self.set_forcing( + esa_worldcover, name="hydrodynamics/esa_worldcover", split_dataset=False + ) hydrodynamics_data_catalog.add_source( "esa_worldcover", diff --git a/pyproject.toml b/pyproject.toml index 1c23d535..8ba53149 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ authors = [ ] dependencies = [ "cdsapi>=0.7.3", - "DamageScanner @ git+https://github.com/VU-IVM/DamageScanner@vector-update", + "DamageScanner @ git+https://github.com/VU-IVM/DamageScanner@test-exact-extract", "dask>=2024.6", "deap>=1.4.1", "flopy>=3.8.0", @@ -69,6 +69,7 @@ docs = [ "sphinx<8", "sphinx-autodoc-typehints", "sphinxcontrib-autoprogram", + "sphinxcontrib-bibtex", "sphinx_rtd_theme", "sphinxcontrib-autoyaml", "pypandoc", diff --git a/tests/agents/test_crop_farmers.py b/tests/agents/test_crop_farmers.py index 01a44df9..e4277aa7 100644 --- a/tests/agents/test_crop_farmers.py +++ b/tests/agents/test_crop_farmers.py @@ -363,6 +363,7 @@ def test_withdraw_channel(): water_withdrawal_m=water_withdrawal_m, remaining_irrigation_limit_m3=remaining_irrigation_limit_m3, channel_abstraction_m3_by_farmer=channel_abstraction_m3_by_farmer, + minimum_channel_storage_m3=100.0, ) assert irrigation_water_demand_field == 0.0 assert available_channel_storage_m3[0] == 1000.0 @@ -379,11 +380,12 @@ def test_withdraw_channel(): water_withdrawal_m=water_withdrawal_m, remaining_irrigation_limit_m3=remaining_irrigation_limit_m3, channel_abstraction_m3_by_farmer=channel_abstraction_m3_by_farmer, + minimum_channel_storage_m3=100.0, ) - assert irrigation_water_demand_field == 10.0 - assert available_channel_storage_m3[0] == 0.0 - assert water_withdrawal_m[0] == 20.0 - assert channel_abstraction_m3_by_farmer[0] == 2000.0 + assert irrigation_water_demand_field == 11.0 # keep 100 m3 in the channel + assert available_channel_storage_m3[0] == 100.0 + assert water_withdrawal_m[0] == 19.0 + assert channel_abstraction_m3_by_farmer[0] == 1900.0 def test_reservoir():