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.
Description
Removes templated
max
andmin
macros and replaces their calls with c++ builtinsfmax
andfmin
. Unless I've missed something, all the variables passed to these functions (at least for the uses of the in the existing PEcAn.LJPGUESS code -- I have not inspected their calls elsewhere in the LPJ-GUESS model code) are already declared with typedouble
, so the type flexibility of the templates is not needed.Motivation and Context
Compilation of PEcAn.LPJGUESS was failing on my Mac with
unknown type name '_GLIBCXX14_CONSTEXPR'
. @yinghaoSunn did some great detective work and diagnosed this as one of several macros provided by GCC's glibc that are not present in the libc Apple provides with their version of Clang. Although it would theoretically be possible to declare a SystemRequirements on GNU glibc, in practice that's not automatically enforced and would not prevent build failures on Macs.Instead, I propose to use a simpler equivalent that compiles and passes package tests on all systems I've tested it on. To state the obvious though, this is introducing more divergence between the LPJ-GUESS model and the code copied into the PEcAn package. I'm opening this PR to start discussion, but will defer fully to actual users of the model on whether compilation across OSes is more or less important than keeping model and PEcAn code in sync.
Review Time Estimate
Types of changes
Checklist: