Skip to content

Conversation

@mvdebolskiy
Copy link
Contributor

@mvdebolskiy mvdebolskiy commented Nov 11, 2025

Description:

Fixes #1487

Bound treelai to non-negative due to log(exp(-X))+X having precision ~1e-16 for 64-bit floats.

This should prevent endrun here:

if (r_sb_leaves<bc_in(s)%rb_pa(ifp)) then
write(fates_log(),*) 'Combined canopy resistance was somehow smaller than'
write(fates_log(),*) 'its boundary layer resistance component'
write(fates_log(),*) 'r_sb_leaves [s/m]: ',r_sb_leaves
write(fates_log(),*) 'bc_in(s)%rb_pa(ifp) [s/m]: ',bc_in(s)%rb_pa(ifp)
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

Collaborators:

@JessicaNeedham @rosiealice @glemieux

Expectation of Answer Changes:

Should be bfb, mb roundoff.

Checklist

All checklist items must be checked to enable merging this pull request:

Contributor

  • The in-code documentation has been updated with descriptive comments
  • The documentation has been assessed to determine if updates are necessary

Integrator

  • FATES PASS/FAIL regression tests were run
  • Evaluation of test results for answer changes was performed and results provided
  • FATES-CLM6 Code Freeze: satellite phenology regression tests are b4b

If satellite phenology regressions are not b4b, please hold merge and notify the FATES development team.

Documentation

No update needed.

Test Results:

CTSM (or) E3SM (specify which) test hash-tag:

CTSM (or) E3SM (specify which) baseline hash-tag:

FATES baseline hash-tag:

Test Output:

@mvdebolskiy mvdebolskiy changed the title bound treelai if leafc_per_unitarea is tiny Bound treelai if leafc_per_unitarea is tiny. Nov 11, 2025
Copy link
Contributor

@rosiealice rosiealice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks sensible to me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Finding Reviewers

Development

Successfully merging this pull request may close these issues.

Hitting runtime fail in canopy resistance error check.

2 participants