Skip to content

Commit f66df7e

Browse files
Public full release (#19)
* Fixes to user-defined energy data * Fix_metadata_collate * Rename processing scripts * Modify input and output directories for user-defined energy scripts * Add option to clean user-defined-energy to Makefile * Modify Makefile to clean additional diagnostic directories * Move log directory to top-level * Remove duplicate and/or unused files * Correct shipping fuel time series. * Correct UN energy data negative values * Update waste emissions code and assumptions * Update korea bcoc * Update README for release
1 parent 67c7eb9 commit f66df7e

File tree

183 files changed

+3446
-3749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+3446
-3749
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ input/energy/OECD_Conversion_Factors.csv
3030
.Rproj.user
3131

3232
#Other
33-
.DS_Store
33+
.DS_Store

Makefile

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ SC_MAPPINGS = input/mappings/scaling
1919
ACTIV = input/activity
2020
INV_DATA = input/emissions-inventories
2121
MED_OUT = intermediate-output
22-
ENERGY_IN = input/energy
2322
DIAG_OUT = diagnostic-output
2423
FINAL_OUT = final-emissions
2524
EXT_IN = input/extension
26-
USER_EN_IN = input/extension/user-defined-energy
25+
USER_EN_PROCESS = input/energy/user-defined-energy
26+
USER_EN_IN = input/energy/user-defined-energy/user_energy_input
2727
EXT_DATA = input/extension/extension-data
28-
LOGS = code/logs
28+
LOGS = logs
2929
DOCS = documentation
3030

3131
# --------------------------------------------------------------
@@ -109,7 +109,7 @@ endif
109109

110110
# Note that this is an inefficient method of creating data for multiple species
111111
# If a multi-processor machine is available, CEDS should be instead run in parellel for multiple species
112-
all: SO2-emissions BC-emissions OC-emissions NOx-emissions CO-emissions NMVOC-emissions CO2-emissions NH3-emissions
112+
all: SO2-emissions BC-emissions OC-emissions NOx-emissions CO-emissions NMVOC-emissions CO2-emissions NH3-emissions CH4-emissions
113113
part1: SO2-emissions NOx-emissions NH3-emissions
114114
part2: BC-emissions OC-emissions CO2-emissions
115115
part3: CO-emissions NMVOC-emissions CH4-emissions
@@ -119,7 +119,19 @@ part3: CO-emissions NMVOC-emissions CH4-emissions
119119
# Targets used to remove output files for a fresh run
120120
clean-all: \
121121
clean-intermediate clean-diagnostic clean-final clean-logs clean-io clean-modA clean-modB clean-modC \
122-
clean-modD clean-modE clean-modF clean-modH clean-gridding
122+
clean-modD clean-modE clean-modF clean-modH clean-gridding clean-user_defined_energy
123+
124+
clean-user_defined_energy:
125+
# Deletes all CSVs in the directory except for:
126+
# 1) CEDS user-defined energy inputs, metadata, and instructions (U.*.csv)
127+
# 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)
128+
find $(USER_EN_IN) -name "*.csv" ! -name "U.*.csv" ! -name "A.*-instructions.csv" ! -name "A.*_sector_map.csv" -delete
129+
130+
# Deletes all xlsx files that don't end in -mapping.xlsx and begin with "A." or "U."
131+
find $(USER_EN_IN) -name "*.xlsx" ! -name "A.*-mapping.xlsx" ! -name "U.*-mapping.xlsx" -delete
132+
133+
# Deletes all txt files that aren't the README file
134+
find $(USER_EN_IN) -name "*.txt" ! -name "README.txt" -delete
123135

124136
clean-intermediate:
125137
rm -fv $(MED_OUT)/*.csv
@@ -129,7 +141,11 @@ clean-diagnostic:
129141
rm -fv $(DIAG_OUT)/summary-plots/*.csv \
130142
rm -fv $(DIAG_OUT)/summary-plots/*.pdf \
131143
rm -fv $(DIAG_OUT)/ceds-comparisons/*.pdf \
132-
rm -fv $(DIAG_OUT)/ceds-comparisons/*.csv
144+
rm -fv $(DIAG_OUT)/ceds-comparisons/*.csv \
145+
rm -fv $(DIAG_OUT)/ceds-comparisons/sector-level/*.csv \
146+
rm -fv $(DIAG_OUT)/ceds-comparisons/sector-level/*.pdf \
147+
rm -fv $(DIAG_OUT)/user-data/*.csv \
148+
rm -fv $(DIAG_OUT)/user-data/*.png
133149

134150
clean-final:
135151
rm -fv $(FINAL_OUT)/*.csv
@@ -392,16 +408,10 @@ $(MED_OUT)/A.comb_othertrans_activity.csv: \
392408
# Extends IEA data with BP data
393409
$(MED_OUT)/A.IEA_BP_energy_ext.csv: \
394410
$(MOD_A)/A3.1.IEA_BP_data_extension.R \
395-
$(MOD_A)/A3.2.Adjust_Shipping_Fuel_Cons.R \
396411
$(MED_OUT)/A.comb_othertrans_activity.csv \
397412
$(MAPPINGS)/Master_Fuel_Sector_List.xlsx \
398-
$(ENERGY_DATA)/BP_energy_data.xlsx \
399-
$(ENERGY_DATA)/Shipping_Fuel_Consumption.xlsx
413+
$(ENERGY_DATA)/BP_energy_data.xlsx
400414
Rscript $< $(EM) --nosave --no-restore
401-
Rscript $(word 2,$^) $(EM) --nosave --no-restore
402-
403-
$(MED_OUT)/A.intl_shipping_en.csv: \
404-
$(MED_OUT)/A.IEA_BP_energy_ext.csv
405415

406416
# aa3-2
407417
# Write out difference between IEA and CEDS coal
@@ -419,7 +429,7 @@ $(MED_OUT)/A.IEA_CEDS_coal_difference.csv: \
419429
# aa3-3
420430
# Process pig iron production
421431
$(EXT_DATA)/A.Pig_Iron_Production.csv: \
422-
$(MOD_A)/A3.4.proc_pig_iron.R \
432+
$(MOD_A)/A3.3.proc_pig_iron.R \
423433
$(MED_OUT)/A.UN_pop_master.csv \
424434
#(ACTIV)/metals/Blast_furnace_iron_production_1850-2014.xlsx \
425435
#(ACTIV)/metals/Pig_Iron_Production_US.csv \
@@ -535,7 +545,7 @@ $(MED_OUT)/A.other_biomass_extended.csv: \
535545
$(MED_OUT)/A.default_comb_activity_with_other.csv
536546
Rscript $< $(EM) --nosave --no-restore
537547

538-
# combine all combustion extension data
548+
# Combine all combustion extension data
539549
$(MED_OUT)/A.comb_default_activity_extended.csv: \
540550
$(MOD_A)/A6.4.extended_default_comb_activity.R \
541551
$(MED_OUT)/A.comb_activity_extended_coal.csv \
@@ -544,12 +554,11 @@ $(MED_OUT)/A.comb_default_activity_extended.csv: \
544554
$(MED_OUT)/A.other_biomass_extended.csv \
545555
$(MED_OUT)/A.industrial_biomass_extended.csv \
546556
$(MED_OUT)/A.residential_biomass_full.csv \
547-
#$(MED_OUT)/A.intl_shipping_en.csv \
548557
$(MED_OUT)/A.default_comb_activity_with_other.csv \
549-
$(ENERGY_IN)/IEA_iso_start_data.csv
558+
$(ENERGY_DATA)/IEA_iso_start_data.csv
550559
Rscript $< $(EM) --nosave --no-restore
551560

552-
# Non Combustion activity data
561+
# Non-Combustion activity data
553562
$(MED_OUT)/A.NC_activity_extended_db.csv: \
554563
$(MOD_A)/A7.1.base_activity.R \
555564
$(MOD_A)/A7.2.add_activity.R \
@@ -570,21 +579,32 @@ $(MED_OUT)/A.NC_default_activity_extended.csv: \
570579
$(MED_OUT)/A.NC_activity_extended_db.csv
571580
Rscript $< $(EM) --nosave --no-restore
572581

582+
# User-added combustion activity incorporated
573583
$(MED_OUT)/A.comb_user_added.csv: \
574584
$(MOD_A)/A8.1.add_user-defined_data.R \
575585
$(MED_OUT)/A.comb_default_activity_extended.csv
576586
Rscript $< $(EM) --nosave --no-restore
577587

588+
# International shipping fix
589+
$(MED_OUT)/A.comb_int_shipping_adjusted.csv: \
590+
$(MOD_A)/A8.2.Adjust_Shipping_Fuel_Cons.R \
591+
$(MED_OUT)/A.comb_user_added.csv \
592+
$(MED_OUT)/A.IEA_en_stat_ctry_hist.csv \
593+
$(EN_MAPPINGS)/IEA_product_fuel.csv \
594+
$(ENERGY_DATA)/Shipping_Fuel_Consumption.xlsx
595+
Rscript $< $(EM) --nosave --no-restore
596+
597+
# Final activity data
578598
$(MED_OUT)/A.total_activity_extended.csv: \
579-
$(MOD_A)/A8.2.combine_extended_activity.R \
599+
$(MOD_A)/A8.3.combine_extended_activity.R \
580600
$(MED_OUT)/A.NC_default_activity_extended.csv \
581-
$(MED_OUT)/A.comb_user_added.csv
601+
$(MED_OUT)/A.comb_int_shipping_adjusted.csv
582602
Rscript $< $(EM) --nosave --no-restore
583603

584604
$(MED_OUT)/A.final_comb_activity_modern.csv: \
585-
$(MOD_A)/A8.2.combine_extended_activity.R \
605+
$(MOD_A)/A8.3.combine_extended_activity.R \
586606
$(MED_OUT)/A.NC_default_activity_extended.csv \
587-
$(MED_OUT)/A.comb_user_added.csv
607+
$(MED_OUT)/A.comb_int_shipping_adjusted.csv
588608
Rscript $< $(EM) --nosave --no-restore
589609

590610
$(MED_OUT)/A.total_activity_extended_coal.csv: \

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,29 @@
22
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).
33

44
***
5-
**Pre-release Version:** August 25, 2019. The current code and data in the repository is a pre-release version. Please feel free to explore, comment on this version and send us any questions. Note that we will be pushing several updates to the system leading up to the first public release.
5+
**Public Release:** December 23, 2019. The current code and data in the repository is a full public release of the CEDS system.
66

7-
* Additional fixes to improve consistency of historical calcuations and user options
8-
* Resolution of some current [open Issues](https://github.com/JGCRI/CEDS/issues).
9-
* User guide additions.
10-
* Description and graphs of emission differences with the CMIP6 data release
7+
This release was focused on fixing existing issues and adding new system capabilities as compared to the system that produced the CMIP6 data. In particular, the ability of users to add historical energy data for any country, allowing the system to more accurately reflect historical energy consumption trends. This capability is currently used for the USA, UK, and Germany.
118

12-
See [release notes](https://github.com/JGCRI/CEDS/wiki/Release-Notes) for a summary of changes.
9+
For details on this release see:
10+
11+
* The [release notes](https://github.com/JGCRI/CEDS/wiki/Release-Notes) for a summary of changes since the CMIP6 data release.
12+
* Graphs and explanations for emission differences between this version and the CMIP6 data release documented in Hoesly et al (2018a) [*to be added shortly*]. These differences can be interpreted as corrections to the CMIP6-data release that result from the updates included in this release.
13+
* Emissions by country and sector.
14+
15+
We are working on a major CEDS update which will extend the time series to 2018, update historical assumptions where necessary, and will include gridded emissions.
1316

1417
***
1518

1619
Documentation of CEDS assumptions and system operation, including a user guide, are available at the [CEDS project wiki](https://github.com/JGCRI/CEDS/wiki) and in the journal paper listed below.
1720

18-
Current issues with the data or system are documented in the [CEDS Issues](https://github.com/JGCRI/CEDS/issues) system in this GitHub repository (current issues as of September 2017 are also listed in the "Known Issues" section of the Data and Assumptions wiki. Newer issues are on GitHub.). Users can submit issues using this system. These can include anomalies found in either the aggregate or gridded emissions data. Please use an appropriate tag for any submitted issues. Note that by default only unresolved issues are shown. All issues, including resolved issues, can be viewed by removing the "is:open" filter. Issues relevant for CMIP6 data releases are tagged with a “CMIP6” label (note that some of these will be closed if resolved in subsequent CEDS data releases.)
21+
Current issues with the data or system are documented in the [CEDS Issues](https://github.com/JGCRI/CEDS/issues) system in this GitHub repository (current issues as of September 2017 are also listed in the "Known Issues" section of the Data and Assumptions wiki. Newer issues are on GitHub.). Users can submit issues using this system. These can include anomalies found in either the aggregate or gridded emissions data. Please use an appropriate tag for any submitted issues. Note that by default only unresolved issues are shown. All issues, including resolved issues, can be viewed by removing the "is:open" filter. *Issues relevant for CMIP6 data releases are tagged with a “CMIP6” label (note that issues will be closed when resolved in subsequent CEDS data releases.)*
1922

20-
Further information can also be found at the [project web site](http://www.globalchange.umd.edu/ceds/), including a [CMIP6 page](http://www.globalchange.umd.edu/ceds/ceds-cmip6-data/) that provides details for obtaining gridded emission datasets produced by this project.
23+
Further information can also be found at the [project web site](http://www.globalchange.umd.edu/ceds/), including a [CMIP6 page](http://www.globalchange.umd.edu/ceds/ceds-cmip6-data/) that provides details for obtaining gridded emission datasets produced by this project for use in CMIP6.
2124

22-
Over the summer and fall of 2019 we will be working on a major update which will extending the time series to 2018 and update historical assumptions.
25+
If you plan to use the CEDS data system for a research project you are encouraged to contact [Steve Smith](mailto:[email protected]) so that we can coordinate with any on-going work on the CEDS system and make sure we are not duplicating effort. CEDS is research software, and we will be happy to help and make sure that you are able to make the best possible use of this system.
2326

24-
If you plan to use the CEDS data system for a research project you are encouraged to contact [Steve Smith](mailto:[email protected]) so that we can coordinate with any on-going work on the CEDS system. CEDS is research software, and we will be happy to help you make sure and make the best possible use of this system.
27+
CEDS has only been possible through the participation of many collaborators. Our **collaboration policy** is that collaborators who contribute data used in CEDS updates will be included as authors on the journal paper that describes the next CEDS major release. We particularly encourage contributions of updated emission information from countries or sectors not well represented in the datasets currently used in CEDS.
2528

2629
# Journal Papers
2730
[Hoesly et al, Historical (1750–2014) anthropogenic emissions of reactive gases and aerosols from the Community Emissions Data System (CEDS). Geosci. Model Dev. 11, 369-408, 2018a.](https://www.geosci-model-dev.net/11/369/2018/gmd-11-369-2018.html)

code/module-A/A1.1.UN_pop_WB_HYDE_extension.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
# TODO: Update extendProxy() function.
4949
# ------------------------------------------------------------------------------
5050

51-
# ------------------------------------------------------------------------------
52-
# ------------------------------------------------------------------------------
5351
# 0. Read in global settings and headers
5452
# Define PARAM_DIR as the location of the CEDS "parameters" directory, relative
5553
# to the "input" directory.

code/module-A/A1.3.IEA_downscale_ctry.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,15 @@
340340
"1971", "1990", paste0( "Natural gas liquids (kt) in final consumption go uncounted ",
341341
"before 1990 since shares cannot be calculated from 1990 values" ) )
342342

343-
addMetaData( meta_note, meta_names )
343+
source_info <- "A1.3.IEA_downscale_ctry.R"
344+
345+
addMetaData( meta_note, meta_names, source_info )
344346

345347
meta_note <- c( "Energy Consumption", "NA", "Former Soviet Union", "Consumption",
346348
"1971", "1990", paste0( "Natural gas liquids (kt) in final consumption go uncounted ",
347349
"before 1990 since shares cannot be calculated from 1990 values" ) )
348350

349-
addMetaData( meta_note, meta_names )
351+
addMetaData( meta_note, meta_names, source_info )
350352

351353
# Take the combination of PRODUCT and FLOW columns, and keep only the rows that
352354
# contain the combination of PRODUCT and FLOW in IEA_product_downscaling

code/module-A/A1.4.IEA_heat_content.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Program Name: A1.4.IEA_heat_content.R
22
# Author: Linh Vu, Rachel Hoesly
3-
# Date Last Updated: 16, August 2019
3+
# Date Last Updated: September 5, 2019
44
# Program Purpose: Computes weighted average heat content from IEA Conversion Factors
55
# by country, year and fuel type. Currently doing this for coal.
66
# Input Files: OECD_Conversion_Factors_Full.csv, NonOECD_Conversion_Factors_Full.csv,
@@ -35,7 +35,7 @@
3535
conversion_NonOECD <- readData( "ENERGY_IN", "NonOECD_Conversion_Factors_Full" )
3636
activity_data <- readData( "MED_OUT", "A.IEA_en_stat_ctry_hist" )
3737

38-
IEA_product_fuel <- readData( "MAPPINGS", "IEA_product_fuel", domain_extension = "energy/" )
38+
IEA_product_fuel <- readData( "EN_MAPPINGS", "IEA_product_fuel" )
3939
MCL <- readData( "MAPPINGS", "Master_Country_List" )
4040

4141
# ---------------------------------------------------------------------------

code/module-A/A2.3.write_IEA_diff.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#------------------------------------------------------------------------------
22
# Program Name: A2.3.write_IEA_diff.R
33
# Authors Names: Linh Vu, Rachel Hoesly, Patrick O'Rourke
4-
# Date Last Modified: July 10, 2019
4+
# Date Last Modified: September 5, 2019
55
# Program Purpose: Write out difference between IEA DOMSUP and CEDS
66
# consumption for coal, natural gas, oil
77
# Input Files: A.IEA_en_stat_ctry_hist.csv, en_biomass_fsu_fix.csv
@@ -33,8 +33,8 @@
3333

3434
MSL <- readData( "MAPPINGS", "Master_Fuel_Sector_List", ".xlsx", sheet_selection = "Sectors" )
3535
IEA_en_stat_ctry_hist <- readData( "MED_OUT", "A.IEA_en_stat_ctry_hist" )
36-
IEA_product_fuel <- readData( "MAPPINGS", "IEA_product_fuel", domain_extension = "energy/" )
37-
IEA_flow_sector <- readData( "MAPPINGS", "IEA_flow_sector", domain_extension = "energy/" )
36+
IEA_product_fuel <- readData( "EN_MAPPINGS", "IEA_product_fuel" )
37+
IEA_flow_sector <- readData( "EN_MAPPINGS", "IEA_flow_sector" )
3838

3939
A.en_biomass_fsu_fix <- readData( "MED_OUT", "A.en_biomass_fsu_fix" )
4040

0 commit comments

Comments
 (0)