Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in soilmstress #16

Closed
davidorme opened this issue Feb 11, 2022 · 0 comments
Closed

Bug in soilmstress #16

davidorme opened this issue Feb 11, 2022 · 0 comments

Comments

@davidorme
Copy link
Contributor

Hi,

There is a bug in soilmstress at the line:
https://github.com/computationales/rpmodel/blob/master/R/subroutines.R#L124

The problem only arises if a user provides soilm as a scalar but meanalpha as an array. That's an odd thing to want to do, but might arise if someone wants to see how the stress factor changes for a given soil moisture in different sites.

In this case - in the nested ifelse statements - the first test 'iterates' over the comparison of the single scalar soilm to x1. If meanalpha is an array, the output is therefore either 1 or the first element only of the no argument:

Browse[2]> ifelse(test = 2 > 4, yes = 1, no = runif(10))                                                                                                                         
[1] 0.5927906

A bit obscure, I admit!

This was referenced Feb 15, 2022
stineb added a commit that referenced this issue Feb 23, 2022
@stineb stineb closed this as completed Feb 23, 2022
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

No branches or pull requests

2 participants