Validate emissions with lower bound - #417
Conversation
phackstock
left a comment
There was a problem hiding this comment.
Looks good to me, one small question in line.
Did you check that the replacement of the lower_bound values works and a number is actually read instead of a string? Does the lower_bound replacement also work for the None values and is the validator (or lack thereof in this case) then applied correctly?
| tier: 1 | ||
| notes: Net emissions 'Emissions|CO2' = 'Gross Emissions|CO2' + 'Gross Removals|CO2'. | ||
| lower_bound: 0 | ||
| notes: Net emissions 'Emissions|CO2' = 'Gross Emissions|CO2' - 'Gross Removals|CO2'. |
There was a problem hiding this comment.
The notes should be different to the ones for Gross Emissions|CO2, no?
There was a problem hiding this comment.
Don't understand what you mean, the equation "Net Emissions = Gross Emissions - Gross Removals" should always be true. And I think it's less confusing (and less error-prone) to always use exactly the same ordering of terms.
Yes
Yes. (It has to be None in the yaml-sense of no value, not the string "None") |
|
In general I agree with the sign change — the +/− inconsistency should be fixed. @danielhuppmann — could we check the ScenarioMIP impact before merging? The (There's a related structural question — whether the |
|
One additional note - in work we did with @tgasser, a small number of assessed scenarios had negative values for carbon removal on land due to the flux definitions applied. In principle, I agree this is counter intuitive and it may be best to just have a check that all gross removals are strictly positive. But based on how land carbon flux is defined, it is possible (but unlikely) to provide a valid negative flux for this variable. |
@phackstock would you be able to take care of that? |
Just want to insist: for the land sector, in some cases, it is possible to get a negative removal, i.e. a flux to the atmosphere. I'd be careful with the validation, here. |
Never mind, as @danielhuppmann pointed out, the validation would be automatically applied, we'll apply the pin once this PR gets merged to avoid any issues. |
This PR adds validation of non-negativity (lower bound = 0) to all emissions species except CO2 and Kyoto GHG, and enforces non-negative values for gross emission and gross removals of CO2.
FYI @jkikstra @IAMconsortium/common-definitions-emissions @phackstock @dc-almeida
Closes #339