Skip to content

Commit

Permalink
Dec 2020 GHG code update (#31)
Browse files Browse the repository at this point in the history
* Add N2O as new emission species
* Add scaling for updated UNFCCC emissions data for CH4 and N2O
* Updated RCP back-extension to match 1970 totals
* Add additional non-combustion sectors specific to N2O
* Add additional fugitive emissions sectors breaking out oil production, oil refining, and natural gas
* Update CO2 cement to Andrew data
* Add Puerto Rico cement CO2 emissions
* Fixed issue with USSR flaring emissions not being read in before 1985 (#285)
* Added crude oil production as driver for fugitive oil production sector
* Misc other fixes and changes

Co-authored-by: Hamza Ahsan <[email protected]>
Co-authored-by: patrickrorourke <[email protected]>
Co-authored-by: Smith, Steven J (PNNL-JGCRI) <[email protected]>
  • Loading branch information
3 people authored Dec 28, 2020
1 parent 1d6fb0e commit 504e834
Show file tree
Hide file tree
Showing 139 changed files with 700,436 additions and 2,199 deletions.
39 changes: 31 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ endif
# specifically to run the system with the new emissions type.

# Note that this is an inefficient method of creating data for multiple species
# If a multi-processor machine is available, CEDS should be instead run in parellel for multiple species
all: SO2-emissions BC-emissions OC-emissions NOx-emissions CO-emissions NMVOC-emissions CO2-emissions NH3-emissions CH4-emissions
# If a multi-processor machine is available, CEDS should be instead run in parallel for multiple species
all: SO2-emissions BC-emissions OC-emissions NOx-emissions CO-emissions NMVOC-emissions CO2-emissions NH3-emissions CH4-emissions N2O-emissions
part1: SO2-emissions NOx-emissions NH3-emissions
part2: BC-emissions OC-emissions CO2-emissions
part2: BC-emissions OC-emissions CO2-emissions N2O-emissions
part3: CO-emissions NMVOC-emissions CH4-emissions

# --------------------------------------------------------------
Expand All @@ -122,7 +122,7 @@ clean-all: \
clean-modD clean-modE clean-modF clean-modH clean-gridding clean-user_defined_energy

clean-user_defined_energy:
# Deletes all CSVs in the directory except for:
# Deletes all CSVs in the directory except for:
# 1) CEDS user-defined energy inputs, metadata, and instructions (U.*.csv)
# 2) Relevant mapping and instructions files for user-defined energy input which require pre-processing for use in CEDS (A.*-instructions.csv, A.*_sector_map.csv, A.*-mapping.xlsx)
find $(USER_EN_IN) -name "*.csv" ! -name "U.*.csv" ! -name "A.*-instructions.csv" ! -name "A.*_sector_map.csv" -delete
Expand Down Expand Up @@ -181,8 +181,8 @@ clean-modF:
rm -fv $(MED_OUT)/F*.csv

clean-modH:
rm -fv $(MED_OUT)/H*.csv \
rm -fv $(EXT_IN)/extension-data/H*.csv
rm -fv $(MED_OUT)/H*.csv
find $(EXT_IN) -name "H*.csv" ! -name "H.N2O_7BC_extension-NH3_and_NOx_sectors_1_2*.csv" -delete

clean-SO2:
rm -fv $(MED_OUT)/*SO2*.csv \
Expand Down Expand Up @@ -220,6 +220,10 @@ clean-BC:
rm -fv $(MED_OUT)/*BC*.csv \
rm -fv $(EF_DATA)/non-combustion-emissions/C.BC*.csv

clean-N2O:
rm -fv $(MED_OUT)/*N2O*.csv \
rm -fv $(EF_DATA)/non-combustion-emissions/C.N2O*.csv

clean-gridding:
rm -fv $(MED_OUT)/gridded-emissions/*.csv

Expand Down Expand Up @@ -642,6 +646,7 @@ $(MED_OUT)/B.$(EM)_comb_EF_db.csv: \
$(MOD_B)/B1.2.add_comb_EF.R \
$(MOD_B)/B1.1.base_BCOC_comb_EF.R \
$(MOD_B)/B1.1.base_CO2_comb_EF.R \
$(MOD_B)/B1.1.base_N2O_comb_EF.R \
$(MOD_B)/B1.1.base_OTHER_comb_EF.R \
$(MOD_B)/B1.1.base_comb_EF_control_percent.R \
$(MOD_B)/B1.1.base_SO2_comb_EF_parameters.R \
Expand Down Expand Up @@ -679,10 +684,15 @@ $(MED_OUT)/C.$(EM)_NC_emissions_db.csv: \
$(MOD_C)/C1.1.base_NC_emissions.R \
$(MOD_C)/C1.2.add_NC_emissions.R \
$(MOD_C)/C1.2.add_SO2_NC_emissions_all.R \
$(MOD_C)/C1.2.GAINS_fugitive_petr_gas_emissions.R \
$(MOD_C)/C1.2.add_NC_emissions_EDGAR.R \
$(MOD_C)/C1.2.EPA_adipic_and_nitric_acid.R \
$(MOD_C)/C1.2.Adipic_nitric_acid_default_process_emissions.R \
$(MOD_C)/C1.2.add_CH4_NC_emissions_FAO.R \
$(MOD_C)/C1.2.add_N2O_NC_emissions_FAO.R\
$(MOD_C)/C1.2.ECLIPSE_flaring_emissions_extension.R \
$(MOD_C)/C1.2.Fugitive-petr-and-gas_default_process_emissions.R \
$(MOD_C)/C1.2.add_CO2_NC_emissions_CDIAC.R \
$(MOD_C)/C1.2.add_CO2_NC_emissions_Andrew.R \
$(MAPPINGS)/NC_EDGAR_sector_mapping.csv \
$(PARAMS)/common_data.R \
$(PARAMS)/global_settings.R \
Expand All @@ -693,6 +703,7 @@ $(MED_OUT)/C.$(EM)_NC_emissions_db.csv: \
$(PARAMS)/process_db_functions.R \
$(MAPPINGS)/sector_input_mapping.xlsx \
$(ACTIV)/Process_SO2_Emissions_to_2005.xlsx \
$(MED_OUT)/E.CO2_Andrew_Cement.csv \
$(MED_OUT)/E.CO2_CDIAC_inventory.csv
Rscript $< $(EM) --nosave --no-restore
Rscript $(word 2,$^) $(EM) --nosave --no-restore
Expand All @@ -719,6 +730,7 @@ $(MED_OUT)/C.$(EM)_NC_emissions.csv: \
$(MED_OUT)/E.$(EM)_Japan_inventory.csv \
$(MED_OUT)/E.$(EM)_REAS_inventory.csv \
$(MED_OUT)/E.$(EM)_UNFCCC_inventory.csv \
$(MED_OUT)/E.$(EM)_UNFCCC_inventory_update.csv \
$(MED_OUT)/E.$(EM)_US_inventory.csv \
$(MED_OUT)/E.$(EM)_US-EPA_inventory.csv \
$(MED_OUT)/E.$(EM)_US_GHG_inventory.csv \
Expand Down Expand Up @@ -769,6 +781,11 @@ $(MED_OUT)/E.$(EM)_UNFCCC_inventory.csv: \
$(MOD_E)/E.UNFCCC_emissions.R
Rscript $< $(EM) --nosave --no-restore

# ee1-2
$(MED_OUT)/E.$(EM)_UNFCCC_inventory_update.csv: \
$(MOD_E)/E.UNFCCC_emissions_update.R
Rscript $< $(EM) --nosave --no-restore

# ee1-2
$(MED_OUT)/E.$(EM)_EMEP_NFR09_inventory.csv: \
$(MOD_E)/E.EMEP_emissions.R
Expand All @@ -784,6 +801,12 @@ $(MED_OUT)/E.CO2_CDIAC_inventory.csv: \
$(MOD_E)/E.CDIAC_emissions.R \
$(MED_OUT)/A.UN_pop_master.csv
Rscript $< $(EM) --nosave --no-restore

# ee1-2
$(MED_OUT)/E.CO2_Andrew_Cement.csv: \
$(MOD_E)/E.Andrew_emissions.R \
$(MED_OUT)/A.UN_pop_master.csv
Rscript $< $(EM) --nosave --no-restore

# ee1-2
$(MED_OUT)/E.$(EM)_REAS_inventory.csv: \
Expand Down Expand Up @@ -990,7 +1013,7 @@ $(MED_OUT)/gridded-emissions/CEDS_$(EM)_anthro_%.csv: \
$(PARAMS)/nc_generation_functions.R \
$(FINAL_OUT)/current-versions/CEDS_$(EM)_emissions_by_country_CEDS_sector_*.csv
Rscript $< $(EM) --nosave --no-restore

ifeq ($(EM),NMVOC)
Rscript $(MOD_G)/G1.2.grid_subVOC_emissions.R VOC01 --nosave --no-restore
Rscript $(MOD_G)/G1.2.grid_subVOC_emissions.R VOC02 --nosave --no-restore
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
The Community Emissions Data System (CEDS) produces consistent estimates of global air emissions species over the industrial era (1750 - present). The system is written in R and uses open-source data (with the exception of the IEA energy statistics which must be purchased from IEA). CEDS is publicly available through an [Open Source License](#license-section).

***
**Code Update:** December 28, 2020. This code update adds N2O emissions and updates CH4 and CO2 data. See the [release notes](https://github.com/JGCRI/CEDS/wiki/Release-Notes) for further details. Emissions data will be included in the upcoming full release.

**Pre-Release:** September 11, 2020. The current code and data in this repository is associated with a pre-release set of data for review and assessment.

This pre-release extends the emissions time series to 2019 and updates driver and emissions data throughout. This version builds on the extension of the CEDS system to 2017 described in [McDuffie et al. 2020](https://essd.copernicus.org/preprints/essd-2020-103/). This pre-release focuses on aerosol and ozone precursor emissions.
Expand Down
9 changes: 8 additions & 1 deletion code/diagnostic/Compare_to_RCP.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ------------------------------------------------------------------------------
# Program Name: Compare_to_RCP.R
# Author: Rachel Hoesly, Linh Vu, Leyang Feng, Huong Nguyen
# Date Last Updated: 03 November, 2016
# Date Last Updated: 4 March, 2019
# Program Purpose: Produces comparison - diagnostic files and plots between CEDS and
# RCP. Comparison by global totals, regions, sectors
# Like with like comparison does not include
Expand Down Expand Up @@ -37,6 +37,9 @@ args_from_makefile <- commandArgs( TRUE )
em <- args_from_makefile[ 1 ]
if ( is.na( em ) ) em <- "CH4"

# Run for all ems besides N2O
if (em != "N2O"){

# Load Packages

library('ggplot2')
Expand Down Expand Up @@ -473,6 +476,10 @@ region_sector_both <- region_sector_both [ with( region_sector_both , order( reg
#writeout
writeData( region_sector_both,'DIAG_OUT', paste0('RCP_',em,'_region_sector_Comparison'),domain_extension = 'ceds-comparisons/',meta=F)

} else {
print("Selected emissions species is not configured to compare to RCP.")

}

# ---------------------------------------------------------------------------
# 10. End
Expand Down
2 changes: 1 addition & 1 deletion code/module-B/B1.1.CO2_biofuels_EF.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ----------------------------------------------------------------------------
# Program Name: B1.1.CO2_biofuels_EF.R
# Author's Name: Patrick O'Rourke, Rachel Hoesly
# Author's Name: Rachel Hoesly, Patrick O'Rourke
# Date Last Modified: April 25, 2020
# Program Purpose: This file processes CO2 biofuel combustion emissions factors
# and removes the fraction of liquid and gas biofuels from EFs
Expand Down
Loading

0 comments on commit 504e834

Please sign in to comment.