JGCRI / hector

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

Handle yf (yearfraction) consistently throughout stashCValues #640

Closed bpbond closed 1 year ago

bpbond commented 1 year ago

Thank you @dawnlwoodard who not only found a problem with the NBP constraint in #635 but in so doing exposed a deeper problem in how we were handling yf (the fraction of the year that the solver has stopped at) in simpleNBox::stashCValues().

In this PR we now:

Closes #635

bpbond commented 1 year ago

NBP constraint = NBP output

This takes the Hector NBP output and feeds it in as a constraint:

nbp_output_all

nbp_output_nbp

No change (exactly what we expect).

NBP constraint = constant

This sets a constant NBP constraint of 1.0 from 2000-2060:

nbp_constant_all

nbp_constant_nbp

The model holds the constraint for the requested time period, and then immediately jumps up high (as we expect, since we've been suppressing NBP).

dawnlwoodard commented 1 year ago

YAYYYYYY!! That's so satisfying to see that constraint just work. Works fine for me on my computer. I don't see a reason to not merge this fix in.

bpbond commented 1 year ago

Over to you @kdorheim for review and merging if OK.