Skip to content
Merged
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
4 changes: 2 additions & 2 deletions DESCRIPTION
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.9000
Version: 3.3.0.9999999
Authors@R: c(person("Kalyn", "Dorheim",
email = "kalyn.dorheim@pnnl.gov",
role = c("aut", "cre"),
Expand Down Expand Up @@ -70,7 +70,7 @@ Collate:
'units.R'
VignetteBuilder: knitr
Config/Needs/website: kableExtra, nleqslv
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
SystemRequirements: GNU make
URL: https://github.com/JGCRI/hector, https://jgcri.github.io/hector/
BugReports: https://github.com/JGCRI/hector/issues
Expand Down
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export(CH3BR_CONSTRAIN)
export(CH3CCL3_CONSTRAIN)
export(CH3CL_CONSTRAIN)
export(CH4_CONSTRAIN)
export(CH4_LIFETIME_OH)
export(CO2_CONSTRAIN)
export(CO3)
export(CO3_HL)
Expand Down Expand Up @@ -75,6 +76,7 @@ export(EMISSIONS_CH3CCL3)
export(EMISSIONS_CH3CL)
export(EMISSIONS_CH4)
export(EMISSIONS_CO)
export(EMISSIONS_H2)
export(EMISSIONS_HALON1211)
export(EMISSIONS_HALON1301)
export(EMISSIONS_HALON2402)
Expand Down Expand Up @@ -125,7 +127,6 @@ export(HFC32_CONSTRAIN)
export(HFC4310_CONSTRAIN)
export(HL_OCEAN_UPTAKE)
export(LAND_TAS)
export(LIFETIME_OH)
export(LIFETIME_SOIL)
export(LIFETIME_STRAT)
export(LL_DEBUG)
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)

Expand Down
11 changes: 5 additions & 6 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' @describeIn emissions Emissions hydrogen gas (\code{"Tg H2"})
NULL

#' @describeIn msgtype Message type for retrieving data from a component
#' @keywords internal
GETDATA <- function() {
Expand Down Expand Up @@ -1085,14 +1082,16 @@ EMISSIONS_NMVOC <- function() {
.Call('_hector_EMISSIONS_NMVOC', PACKAGE = 'hector')
}

#' @describeIn emissions Emissions hydrogen gas (\code{"Tg H2"})
#' @export
EMISSIONS_H2 <- function() {
.Call('_hector_EMISSIONS_H2', PACKAGE = 'hector')
}

#' @describeIn oh OH lifetime (\code{"Yr"})
#' @describeIn methane CH4 lifetime with respect to the OH sink (\code{"Yr"})
#' @export
LIFETIME_OH <- function() {
.Call('_hector_LIFETIME_OH', PACKAGE = 'hector')
CH4_LIFETIME_OH <- function() {
.Call('_hector_CH4_LIFETIME_OH', PACKAGE = 'hector')
}

#' @describeIn emissions Emissions for organic carbon (\code{"Tg"})
Expand Down
1 change: 1 addition & 0 deletions data-raw/input_params.csv
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ OH,CNOX,n,n,y,0.0042,,coefficient for NOX
OH,CCO,n,n,y,-1.05E-04,,coefficient for CO
OH,CNMVOC,n,n,y,-3.15E-04,,coefficient for NMVOC (non methane VOC)
OH,CCH4,n,n,y,-0.32,,coefficient for CH4
OH,CH2,n,n,y,-0.00044625,,coefficient for H2
OH,H2_emissions,n,y,y,"""(csv)""",Tg H2,emissions time series
ozone,PO3,n,n,y,30,,preindustrial O3 concentration
ozone,NOX_emissions,n,y,y,"""(csv)""",,emissions time series
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
3 changes: 2 additions & 1 deletion inst/include/h_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
* \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.9000"

#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
10 changes: 6 additions & 4 deletions inst/input/hector_ssp434.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_ssp460.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_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
5 changes: 5 additions & 0 deletions man/emissions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions man/methane.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1830,13 +1830,13 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// LIFETIME_OH
String LIFETIME_OH();
RcppExport SEXP _hector_LIFETIME_OH() {
// CH4_LIFETIME_OH
String CH4_LIFETIME_OH();
RcppExport SEXP _hector_CH4_LIFETIME_OH() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = Rcpp::wrap(LIFETIME_OH());
rcpp_result_gen = Rcpp::wrap(CH4_LIFETIME_OH());
return rcpp_result_gen;
END_RCPP
}
Expand Down Expand Up @@ -2957,7 +2957,7 @@ static const R_CallMethodDef CallEntries[] = {
{"_hector_EMISSIONS_CO", (DL_FUNC) &_hector_EMISSIONS_CO, 0},
{"_hector_EMISSIONS_NMVOC", (DL_FUNC) &_hector_EMISSIONS_NMVOC, 0},
{"_hector_EMISSIONS_H2", (DL_FUNC) &_hector_EMISSIONS_H2, 0},
{"_hector_LIFETIME_OH", (DL_FUNC) &_hector_LIFETIME_OH, 0},
{"_hector_CH4_LIFETIME_OH", (DL_FUNC) &_hector_CH4_LIFETIME_OH, 0},
{"_hector_EMISSIONS_OC", (DL_FUNC) &_hector_EMISSIONS_OC, 0},
{"_hector_EMISSIONS_NH3", (DL_FUNC) &_hector_EMISSIONS_NH3, 0},
{"_hector_OCEAN_UPTAKE", (DL_FUNC) &_hector_OCEAN_UPTAKE, 0},
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