Skip to content

Commit

Permalink
Merge pull request #733 from JGCRI/dev
Browse files Browse the repository at this point in the history
Hector V3.2.0
  • Loading branch information
kdorheim committed Feb 23, 2024
2 parents 0ea644b + 86dd56a commit 461248a
Show file tree
Hide file tree
Showing 28 changed files with 6,265 additions and 5,637 deletions.
2 changes: 1 addition & 1 deletion 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.1.1
Version: 3.2.0
Authors@R: c(person("Kalyn", "Dorheim",
email = "[email protected]",
role = c("aut", "cre"),
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# hector 3.2.0

* Correct aerosol forcing coefficients based on Zelinka et al. (2023)
* Enable permafrost module and recalibrate model's default parameterization

# hector 3.1.1

Return global mean surface temperature as a Hector output.
Expand Down
5 changes: 3 additions & 2 deletions R/biome.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ split_biome <- function(core,
sum(fnpp_flux0) == 1, all(fnpp_flux0 > 0)
)

# If user supplied values in ... for warmingfactor, etc., use thos
# If user supplied values in ... for warmingfactor, etc., use those
# Otherwise use the old biome's values
cv <- get_biome_inits(core, old_biome) # current values
dots <- list(...)
Expand Down Expand Up @@ -142,7 +142,8 @@ get_biome_inits <- function(core, biome) {
sendmessage(core, GETDATA(), VEG_C(biome), 0, NA, ""),
sendmessage(core, GETDATA(), DETRITUS_C(biome), 0, NA, ""),
sendmessage(core, GETDATA(), SOIL_C(biome), 0, NA, ""),
sendmessage(core, GETDATA(), PERMAFROST_C(biome), 0, NA, "")
sendmessage(core, GETDATA(), PERMAFROST_C(biome), 0, NA, ""),
sendmessage(core, GETDATA(), THAWEDP_C(biome), 0, NA, "")
)
current_data_2 <- fetchvars(core, NA, c(
NPP_FLUX0(biome),
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ hector_tas_results$scenario <- ifelse(hector_tas_results$scenario == "ssp534-ove
hector_tas_results$scenario <- ifelse(hector_tas_results$year <= 2016, "historical",
hector_tas_results$scenario)
ggplot(hector_tas_results) +
geom_line(aes(year, value, color = scenario), size = 1) +
geom_line(aes(year, value, color = scenario), linewidth = 1) +
theme_bw(base_size = 15) +
labs(color = NULL, x = NULL, y = expression("Temperature Anomaly ("~degree~"C)")) +
scale_color_manual(values = SSP_COLORS)
Expand Down
2 changes: 1 addition & 1 deletion data-raw/generate-comp-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ hector_commit <- system("git rev-parse --short HEAD", intern = TRUE)


vars_to_save <- c(CONCENTRATIONS_CO2(), GLOBAL_TAS(), RF_TOTAL(), RF_CO2(), HEAT_FLUX(),
OCEAN_C(), PH_HL(), ATMOSPHERIC_CO2(), SST())
OCEAN_C(), PH_HL(), ATMOSPHERIC_CO2(), SST(), PERMAFROST_C())
dates_to_save <- 1745:2300

# Second run.
Expand Down
100 changes: 55 additions & 45 deletions data-raw/input_params.csv
Original file line number Diff line number Diff line change
@@ -1,57 +1,67 @@
section,parameter,biome-specific,time-variant,required,default,units,description
core,run_name,n,n,y,,(unitless),
core,startDate,n,n,y,1745,year,
core,endDate,n,n,y,2300,year,
core,trackingDate,n,n,y,9999,year,year to start tracking (only carbon currently)
core,do_spinup,n,n,y,1,(unitless),"if 1, spin up model before running (default=1)"
core,max_spinup,n,n,y,2000,(unitless),maximum steps allowed for spinup (default=2000)
ocean,enabled,n,n,y,1,(unitless),putting 'enabled=0' will disable any component
ocean,spinup_chem,n,n,y,0,(unitless),run surface chemistry during spinup phase?
ocean,tt,n,n,y,7.20E+07,m3 s-1,thermohaline circulation
ocean,tu,n,n,y,4.90E+07,m3 s-1,high latitude overturning
ocean,twi,n,n,y,1.25E+07,m3 s-1,warm-intermediate exchange
ocean,tid,n,n,y,2.00E+08,m3 s-1,intermediate-deep exchange
ocean,preind_surface_c,n,n,n,900,Pg C,surface ocean carbon
ocean,preind_interdeep_c,n,n,n,37100,Pg C,intermediate + deep ocean carbon
simpleNbox,atmos_co2,n,n,y,588.071,Pg C,
simpleNbox,C0,n,n,y,277.15,Pg C,preindustrial CO2 from table 7.SM.1 IPCC AR6
simpleNbox,boreal.veg_c,y,n,y,100,Pg C,
simpleNbox,tropical.veg_c,y,n,y,450,Pg C,
simpleNbox,veg_c,n,n,y,550,Pg C,vegetation
simpleNbox,boreal.detritus_c,y,n,y,15,Pg C,
simpleNbox,tropical.detritus_c,y,n,y,45,Pg C,
simpleNbox,detritus_c,n,n,y,55,Pg C,detritus
simpleNbox,boreal.soil_c,y,n,y,1200,Pg C,
simpleNbox,tropical.soil_c,y,n,y,578,Pg C,
simpleNbox,soil_c,n,n,y,1782,Pg C,soil
simpleNbox,boreal.permafrost_c,y,n,n,865,Pg C,permafrost
simpleNbox,tropical.permafrost_c,y,n,n,0,Pg C,permafrost
simpleNbox,permafrost_c,n,n,n,0,Pg C,permafrost
simpleNbox,boreal.npp_flux0,y,n,y,5,Pg C yr-1,
simpleNbox,tropical.npp_flux0,y,n,y,45,Pg C yr-1,
simpleNbox,npp_flux0,n,n,y,56.2,Pg C yr-1,net primary production
core,run_name,n,n,y,,(unitless),Name of model run
core,startDate,n,n,y,1745,year,Start date of model run
core,endDate,n,n,y,2300,year,End date of model run
core,trackingDate,n,n,y,9999,year,Year to start tracking carbon
core,do_spinup,n,n,y,1,(unitless),"If 1, spin up model before running (default=1)"
core,max_spinup,n,n,y,2000,(unitless),Maximum steps allowed for spinup (default=2000)
ocean,enabled,n,n,y,1,(unitless),Putting 'enabled=0' will disable any component
ocean,spinup_chem,n,n,y,0,(unitless),Run ocean surface chemistry during spinup phase?
ocean,tt,n,n,y,7.20E+07,m3 s-1,Ocean thermohaline circulation
ocean,tu,n,n,y,4.90E+07,m3 s-1,Ocean high latitude overturning
ocean,twi,n,n,y,1.25E+07,m3 s-1,Ocean warm-intermediate exchange
ocean,tid,n,n,y,2.00E+08,m3 s-1,Ocean intermediate-deep exchange
ocean,preind_surface_c,n,n,n,900,Pg C,Initial surface ocean carbon
ocean,preind_interdeep_c,n,n,n,37100,Pg C,Initial intermediate + deep ocean carbon
simpleNbox,atmos_co2,n,n,y,588.071,Pg C,Initial atmospheric CO2
simpleNbox,C0,n,n,y,277.15,Pg C,Initial atmospheric C pool
simpleNbox,pf.veg_c,y,n,n,55,Pg C,Initial vegetation C pool
simpleNbox,nonpf.veg_c,y,n,n,495,Pg C,Initial vegetation C pool
simpleNbox,veg_c,n,n,y,550,Pg C,Initial vegetation C pool
simpleNbox,pf.detritus_c,y,n,n,5,Pg C,Initial detritus C pool
simpleNbox,nonpf.detritus_c,y,n,n,50,Pg C,Initial detritus C pool
simpleNbox,detritus_c,n,n,y,55,Pg C,Initial detritus C pool
simpleNbox,pf.soil_c,y,n,n,308,Pg C,Initial soil C pool
simpleNbox,nonpf.soil_c,y,n,n,609,Pg C,Initial soil C pool
simpleNbox,soil_c,n,n,y,917,Pg C,Initial soil C pool
simpleNbox,pf.permafrost_c,y,n,n,865,Pg C,Initial permafrost C pool
simpleNbox,nonpf.permafrost_c,y,n,n,0,Pg C,Initial permafrost C pool
simpleNbox,permafrost_c,n,n,y,865,Pg C,Initial permafrost C pool
simpleNbox,pf.npp_flux0,y,n,n,5.6,Pg C yr-1,Preindustrial net primary production
simpleNbox,nonpf.npp_flux0,y,n,n,50.6,Pg C yr-1,Preindustrial net primary production
simpleNbox,npp_flux0,n,n,y,56.2,Pg C yr-1,Preindustrial net primary production
simpleNbox,pf.f_nppv,n,n,y,0.35,(unitless),Fraction of NPP to vegetation
simpleNbox,nonpf.f_nppv,n,n,y,0.35,(unitless),Fraction of NPP to vegetation
simpleNbox,f_nppv,n,n,y,0.35,(unitless),Fraction of NPP to vegetation
simpleNbox,pf.f_nppd,n,n,y,0.35,(unitless),Fraction of NPP to vegetation
simpleNbox,nonpf.f_nppd,n,n,y,0.35,(unitless),Fraction of NPP to vegetation
simpleNbox,f_nppd,n,n,y,0.6,(unitless),Fraction of NPP to detritus (balance to soil)
simpleNbox,pf.f_litterd,n,n,n,0.35,(unitless),Fraction of NPP to vegetation
simpleNbox,nonpf.f_litterd,n,n,n,0.35,(unitless),Fraction of NPP to vegetation
simpleNbox,f_litterd,n,n,y,0.98,(unitless),Fraction of litter flux to detritus (balance to soil)
simpleNbox,ffi_emissions,n,y,y,"""(csv)""",Pg C yr-1,Anthropogenic contributions: emissions
simpleNbox,daccs_uptake,n,y,y,"""(csv)""",Pg C yr-1,Anthropogenic contributions: direct air carbon capture and storage
simpleNbox,luc_emissions,n,y,y,"""(csv)""",Pg C yr-1,Anthropogenic contributions: land use change
simpleNbox,luc_uptake,n,y,y,"""(csv)""",Pg C yr-2,Anthropogenic contributions: land use change
simpleNbox,CO2_constrain,n,y,n,"""(csv)""",ppmv,atmospheric CO2 constraint
simpleNbox,NBP_constrain,n,y,n,"""(csv)""",Pg C yr-1,net biome production (land-atmosphere C flux) constaint
simpleNbox,beta,n,n,y,0.36,(unitless),
simpleNbox,q10_rh,n,n,y,2,(unitless),respiration response Q10
simpleNbox,boreal.warmingfactor,y,n,n,1.2,(unitless),biome-specific warming factors
simpleNbox,RF_albedo,n,n,y,"""(csv)""",W m-2,albedo effect
simpleNbox,CO2_constrain,n,y,n,"""(csv)""",ppmv,Atmospheric CO2 constraint
simpleNbox,NBP_constrain,n,y,n,"""(csv)""",Pg C yr-1,Net biome production (land-atmosphere C flux) constaint
simpleNbox,pf.beta,n,n,n,0.36,(unitless),CO2 fertilization factor
simpleNbox,nonpf.beta,n,n,n,0.36,(unitless),CO2 fertilization factor
simpleNbox,beta,n,n,y,0.36,(unitless),CO2 fertilization factor
simpleNbox,pf.q10_rh,n,n,n,2,(unitless),Respiration temperature response (Q10)
simpleNbox,nonpf.q10_rh,n,n,n,2,(unitless),Respiration temperature response (Q10)
simpleNbox,q10_rh,n,n,y,2,(unitless),Respiration temperature response (Q10)
simpleNbox,pf.warmingfactor,y,n,n,2,(unitless),biome-specific warming factors
simpleNbox,RF_albedo,n,n,y,"""(csv)""",W m-2,Albedo radiative forcing effect
simpleNbox,permafrost_c,y,n,y,0,Pg C,Preindustrial permafrost carbon pool
simpleNbox,fpf_static,y,n,n,0.74,(unitless),fraction of permafrost that is static (non-labile)
simpleNbox,rh_ch4_frac,y,n,n,0.023,(unitless),fraction of thawed permafrost decomposed as CH4
simpleNbox,pf_mu,y,n,n,1.67,(unitless),permafrost thaw parameter; see Woodard et al. 2021
simpleNbox,pf_sigma,y,n,n,0.986,(unitless),permafrost thaw parameter; see Woodard et al. 2021
carbon-cycle-solver,eps_abs,n,n,y,1.00E-06,(unitless),solution tolerance
carbon-cycle-solver,eps_rel,n,n,y,1.00E-06,(unitless),solution tolerance
carbon-cycle-solver,dt,n,n,y,0.25,(unitless),default time step
carbon-cycle-solver,eps_spinup,n,n,y,0.001,Pg C,"spinup tolerance (drift), Pg C"
simpleNbox,fpf_static,y,n,n,0.74,(unitless),Fraction of permafrost that is static (non-labile)
simpleNbox,rh_ch4_frac,y,n,n,0.023,(unitless),Fraction of thawed permafrost decomposed as CH4
simpleNbox,pf_mu,y,n,n,1.67,(unitless),Permafrost thaw parameter; see Woodard et al. 2021
simpleNbox,pf_sigma,y,n,n,0.986,(unitless),Permafrost thaw parameter; see Woodard et al. 2021
carbon-cycle-solver,eps_abs,n,n,y,1.00E-06,(unitless),Solver solution tolerance
carbon-cycle-solver,eps_rel,n,n,y,1.00E-06,(unitless),Solver solution tolerance
carbon-cycle-solver,dt,n,n,y,0.25,(unitless),Solver default time step
carbon-cycle-solver,eps_spinup,n,n,y,0.001,Pg C,"Model spinup tolerance (drift), Pg C"
so2,SO2_emissions,n,y,y,"""(csv)""",,emissions time series
so2,SV,n,y,y,"""(csv)""",,volcanic radiative forcing time series
CH4,M0,n,n,y,731.41,ppb,"preindustrial methane IPCC AR6 Table 7.SM.1, the CH4 forcing equations is calibrated to a M0 of 731.41 ppb"
Expand Down
Binary file modified data/inputstable.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/include/forcing_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ForcingComponent : public IModelComponent {

// Aerosol parameters for aerosol-cloud interactions (RFaci) see equation
// Equation 7.SM.1.2 of IPCC AR6
double const aci_beta = 2.09841432; // (W m-2) IPCC AR6 7.SM.1.3.1
double const aci_beta = 2.279759; // see Dorheim et al. in prep
double const s_BCOC = 111.05064063; // (Tg C yr-1) IPCC AR6 7.SM.1.3.1
double const s_SO2 =
(260.34644166 * 1000) *
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.1.1"
#define MODEL_VERSION "3.2.0"

#define OUTPUT_DIRECTORY "output/"

Expand Down
13 changes: 6 additions & 7 deletions inst/include/simpleNbox.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,14 @@ class SimpleNbox : public CarbonCycleModel {
// Carbon pools -- global
fluxpool earth_c; //!< earth pool, Pg C; for mass-balance
fluxpool atmos_c; //!< atmosphere pool, Pg C

double cumulative_pf_ch4; //!< cumulative release of CH4-C thawed permafrost, Pg C

// Carbon pools -- biome-specific
fluxpool_stringmap veg_c; //!< vegetation pools, Pg C
fluxpool_stringmap detritus_c; //!< detritus pools, Pg C
fluxpool_stringmap soil_c; //!< soil pool, Pg C
// Permafrost functionality is documented in:
// Woodard, D. L., Shiklomanov, A. N., Kravitz, B., Hartin, C., and
// Bond-Lamberty, B.: A permafrost implementation in the simple carbon–climate
// model Hector v.2.3pf, GMD 14:4751–4767, 2021.
// Permafrost functionality is documented in Woodard et al. 2021:
// A permafrost implementation in the simple carbon–climate model Hector v.2.3pf,
// http://dx.doi.org/10.5194/gmd-14-4751-2021
fluxpool_stringmap permafrost_c; //!< permafrost C pool, Pg C
// Track thawed peramfrost separately from soil, so that
Expand All @@ -146,8 +145,7 @@ class SimpleNbox : public CarbonCycleModel {
unitval Ca_residual; //!< residual (when constraining [CO2]), Pg C
double_stringmap tempfertd,
tempferts; //!< temperature effect on respiration (unitless)
double_stringmap f_frozen,
new_thaw; //!< relative amounts and changes in permafrost
double_stringmap f_frozen; //!< fraction of original permafrost that remains frozen

/*****************************************************************
* Records of component state
Expand Down Expand Up @@ -193,6 +191,7 @@ class SimpleNbox : public CarbonCycleModel {
*****************************************************************/

double_stringmap co2fert; //!< CO2 fertilization effect (unitless)
double_stringmap f_new_thaw; //!< New thaw fraction (unitless)
tseries<double> Tland_record; //!< Record of mean land surface/air temperature
//!< values, for computing soil RH
bool in_spinup; //!< flag tracking spinup state
Expand Down
17 changes: 6 additions & 11 deletions inst/include/temperature_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,12 @@ class TemperatureComponent : public IModelComponent {

// Create a place to store temp time series that are over written when
// a user provided land ocean warming ratio is being used.
unitval lo_tas_land; //!< place to store land temp when lo is provided by
//!< users, deg C
unitval lo_tas_ocean; //!< place to store ocean air temp when lo is provided
//!< by users, deg C
unitval lo_seast; //!< place to store sst when lo is provided by users, deg C
std::vector<double> lo_temp_landair; //!< place to store land temp when lo is
//!< provided by users, deg C
std::vector<double> lo_temp_oceanair; //!< place to store land temp when lo is
//!< provided by users, deg C
std::vector<double>
lo_sst; //!< place to store land temp when lo is provided by users, deg C
unitval lo_tas_land; //!< land temp when lo is provided by users, deg C
unitval lo_tas_ocean; //!< ocean air temp when lo is provided by users, deg C
unitval lo_seast; //!< sst when lo is provided by users, deg C
std::vector<double> lo_temp_landair; //!< land temp when lo is provided by users, deg C
std::vector<double> lo_temp_oceanair; //!< land temp when lo is provided by users, deg C
std::vector<double> lo_sst; //!< land temp when lo is provided by users, deg C

tseries<unitval>
tas_constrain; //! Temperature change to constrain model to, degC
Expand Down
Loading

0 comments on commit 461248a

Please sign in to comment.