The main model is written in GAMS. R scripts are used for pre- and post-processing data.
Current versions of GAMS and R are required for replication. Run the contained scripts in the following sequence:
MAIN_data_processing.R to pre-process input data, then convert it to GAMS data format by running input_xlsx_to_gdx.gmsBASE_rice_model.gms with fixed scenario to determine water use in this fixed setting.water_constraint.R to scale the water use from baseline and use it in the actual opitmization model.rice_model.gms. Due to the significant amount of scenarios this can take some time.gdx_to_csv.gms to convert data from GAMS to CSV fomrat to make it readable with other programmes, including R.analyze_outputs.R and figures_numbers_publication.R to analyze optimization model outputs and reproduce numbers, percentages and figures included in the articleThis package provides the following datasets:
GAEZ_rice_data.zipproduction_costs.csvsubbasin_to_marketshed.csv and subbasin_to_country.csv provide mapping of spatial units for use in the GAMS model.These datasets need to be downloaded to fully reproduce the analysis:
The economic model in GAMS can be run without the full data integration by using the processed data file provided in: model_inputs_cleaned.xlsx
Output data of the economic optimization is provided in the csv files in model_outputs.zip