Fixed bug where totalET & netRadiation were incorrectly written to output #487
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Affected variables are scalarTotalET and scalarNetRadiation, which were correctly calculated but incorrectly written to output files on timesteps where no vegetation calculations were performed.
Make sure all the relevant boxes are checked (and only check the box if you actually completed the step):
partly addresses Revisit Noah-MP phenology computations - SAI/LAI interpolation #479 ,
complements cleaned up noah-mp phenology routine and removed check that gave 0 SAI & LAI if below 0.05 #484
Issue
In niche cases, variables
scalarTotalET
andscalarNetRadiation
get calcualted correctly as part of theopSplittin
routine but not copied from the temporary data structureflux_temp
(used bysystemSolve
and underlying processes) into the main data structureflux_data
used to write output files and carry data over between timesteps. This is because these variables were originally only identified asiname_nrgCanopy
inflxMapping
which is used to determine which variables to copy from the temporary structure into the main structure, andiname_nrgCanopy
variables are not copied fromtemp
todata
in cases where no canopy energy calculations are performed. Identifying both variables also asiname_nrgLayer
ensures that they are copied correctly in all cases.Equations
scalarTotalET
:https://github.com/NCAR/summa/blob/372c3fbeb3825e3b3d635461a8e552f9f0895aec/build/source/engine/vegNrgFlux.f90#L1441
scalarNetRadiation
:https://github.com/NCAR/summa/blob/372c3fbeb3825e3b3d635461a8e552f9f0895aec/build/source/engine/vegNrgFlux.f90#L1442
Tests
Standard test cases
I added
scalarTotalET
,scalarNetRadiation
and their constitutive variables to the standard test case outputs to ensure results remain consistent for these variables. The conditions under which this bug appears are present in 7/34 test cases:Test cases complete bit-4-bit identical where expected and deviate in only
scalarTotalET
and/orscalarNetRadiation
where expected:Additional tests
Using a test case with known periods of zero SAI & LAI, and thus no canopy energy calculations, shows that these fixes lead to correct reporting of
scalarTotalET
andscalarNetRadiation
in output files.