Food security impacts of ammonia energy transformation
Jillian Sturtevant1, Page Kyle2*, Paul Wolfram2, Hassan Niazi2, Xin Zhang1, Sarah Garvey1, et al.
1 Appalachian Laboratory, University of Maryland Center for Environmental Science (UMCES); 2 Joint Global Change Research Institute, Pacific Northwest National Laboratory (JGCRI-PNNL)
* corresponding authors: [email protected] | [email protected]
Using ammonia to mitigate CO2 emissions from maritime shipping poses potentially major food security risks. Ammonia is the prime source of nitrogen used in fertilizers. At the same time, ammonia demands for decarbonizing shipping fuels may exceed those for agriculture. This study uses GCAM to provide a first integrated quantitative analysis of the net impacts of simultaneous supply and demand shocks to ammonia markets globally, together and in isolation, across food and energy systems through the mid-21st century.
This repository contains key data files, model, and scripts used to support the analysis in the manuscript referenced below.
TBD
The folder structure and scripts used in this analysis are described below. Each folder contains a README.md file with more details.
| Folders | Description |
|---|---|
data/ |
Input data files used in the analysis. See data readme for more details |
model/ |
GCAM model used in the analysis. Should be cloned from the GCAM repository. See model for the version details and model readme for more information on the model setup |
figures/ |
Figures from analysis scripts in the repo. See figures readme for more details |
The main scripts and files used in the analysis are:
| Files | Description |
|---|---|
load.R |
R script to extract GCAM output data using rgcam and load key environment variables |
figures.R |
R script to generate figures in the manuscript |
food_ammonia.proj |
GCAM output data project file generated from load.R using rgcam |
queries_ammonia.xml |
XML file containing GCAM queries used in load.R |
For first-time users of GCAM, follow the guidance on GCAM wiki to setup GCAM or for background knowledge.
| Model | Version | Repository Link | DOI |
|---|---|---|---|
| GCAM | v7.2 | https://github.com/pkyle/gcam-core | |
| R | 4.5.1 | https://cran.r-project.org/ | - |
High-level steps to reproduce the analysis are:
- Clone this repository:
git clone https://github.com/JGCRI/sturtevant_food_ammonia.gitYou will not need raw GCAM model files to run the analysis scripts, but if you want to get them, initialize and update the submodules:
cd sturtevant_food_ammonia
git submodule update --init model/gcam-coreTo regularly update the GCAM model
To stay up to date with the latest GCAM model changes, you can periodically run: git submodule update --remote model/gcam-coreor manually update it by pulling changes in the folder by cd model/gcam-core, running git pull, and then returning to the root directory cd ../../ and registering the submodule git add model/gcam-core.
-
Run
figures.Rto generate figures in the manuscript -
Run
load.Rto set up the R environment, install required packages, and load GCAM output data- Set
INSTALL_PACKAGES <- TRUEinload.Rto install required packages - Set
QUERY_GCAM <- TRUEinload.Rto re-query GCAM output data.- This requires GCAM output database to be present in
outputs/database_basexdbfolder. See model readme for instructions to run GCAM and generate the output database.
- This requires GCAM output database to be present in
- Set
Detailed instructions are in the
README.mdfiles in each folder (e.g., in data, model, and figures folders).
GCAM output project food_ammonia.proj contains the relevant results of the analysis.
The raw GCAM output database will be in the outputs/database_basexdb folder and could be produced by running GCAM with instructions in the model readme.
Analysis outputs food_ammonia.proj are generated by the load.R script. GCAM output database should be produced before running load.R with QUERY_GCAM <- TRUE.
Open an issue on this repository by navigating to the Issues tab or contact the corresponding author.