Skip to content

Conversation

@mpaiao
Copy link
Contributor

@mpaiao mpaiao commented Feb 11, 2025

Description

Not sure why this was not working, but in ed_read_ed10_20_history.f90 the following construction was leading to an FPE signal:

   leaf_lifespan(:) = merge( 12.0 / leaf_turnover_rate(:)                                  &
                           , llspan_inf                                                    &
                           , leaf_turnover_rate(:) > 0.0  )

I replaced it with the equivalent where construction

   where (leaf_turnover_rate(:) > 0.0)
      leaf_lifespan(:) = 12.0 / leaf_turnover_rate(:)
   elsewhere
      leaf_lifespan(:) = llspan_inf
   end where

This change seems to have fixed the problem. This could be a compiler issue, but if the problem pops up again, we may want to deprecate merge in the code and replace it with where instead.

I also updated the test suite script run-test.sh to pull data from the EDModel organization instead of downloading from a specific user. The datasets are identical to the ones @ashiklom kindly hosted over the years, but having this within the EDModel seems more logical in case we want to add more tests or change them in the future. Hope this is fine with you @ashiklom!

Collaborators

@ashiklom

Motivation and Context

This fixes crashes in the CI.

Types of changes

  • 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)

Checklist:

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

Testing :

  • All new and existing tests passed.

…ces for the test suite.

Somehow the CI tests were crashing due to a "merge" command in the inventory initialisation.
Switching the merge with an equivalent "where" construction seems to fix it. This could be
a compiler issue, but if the problem pops up again, we may want to deprecate merge in the
code and go with where instead.
@mpaiao mpaiao requested a review from ashiklom February 11, 2025 18:37
Copy link
Contributor

@ashiklom ashiklom left a comment

Choose a reason for hiding this comment

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

Looks good to me! It's been forever, so I forgot how all of this works...so I'm quite happy to not be directly responsible for this anymore ;)

@mpaiao
Copy link
Contributor Author

mpaiao commented Feb 11, 2025

Thanks Alexey! I don't remember very well either ;).

By the way, these tests will crash because the meteorological drivers in EDModel are already expecting pull request #413... Apologies for the mix-up!

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