Skip to content

Commit

Permalink
Feb 05 2021 release (#32)
Browse files Browse the repository at this point in the history
* Update readme.
* Set release version number.
* Update units file
* Update UNFCCC emissions and scaling mapping for GHGs
* Add non-comb emission inventory default assumptions, largely for Annex I CO2
* Update MEIC 2018 scaling methods
* Fix usa energy user input sector mapping
* Eliminate soil emissions discontinuity in idn N2O and pak NOx
* Update SKorea inventory input files and mappings
* Add NH3 to S Korea inventory.
* Improve match to off road inventory estimates by assuming usa and can commercial sector diesel fuel is off-road mobile
* Default user and system combustion EF and non-combustion emission files now explicitly sorted for consistency
* Update to most recent satellite data for SO2 refinery/fugitive emissions. Use refinery throughput for extrapolation
* Update to consistently represent China iron smelting SO2
* Fix China BC/OC Coke emissions
* Add BC/OC controls for recent years in China
* Add usa can rail EF trends
* Add USA off-road IEA energy data corrections
* Overwrite Ethiopia and Nigeria residential biomass consumption with valued based no UN data instead of IEA.
* Add BC/OC for fossil-fuel fires.
* Remove 2004 discontinuity in USA inventory data MISC sector
* Scale BC/OC road transportation to country inventory PM2.5
* Added maximum road BC/OC EF pathway
* Fix outlier values in GAINS default EF generation
* remove iso's in edgar scaling that are scaled by country inventories
* update Australia inventory with 2018/2019 year, add NH3, updated mapping file
* Removed Australia soil-emissions from scaling - these emissions not included in AUS inventory
* Remove AgriOther from EMEP scaling which includes AWB, which is not included in CEDS
* Updated SPEW process (coke oven) BC and OC emissions with aggregate countries (e.g FSU) are not included for earlier years
* Add oil production driver for emissions extension
* Remove outdated figure generation scripts
  • Loading branch information
ssmithClimate authored Feb 12, 2021
1 parent 504e834 commit da316e2
Show file tree
Hide file tree
Showing 225 changed files with 69,263 additions and 164,189 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ CH4_IO_documentation.csv

#Proprietary Data
input/energy/OECD_and_NonOECD_E_Stat.csv
input/energy/OECD_and_NonOECD_Conversion_Factors.csv
input/energy/OECD_and_NonOECD_Conversion_Factors_Full.csv

.Rproj.user
Expand Down
39 changes: 27 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ endif
# 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 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
part1: NOx-emissions SO2-emissions NH3-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 @@ -468,6 +468,7 @@ $(MED_OUT)/A.NC_activity_db.csv: \
$(MOD_A)/A5.2.add_NC_activity_gdp.R \
$(MOD_A)/A5.2.add_NC_activity_population.R \
$(MOD_A)/A5.2.add_NC_activity_energy.R \
$(MOD_A)/A5.2.add_NC_activity_fossil_fuel_production.R \
$(PARAMS)/common_data.R \
$(PARAMS)/global_settings.R \
$(PARAMS)/IO_functions.R \
Expand All @@ -477,18 +478,23 @@ $(MED_OUT)/A.NC_activity_db.csv: \
$(PARAMS)/process_db_functions.R \
$(MAPPINGS)/activity_input_mapping.csv \
$(MED_OUT)/A.other_IEA_energy_values.csv \
$(MED_OUT)/A.en_stat_sector_fuel.csv \
$(MAPPINGS)/NC_EDGAR_sector_mapping.csv \
$(MAPPINGS)/2011_NC_SO2_ctry.csv \
$(MAPPINGS)/Master_Country_List.csv \
$(ACTIV)/Smelter-Feedstock-Sulfur.xlsx \
$(ACTIV)/Wood_Pulp_Consumption.xlsx \
$(ACTIV)/GDP.xlsx
$(ACTIV)/GDP.xlsx \
$(ENERGY_DATA)/Hyde_oil_1800-1975.xls
Rscript $< $(EM) --nosave --no-restore
Rscript $(word 2,$^) $(EM) --nosave --no-restore
Rscript $(word 3,$^) $(EM) --nosave --no-restore
Rscript $(word 4,$^) $(EM) --nosave --no-restore
Rscript $(word 5,$^) $(EM) --nosave --no-restore
Rscript $(word 6,$^) $(EM) --nosave --no-restore
Rscript $(word 7,$^) $(EM) --nosave --no-restore
Rscript $(word 8,$^) $(EM) --nosave --no-restore
Rscript $(word 9,$^) $(EM) --nosave --no-restore

$(MED_OUT)/A.pulp_paper_consumption_full.csv: \
$(MED_OUT)/A.NC_activity_db.csv
Expand Down Expand Up @@ -567,9 +573,11 @@ $(MED_OUT)/A.NC_activity_extended_db.csv: \
$(MOD_A)/A7.2.add_activity_CDIAC.R \
$(MOD_A)/A7.2.add_activity_population.R \
$(MOD_A)/A7.2.add_activity_pulp_paper_consumption.R \
$(MOD_A)/A7.2.add_activity_fossil_fuel_production.R \
$(MED_OUT)/E.CO2_CDIAC_inventory.csv \
$(MED_OUT)/A.pulp_paper_consumption_full.csv \
$(MED_OUT)/A.NC_activity.csv \
$(MED_OUT)/A.crude_oil_production_data.csv \
$(EXT_IN)/CEDS_historical_extension_drivers_activity.csv
Rscript $< $(EM) --nosave --no-restore
Rscript $(word 2,$^) $(EM) --nosave --no-restore
Expand Down Expand Up @@ -728,9 +736,10 @@ $(MED_OUT)/C.$(EM)_NC_emissions.csv: \
$(MED_OUT)/E.$(EM)_EMEP_NFR09_inventory.csv \
$(MED_OUT)/E.$(EM)_EMEP_NFR14_inventory.csv \
$(MED_OUT)/E.$(EM)_Japan_inventory.csv \
$(MED_OUT)/E.$(EM)_KOR2017_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)_UNFCCC_update_inventory.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 @@ -782,7 +791,7 @@ $(MED_OUT)/E.$(EM)_UNFCCC_inventory.csv: \
Rscript $< $(EM) --nosave --no-restore

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

Expand All @@ -801,7 +810,7 @@ $(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 \
Expand Down Expand Up @@ -848,6 +857,11 @@ $(MED_OUT)/E.$(EM)_Japan_inventory.csv: \
$(MOD_E)/E.Japan_emissions.R
Rscript $< $(EM) --nosave --no-restore

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

# ee1-2
$(MED_OUT)/E.$(EM)_US_inventory.csv: \
$(MOD_E)/E.US_emissions.R
Expand All @@ -859,13 +873,13 @@ $(MED_OUT)/E.$(EM)_US-EPA_inventory.csv: \
Rscript $< $(EM) --nosave --no-restore

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

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

# ee1-2
Expand All @@ -888,7 +902,7 @@ $(MED_OUT)/F.$(EM)_scaled_emissions.csv: \
$(MOD_F)/F1.1.EMEP_NFR14_scaling.R \
$(MOD_F)/F1.1.Japan_scaling.R \
$(MOD_F)/F1.1.REAS_scaling.R \
$(MOD_F)/F1.1.South_korea_scaling.R \
$(MOD_F)/F1.1.South_korea_scaling_2017.R \
$(MOD_F)/F1.1.UNFCCC_scaling.R \
$(MOD_F)/F1.1.US_scaling.R \
$(MOD_F)/F1.1.US-EPA_scaling.R \
Expand All @@ -905,6 +919,7 @@ $(MED_OUT)/F.$(EM)_scaled_emissions.csv: \
$(MED_OUT)/E.$(EM)_EMEP_NFR09_inventory.csv \
$(MED_OUT)/E.$(EM)_EMEP_NFR14_inventory.csv \
$(MED_OUT)/E.$(EM)_Japan_inventory.csv \
$(MED_OUT)/E.$(EM)_KOR2017_inventory.csv \
$(MED_OUT)/E.$(EM)_REAS_inventory.csv \
$(MED_OUT)/E.$(EM)_UNFCCC_inventory.csv \
$(MED_OUT)/E.$(EM)_US_inventory.csv \
Expand Down Expand Up @@ -936,12 +951,12 @@ $(MED_OUT)/F.$(EM)_scaled_emissions.csv: \
$(SC_MAPPINGS)/S_Korea_scaling_mapping.csv \
$(SC_MAPPINGS)/UNFCCC_scaling_mapping.csv \
$(SC_MAPPINGS)/UNFCCC_scaling_year.csv \
$(SC_MAPPINGS)/UNFCCC_CH4_scaling_mapping.csv \
$(SC_MAPPINGS)/UNFCCC_CH4_scaling_year.csv \
$(SC_MAPPINGS)/UNFCCC_GHG_scaling_mapping.csv \
$(SC_MAPPINGS)/US_scaling_mapping.csv \
$(SC_MAPPINGS)/US-EPA_scaling_mapping.csv \
$(SC_MAPPINGS)/US-GHG_scaling_mapping.csv \
$(SC_MAPPINGS)/Australia_scaling_mapping.csv \
$(SC_MAPPINGS)/Australia_NOx_scaling_mapping.csv \
$(SC_MAPPINGS)/Taiwan_scaling_mapping.csv \
$(SC_MAPPINGS)/Taiwan_scaling_method.csv \
$(MED_OUT)/D.$(EM)_default_total_EF.csv \
Expand Down Expand Up @@ -1013,7 +1028,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
38 changes: 23 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,49 @@
# CEDS
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.
**Feb 2021 Release:** February 05, 2021 (v\_2021\_02\_05)

This data and code 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/). Major features:

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.
* Emissions estimates to 2019
* Updated default data from GAINS and EDGAR
* Updates to country inventories used for scaling
* Improved BC/OC emission time series
* Improved consistency over time
* Updated code and driver data

For details on this release see:

* See the [release notes](https://github.com/JGCRI/CEDS/wiki/Release-Notes) for a summary of changes and notes on **known issues** with this dataset that are currently being addressed.
* [Graphs of emission differences](./documentation/Version_comparison_figures_v_2020_09_11_vs_v_2019_12_23.pdf) between this version and the previous December 2019 CEDS data release.
* [Graphs of emission differences](./documentation/Version_comparison_figures_v_2020_09_11_vs_v_2016_07_16(CMIP6).pdf) between this version and the CEDS CMIP6 data release documented in Hoesly et al (2018a).
* Emissions by country and sector, archived [here](https://zenodo.org/record/4025316).
* See the [release notes](https://github.com/JGCRI/CEDS/wiki/Release-Notes) for a summary of changes.
* [Graphs of emission differences](./documentation/Version_comparison_figures_v_2021_02_05_vs_v_2016_07_16(CMIP6).pdf) between this version and the CEDS CMIP6 data release documented in Hoesly et al (2018a).
* [Graphs of emission differences](./documentation/Version_comparison_figures_v_2021_02_05_vs_v_2019_12_23.pdf) between this version and the previous December 2019 CEDS data release.
* Emissions by country and sector, archived [here](http://doi.org/10.5281/zenodo.4509372).

We encourage comments on this data. The best way to comment on the data is through the [CEDS Issues](https://github.com/JGCRI/CEDS/issues) page.

_Gridded data corresponding to this release is in production and will be released shortly._

We encourage assessment of and comments on this pre-release data. The best way to comment on the data is through the [CEDS Issues](https://github.com/JGCRI/CEDS/issues) page. A full release is in progress for fall 2020 and will incorporate as many comments as possible.
_A journal paper describing this dataset is in preparation. A notice will be updated here and sent to the CEDS listserv when this is available._

We do not anticipate substantial changes to the CEDS system structure prior to the fall 2020 full release.
***

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 papers noted below.

Current issues with the data or system are documented in the [CEDS Issues](https://github.com/JGCRI/CEDS/issues) system in this GitHub repository. 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.)*
Current issues with the data or system are documented in the [CEDS Issues](https://github.com/JGCRI/CEDS/issues) system in this GitHub repository. 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, but are still available for viewing.)*

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.
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. You can also sign up for data release announcements from the CEDSinfo listserv following the instructions on the [project web site](http://www.globalchange.umd.edu/ceds/).

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.

Users should use the most recent version of this repository, which will include maintenance updates to address documentation or usability issues. Major changes that alter emission estimates or system structure and use ill be noted in the [release notes](https://github.com/JGCRI/CEDS/wiki/Release-Notes).
Users should use the most recent version of this repository, which will include maintenance updates to address documentation or usability issues. Major changes that alter emission estimates or system structure and use will be noted in the [release notes](https://github.com/JGCRI/CEDS/wiki/Release-Notes).

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 co-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 data currently used in CEDS.
CEDS has only been possible through the participation of many collaborators. Our **collaboration policy** is that collaborators who contribute unpublished data used in CEDS updates will be included as co-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 data currently used in CEDS.

# Data Reference

Reference for [this data version](https://github.com/JGCRI/CEDS/wiki/Release-Notes):
O'Rourke, Patrick R, Smith, Steven J., McDuffie, Erin E., Crippa, Monica, Klimont, Zbigniew, Mott, Andrea, Wang, Shuxiao, Nicholson, Matthew B, Feng, Leyang, and Hoesly, Rachel M. (2020, September 11). CEDS v-2020-09-11 Pre-Release Emission Data 1975-2019 (Version Sept-11-2020). [Zenodo. http://doi.org/10.5281/zenodo.4025316](http://doi.org/10.5281/zenodo.4025316).
O'Rourke, P. R, Smith, S. J., Mott, A., Ahsan, H., McDuffie, E. E., Crippa, M., Klimont, S., McDonald, B., Z., Wang, Nicholson, M. B, Feng, L., and Hoesly, R. M. (2021, February 05). CEDS v-2021-02-05 Emission Data 1975-2019 (Version Feb-05-2021). [Zenodo. http://doi.org/10.5281/zenodo.4509372](http://doi.org/10.5281/zenodo.4509372).

# Journal Papers
[Hoesly et al, Historical (1750–2014) anthropogenic emissions of reactive gases and aerosols from the Community Emissions Data System (CEDS). ](https://www.geosci-model-dev.net/11/369/2018/gmd-11-369-2018.html) _Geosci. Model Dev._ 11, 369-408, 2018a.
Expand Down
39 changes: 30 additions & 9 deletions code/diagnostic/Compare_to_RCP.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ initialize( script_name, log_msg, headers )

args_from_makefile <- commandArgs( TRUE )
em <- args_from_makefile[ 1 ]
if ( is.na( em ) ) em <- "CH4"
if ( is.na( em ) ) em <- "N2O"

# Run for all ems besides N2O
if (em != "N2O"){
# Run for all ems (RCP for N2O and CO2 is blank, but we want graphs for CEDS values anyway)
if (em != "N2Ox"){

# Load Packages

Expand All @@ -54,7 +54,8 @@ library('gridExtra')
rcp_start_year <- 1850
rcp_end_year <- 2000
CEDS_start_year <- 1850
if ( em == 'CH4') CEDS_start_year <- 1970
# If not doing for publication, look at all years.
#if ( em == 'CH4') CEDS_start_year <- 1970
CEDS_end_year <- end_year

rcp_years <- seq(from=rcp_start_year,to=rcp_end_year,by=10)
Expand Down Expand Up @@ -109,7 +110,8 @@ ceds_remove_sectors <- c("1A3ai_International-aviation",
# if current em does not have ship emissions
# for the RCP shipping emissions data Historicalshipemissions_IPCC_FINAL_Jan09_updated_1850.xlsx
# it doesn't contain data for NH3
has_ship <- em != "NH3"
has_ship <- TRUE
if( em %in% c( 'NH3', 'N2O', 'CO2' ) ) has_ship <- FALSE

if ( has_ship ) {
ceds_remove_sectors_global <- c("1A3ai_International-aviation",
Expand All @@ -126,21 +128,25 @@ if ( has_ship ) {

}

RCP_em <- em

# Process RCP CH4 emissions then zero out so can draw graphs
if ( em %in% c( 'N2O', 'CO2' ) ) RCP_em <- "CH4"

# ---------------------------------------------------------------------------
# 2. Load and process RCP files
rcp_dir <- './emissions-inventories/RCP/'

# create temporary folder to extract zipped files
zipfile_path <- paste0(rcp_dir, em, '.zip')
dir.name <- paste0(rcp_dir, em, '_RCP_temp_folder')
zipfile_path <- paste0(rcp_dir, RCP_em, '.zip')
dir.name <- paste0(rcp_dir, RCP_em, '_RCP_temp_folder')
dir.create(dir.name)
# unzip files to temp folder
unzip(zipfile_path, exdir = dir.name)

# list files in the folder
files <- list.files(paste0(dir.name,'/',em) ,pattern = '.dat')
files <- paste0(dir.name,'/',em,'/',files)
files <- list.files(paste0(dir.name,'/',RCP_em) ,pattern = '.dat')
files <- paste0(dir.name,'/',RCP_em,'/',files)

rcp_files <- list()
for (i in seq_along(rcp_years)){
Expand Down Expand Up @@ -204,6 +210,13 @@ rcp_ship_emissions$units <- "kt"
rcp_ship_emissions$SO2 <- rcp_ship_emissions$SO2 * 2 #Convert from S to SO2 for SO2
rcp_ship_emissions$NOx <- rcp_ship_emissions$NOx * 3.285 # Convert from N to NO2 for NOx

if ( em %in% c( 'CO2', 'N2O' ) ) {
# Rill RCP dataset with zeros
RCP <- RCP %>%
dplyr::mutate_if( is.numeric, function(x) ifelse(is.numeric(x), 0, x ) )
rcp_ship_emissions$em <- rcp_ship_emissions$NOx * 0.0
}

# ---------------------------------------------------------------------------
# 4. Process CEDS Emissions Data
x_years<-paste('X',CEDS_start_year:CEDS_end_year,sep="")
Expand Down Expand Up @@ -481,6 +494,14 @@ writeData( region_sector_both,'DIAG_OUT', paste0('RCP_',em,'_region_sector_Compa

}

# Write out total by country with region tag for diagnostics
#add region to ceds data
country_ceds <- aggregate(ceds_comparable[x_years],
by = list(iso = ceds_comparable$iso ),FUN=sum )
country_ceds$Region <- complete_region_map[match(country_ceds$iso,tolower(complete_region_map$Code)),'Region']
country_ceds[which(is.na(country_ceds$Region)),'Region']<- 'Not Mapped'
writeData( country_ceds,'DIAG_OUT', paste0(em,'_CEDS_comparable_country_total'),domain_extension = 'ceds-comparisons/',meta=F)

# ---------------------------------------------------------------------------
# 10. End

Expand Down
Loading

0 comments on commit da316e2

Please sign in to comment.