Skip to content

Bug fix: conditional logic for wood_rwc calculation#431

Merged
xiangtaoxu merged 1 commit intomasterfrom
mpaiao-patch-wood-psi
Mar 12, 2026
Merged

Bug fix: conditional logic for wood_rwc calculation#431
xiangtaoxu merged 1 commit intomasterfrom
mpaiao-patch-wood-psi

Conversation

@mpaiao
Copy link
Contributor

@mpaiao mpaiao commented Mar 12, 2026

Description

I found this bug whilst looking for some code that could cause the crash in issue #430. The if block had no else clause, which could leave the variable undefined. The proposed fix follows the same logic for calculating leaf_rwc in the same sub-routine .

Fixing this bug does not solve the problem in issue #430 according to @sdeherto, but this is still needs correction.

Collaborators

Types of changes

  • Hot fix (emergential bug fix to make ED2 run again)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (fix or feature that would cause existing functionality to change)

Changes in Settings, Input Files or Output Files

  • This feature requires changes in ED2IN
  • This feature requires changes in the XML parameter file
  • This feature requires changes in other input files
  • This feature will change output files

Expectation of Answer Changes:

  • No changes expected (bit-for-bit compatibility)
  • Changes expected with specific configurations (see details below)
  • Changes expected in all simulations (see details below)

This would change the results in edge cases when running ED2 with plant hydraulics.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • ED2 Wiki update:

Testing :

  • All new and existing tests passed.

I found this bug whilst looking for some code that could cause the crash in issue #430.  The `if` block had no `else` clause, which could leave the variable undefined. The proposed fix follows the same logic for calculating `leaf_rwc` in the same sub-routine .

Fixing this bug does not solve the problem in issue #430 according to @sdeherto, but this is still needs correction.
@xiangtaoxu xiangtaoxu merged commit 3467f88 into master Mar 12, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants