Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H2 effects on CH4 lifetime #758

Open
wants to merge 7 commits into
base: dev-h2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
kdorheim marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: hector
Title: The Hector Simple Climate Model
Version: 3.2.0
Version: 3.3.0.9999999
kdorheim marked this conversation as resolved.
Show resolved Hide resolved
Authors@R: c(person("Kalyn", "Dorheim",
email = "[email protected]",
role = c("aut", "cre"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# hector 3.3.0.9999999

* under development for the H2 integration, increasing the version index though will be ensure that the right version of hector is being run with gcam

# hector 3.2.0
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10698028.svg)](https://doi.org/10.5281/zenodo.10698028)
* Correct aerosol forcing coefficients based on Zelinka et al. (2023)
Expand Down
7 changes: 7 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#' @describeIn emissions Emissions hydrogen gas (\code{"Tg H2"})
NULL

#' @describeIn oh coefficient for the h2 emissions
NULL

#' @describeIn msgtype Message type for retrieving data from a component
#' @keywords internal
GETDATA <- function() {
Expand Down Expand Up @@ -1571,6 +1574,10 @@ HEAT_FLUX <- function() {
.Call('_hector_HEAT_FLUX', PACKAGE = 'hector')
}

COEFF_H2 <- function() {
.Call('_hector_COEFF_H2', PACKAGE = 'hector')
}

newcore_impl <- function(inifile, loglevel, suppresslogging, name) {
.Call('_hector_newcore_impl', PACKAGE = 'hector', inifile, loglevel, suppresslogging, name)
}
Expand Down
9 changes: 5 additions & 4 deletions inst/include/component_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,11 @@
// oh component
#define D_LIFETIME_OH "TAU_OH"
#define D_INITIAL_LIFETIME_OH "TOH0"
#define D_COEFFICENT_NOX "CNOX"
#define D_COEFFICENT_CH4 "CCH4"
#define D_COEFFICENT_NMVOC "CNMVOC"
#define D_COEFFICENT_CO "CCO"
#define D_COEFFICIENT_NOX "CNOX"
#define D_COEFFICIENT_CH4 "CCH4"
#define D_COEFFICIENT_NMVOC "CNMVOC"
#define D_COEFFICIENT_CO "CCO"
#define D_COEFFICIENT_H2 "CH2"
#define D_EMISSIONS_H2 "H2_emissions"


Expand Down
2 changes: 1 addition & 1 deletion inst/include/h_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* \brief The model version number to be included in logs and outputs.
* \note Manually update the git tag to match this.
*/
#define MODEL_VERSION "3.2.0"
#define MODEL_VERSION "3.3.0.9999999"

#define OUTPUT_DIRECTORY "output/"

Expand Down
10 changes: 6 additions & 4 deletions inst/include/oh_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ class OHComponent : public IModelComponent {
unitval M0; // initial CH4 concentration
unitval TOH0; // preindustrial OH lifetime

double CCO; // coefficent for CO
double CNMVOC; // coefficent for NMVOC
double CNOX; // coefficent for NOX
double CCH4; // coefficent for CH4
double CCO; // coefficient for CO
double CNMVOC; // coefficient for NMVOC
double CNOX; // coefficient for NOX
double CCH4; // coefficient for CH4
unitval CH2; // coefficient for CH4


// logger
Logger logger;
Expand Down
9 changes: 5 additions & 4 deletions inst/input/hector_ssp119.ini
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ H2_emissions=csv:tables/ssp119_emiss-constraints_rf.csv ; emissions time se


TOH0=6.6 ; inital OH lifetime (years)
CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CNOX=0.0042 ; coefficient for NOX
CCO=-0.000105 ; coefficient for CO
CNMVOC=-0.000315 ; coefficient for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficient for CH4
CH2=-0.00044625 ; coefficient for H2 TODO-H2

;------------------------------------------------------------------------
[ozone]
Expand Down
10 changes: 6 additions & 4 deletions inst/input/hector_ssp126.ini
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ NMVOC_emissions=csv:tables/ssp126_emiss-constraints_rf.csv ; emissions time se
H2_emissions=csv:tables/ssp119_emiss-constraints_rf.csv ; emissions time series

TOH0=6.6 ; inital OH lifetime (years)
CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CNOX=0.0042 ; coefficient for NOX
CCO=-0.000105 ; coefficient for CO
CNMVOC=-0.000315 ; coefficient for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficient for CH4
CH2=-0.00044625 ; coefficient for H2 TODO-H2


;------------------------------------------------------------------------
[ozone]
Expand Down
10 changes: 6 additions & 4 deletions inst/input/hector_ssp245.ini
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ H2_emissions=csv:tables/ssp119_emiss-constraints_rf.csv ; emissions time se


TOH0=6.6 ; inital OH lifetime (years)
CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CNOX=0.0042 ; coefficient for NOX
CCO=-0.000105 ; coefficient for CO
CNMVOC=-0.000315 ; coefficient for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficient for CH4
CH2=-0.00044625 ; coefficient for H2 TODO-H2


;------------------------------------------------------------------------
[ozone]
Expand Down
10 changes: 6 additions & 4 deletions inst/input/hector_ssp370.ini
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ H2_emissions=csv:tables/ssp119_emiss-constraints_rf.csv ; emissions time se


TOH0=6.6 ; inital OH lifetime (years)
CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CNOX=0.0042 ; coefficient for NOX
CCO=-0.000105 ; coefficient for CO
CNMVOC=-0.000315 ; coefficient for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficient for CH4
CH2=-0.00044625 ; coefficient for H2 TODO-H2


;------------------------------------------------------------------------
[ozone]
Expand Down
16 changes: 9 additions & 7 deletions inst/input/hector_ssp434.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ preind_interdeep_c=37100 ; intermediate and deep ocean C, IPCC AR6 Figure 5.12
atmos_co2=590.33 ; initial atmospheric carbon pool Pg C of CO2 size used in spin up, consistent with C0
C0=277.15 ; preindustrial CO2 from table 7.SM.1 IPCC AR6; CO2 radiative forcing is calibrated to this value
npp_flux0=56.2 ; preindustrial net primary production, Pg C/yr from Ito et al. 2011
;pf.npp_flux0=5.6 ; cf. Figure 3 in Chen et al. 2017 10.1088/1748-9326/aa8978
;pf.npp_flux0=5.6 ; cf. Figure 3 in Chen et al. 2017 10.1088/1748-9326/aa8978
;nonpf.npp_flux0=50.6

veg_c=550 ; initial vegetation pool, Pg C
Expand Down Expand Up @@ -73,7 +73,7 @@ f_litterd=0.98 ; Fraction of litter flux to detritus (balance to soil)
;nonpf.f_litterd=0.98

; Anthropogenic contributions: emissions, direct air carbon capture and storage, and land use change, Pg C/yr
ffi_emissions=csv:tables/ssp434_emiss-constraints_rf.csv
ffi_emissions=csv:tables/ssp434_emiss-constraints_rf.csv
daccs_uptake=csv:tables/ssp434_emiss-constraints_rf.csv
luc_emissions=csv:tables/ssp434_emiss-constraints_rf.csv
luc_uptake=csv:tables/ssp434_emiss-constraints_rf.csv
Expand Down Expand Up @@ -134,10 +134,12 @@ H2_emissions=csv:tables/ssp119_emiss-constraints_rf.csv ; emissions time se


TOH0=6.6 ; inital OH lifetime (years)
CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CNOX=0.0042 ; coefficient for NOX
CCO=-0.000105 ; coefficient for CO
CNMVOC=-0.000315 ; coefficient for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficient for CH4
CH2=-0.00044625 ; coefficient for H2 TODO-H2


;------------------------------------------------------------------------
[ozone]
Expand Down Expand Up @@ -234,7 +236,7 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp434_emiss-constraints_rf.csv

[HFC4310_halocarbon]
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
Expand Down
16 changes: 9 additions & 7 deletions inst/input/hector_ssp460.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ preind_interdeep_c=37100 ; intermediate and deep ocean C, IPCC AR6 Figure 5.12
atmos_co2=590.33 ; initial atmospheric carbon pool Pg C of CO2 size used in spin up, consistent with C0
C0=277.15 ; preindustrial CO2 from table 7.SM.1 IPCC AR6; CO2 radiative forcing is calibrated to this value
npp_flux0=56.2 ; preindustrial net primary production, Pg C/yr from Ito et al. 2011
;pf.npp_flux0=5.6 ; cf. Figure 3 in Chen et al. 2017 10.1088/1748-9326/aa8978
;pf.npp_flux0=5.6 ; cf. Figure 3 in Chen et al. 2017 10.1088/1748-9326/aa8978
;nonpf.npp_flux0=50.6

veg_c=550 ; initial vegetation pool, Pg C
Expand Down Expand Up @@ -73,7 +73,7 @@ f_litterd=0.98 ; Fraction of litter flux to detritus (balance to soil)
;nonpf.f_litterd=0.98

; Anthropogenic contributions: emissions, direct air carbon capture and storage, and land use change, Pg C/yr
ffi_emissions=csv:tables/ssp460_emiss-constraints_rf.csv
ffi_emissions=csv:tables/ssp460_emiss-constraints_rf.csv
daccs_uptake=csv:tables/ssp460_emiss-constraints_rf.csv
luc_emissions=csv:tables/ssp460_emiss-constraints_rf.csv
luc_uptake=csv:tables/ssp460_emiss-constraints_rf.csv
Expand Down Expand Up @@ -134,10 +134,12 @@ H2_emissions=csv:tables/ssp119_emiss-constraints_rf.csv ; emissions time se


TOH0=6.6 ; inital OH lifetime (years)
CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CNOX=0.0042 ; coefficient for NOX
CCO=-0.000105 ; coefficient for CO
CNMVOC=-0.000315 ; coefficient for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficient for CH4
CH2=-0.00044625 ; coefficient for H2 TODO-H2


;------------------------------------------------------------------------
[ozone]
Expand Down Expand Up @@ -234,7 +236,7 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp460_emiss-constraints_rf.csv

[HFC4310_halocarbon]
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
Expand Down
10 changes: 6 additions & 4 deletions inst/input/hector_ssp534-over.ini
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ H2_emissions=csv:tables/ssp119_emiss-constraints_rf.csv ; emissions ti


TOH0=6.6 ; inital OH lifetime (years)
CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CNOX=0.0042 ; coefficient for NOX
CCO=-0.000105 ; coefficient for CO
CNMVOC=-0.000315 ; coefficient for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficient for CH4
CH2=-0.00044625 ; coefficient for H2 TODO-H2


;------------------------------------------------------------------------
[ozone]
Expand Down
10 changes: 6 additions & 4 deletions inst/input/hector_ssp585.ini
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ NMVOC_emissions=csv:tables/ssp585_emiss-constraints_rf.csv ; emissions time se
H2_emissions=csv:tables/ssp119_emiss-constraints_rf.csv ; emissions time series

TOH0=6.6 ; inital OH lifetime (years)
CNOX=0.0042 ; coefficent for NOX
CCO=-0.000105 ; coefficent for CO
CNMVOC=-0.000315 ; coefficent for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficent for CH4
CNOX=0.0042 ; coefficient for NOX
CCO=-0.000105 ; coefficient for CO
CNMVOC=-0.000315 ; coefficient for NMVOC (non methane VOC)
CCH4=-0.32 ; coefficient for CH4
CH2=-0.00044625 ; coefficient for H2 TODO-H2


;------------------------------------------------------------------------
[ozone]
Expand Down
11 changes: 11 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2627,6 +2627,16 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// COEFF_H2
String COEFF_H2();
RcppExport SEXP _hector_COEFF_H2() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(COEFF_H2());
return rcpp_result_gen;
END_RCPP
}
// newcore_impl
Environment newcore_impl(String inifile, int loglevel, bool suppresslogging, String name);
RcppExport SEXP _hector_newcore_impl(SEXP inifileSEXP, SEXP loglevelSEXP, SEXP suppressloggingSEXP, SEXP nameSEXP) {
Expand Down Expand Up @@ -3035,6 +3045,7 @@ static const R_CallMethodDef CallEntries[] = {
{"_hector_FLUX_MIXED", (DL_FUNC) &_hector_FLUX_MIXED, 0},
{"_hector_FLUX_INTERIOR", (DL_FUNC) &_hector_FLUX_INTERIOR, 0},
{"_hector_HEAT_FLUX", (DL_FUNC) &_hector_HEAT_FLUX, 0},
{"_hector_COEFF_H2", (DL_FUNC) &_hector_COEFF_H2, 0},
{"_hector_newcore_impl", (DL_FUNC) &_hector_newcore_impl, 4},
{"_hector_shutdown", (DL_FUNC) &_hector_shutdown, 1},
{"_hector_reset", (DL_FUNC) &_hector_reset, 2},
Expand Down
2 changes: 1 addition & 1 deletion src/ch4_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void CH4Component::run(const double runToDate) {
<< std::endl;

// Permafrost thaw produces CH4 emissions
#define PG_C_TO_TG_CH4 (1000.0 * 16.04 / 12.01)
#define PG_C_TO_TG_CH4 (1000.0 * 16.04 / 12.01);
const double rh_ch4 =
core->sendMessage(M_GETDATA, D_RH_CH4).value(U_PGC_YR) * PG_C_TO_TG_CH4;

Expand Down
Loading
Loading