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

Values for 1745/1746 #735

Open
rgieseke opened this issue Mar 4, 2024 · 1 comment
Open

Values for 1745/1746 #735

rgieseke opened this issue Mar 4, 2024 · 1 comment

Comments

@rgieseke
Copy link
Contributor

rgieseke commented Mar 4, 2024

There have been a few issues about this already (e.g. #354, #556, #177)

The documentation currently states:

An important note about time: The outputstream code currently writes the end date of the current timestep in the outputstream.csv file; e.g., when we’re running 1 January 1745 - 31 December 1745, what gets written is “1746”. This is not intuitive (most people think of “1746” denoting January 1-December 31) but numerically correct: the date is 1746.0, i.e. midnight on December 31 1745. A consequence is that carbon fluxes logged at this timepoint are effectively for the calendar year 1745 (1745-01-01 to 1745-12-31).

https://jgcri.github.io/hector/articles/outputstream.html?#output-stream-categories

As discussed in the linked issues, for NBP (formerly 'atm_land_flux') in simpleNbox it's not possible to retrieve a value for 1745 using RHector.

packageVersion("hector")

‘3.2.0core <- newcore('hector_ssp126.ini')

fetchvars(core, 1745:2100, vars = c(NBP()))

Error: sendmessage: msg:  	Interpolation requested but not allowed (?) date: 1745

func: 	get
file: 	tseries.hpp
ffile:	../inst/include/tseries.hpp

line: 	332

With

fetchvars(core, 1746:2100, vars = c(NBP()))

I get (as expected and documented):

fetchvars(core, 1746:2100, vars = c(NBP()))
               scenario year variable         value   units
1   Unnamed Hector core 1746      NBP -0.0802025172 Pg C/yr
2   Unnamed Hector core 1747      NBP -0.0762544017 Pg C/yr

However, in the command line outputstream I do get a value for 1745:

# Output from hector version 3.2.0 on Mon Feb 26 15:22:42 2024
year,run_name,spinup,component,variable,value,units
1745,ssp119,1,simpleNbox,NBP,0.0009932,Pg C/yr
1746,ssp119,0,simpleNbox,NBP,-0.0802,Pg C/yr
1747,ssp119,0,simpleNbox,NBP,-0.07625,Pg C/yr

For the Pyhector v3 update (openclimatedata/pyhector#63) I need to find a way to handle NBP not reporting for 1745, which in my current setup requests all years for all variables and errors with the same error as RHector above
.
I can surely work around this somehow, but was wondering why the command line version reports a value for 1745.
Also, is NBP the only value for which the start year (1745) is not being reported?

[Edited: I had 1746 in some places instead of 1745, sorry!]

@rgieseke
Copy link
Contributor Author

rgieseke commented Mar 4, 2024

FWIW, @swillner figured out that if we request the simpleNbox.NBP data without a date we can get the data without an error with Pyhector, the same as in the command line Hector outputstream.

In [2]: pyhector.run(pyhector.ssp126, outputs=["simpleNbox.NBP"])
Out[2]: 
      simpleNbox.NBP
1745        0.000993
1746       -0.080203
1747       -0.076254
1748       -0.073284

I am still a bit confused about whether and when the 1745 data makes sense to report or whether it should be discarded as part of spin-up.

rgieseke added a commit to openclimatedata/pyhector that referenced this issue Mar 5, 2024
rgieseke added a commit to openclimatedata/pyhector that referenced this issue Mar 6, 2024
@kdorheim kdorheim linked a pull request Apr 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant