JGCRI / hector

The Hector Simple Climate Model
http://jgcri.github.io/hector/
GNU General Public License v3.0
111 stars 47 forks source link

Negative land use change emissions in Hector v3 #523

Closed kdorheim closed 2 years ago

kdorheim commented 3 years ago

So some of the ssps have negative land-use change emissions in Hector v3 this should throw an error message and the negative emissions need to be incorporated into the carbon cycle via land use uptake.

image

remotes::install_github("jgcri/hectordata@master")

devtools::load_all()
library(magrittr)
library(ggplot2)

ini <- system.file("input/hector_ssp119.ini", package = "hectordata") 
core <- newcore(ini)
run(core)
out1 <- fetchvars(core, 1900:2100, vars = c(GLOBAL_TEMP(), LUC_EMISSIONS()))
ggplot(data = out1) +
    geom_line(aes(year, value)) +
    geom_hline(yintercept = 0) +
    facet_wrap("variable", scales = "free") + 
    theme_bw() + 
    labs(title = "SSP119 Hector Results")
> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggplot2_3.3.5  hector_3.0.0   magrittr_2.0.1 testthat_3.0.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7        compiler_3.6.3    pillar_1.6.3      prettyunits_1.1.1 remotes_2.4.0    
 [6] tools_3.6.3       digest_0.6.28     pkgbuild_1.1.0    pkgload_1.1.0     memoise_1.1.0    
[11] lifecycle_1.0.1   tibble_3.1.5      gtable_0.3.0      pkgconfig_2.0.3   rlang_0.4.11     
[16] DBI_1.1.0         cli_3.0.1         rstudioapi_0.13   yaml_2.2.1        dplyr_1.0.7      
[21] withr_2.4.2       generics_0.1.0    vctrs_0.3.8       desc_1.2.0        fs_1.5.0         
[26] devtools_2.3.2    tidyselect_1.1.1  rprojroot_2.0.2   grid_3.6.3        glue_1.4.2       
[31] R6_2.5.1          processx_3.4.5    BH_1.75.0-0       fansi_0.5.0       sessioninfo_1.1.1
[36] farver_2.1.0      purrr_0.3.4       callr_3.5.1       scales_1.1.1      ps_1.5.0         
[41] ellipsis_0.3.2    usethis_1.6.3     assertthat_0.2.1  colorspace_2.0-2  labeling_0.4.2   
[46] utf8_1.2.2        munsell_0.5.0     crayon_1.4.1     
kdorheim commented 3 years ago

Consider adding a warning message to say that ffi emissions must be positive

ssmithClimate commented 3 years ago

Note that for CMIP6 emissions gridding for GCMs, we separated net negative CO2 emissions into a separate sector so that GCMs with carbon -cycle could deal with this properly. (Otherwise it could cause a numerical problem for GCMs. Not the same problem that occurs in hector, but analogous in that the negative emissions are a different physical process as compared to fossil emissions.) Perhaps could do the same for hector? (e.g., if a user has net negative emissions, they need to supply the negative part separately from the positive part so that the negative emissions can be dealt with as a net transfer from atmosphere to geologic box, which is what is happening, instead of as part of the normal carbon cycle?).

bpbond commented 3 years ago

Thanks @ssmithClimate — that's interesting, I didn't know that about CMIP6! Yes, in essence this is exactly what we'll do here: have separate LUC emissions and LUC uptake time series.

Thanks @kdorheim for checking!

ssmithClimate commented 3 years ago

Note that carbon capture is a direct transfer from the atmosphere to the geologic reservoir. (So no c-cycle impacts other than the concentration drawdown). So its a bit different than land-use uptake. Which I'm realizing now isn't the point of this issue (apologies if I'm muddying the water), but I guess net negative FFI emissions aren't an issue for hector?

bpbond commented 3 years ago

No we have that (negative FFI) too, as a separate flux just as you describe.

bpbond commented 2 years ago

The SSP files already have LUC emissions and uptake split, but the INI files and C++ code only recognize luc_emissions. That's the issue, right? Are we currently completely ignoring the luc_uptake columns?

kdorheim commented 2 years ago

It has been a while since I have looked at this...

I will need to refresh myself but I think the problem was that with the rule that fluxes all had to be positive that the negative values in the luc_emissions column were throwing an error

kdorheim commented 2 years ago

So within the tables, I created a luc_uptake column but Hector does not read those values in so in affect we are ignoring any negative luc emissions at the moment ah! 😱