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

run.sensitivity.analysis() not creating sensitivity.results.Rdata #3154

Closed
Aariq opened this issue Mar 30, 2023 · 2 comments · Fixed by #3155
Closed

run.sensitivity.analysis() not creating sensitivity.results.Rdata #3154

Aariq opened this issue Mar 30, 2023 · 2 comments · Fixed by #3155
Assignees
Labels
Topic: Modules Not related to core workflow or specific models Type: Bug

Comments

@Aariq
Copy link
Collaborator

Aariq commented Mar 30, 2023

Bug Description

I'm working on runs with sensitivity analysis of ± 1 SD and run.sensitivity.analysis() generates plots correctly but does not save sensitivity.results.Rdata. In addition, I get error messages from splinefun such as:

Error in stats::splinefun(quantiles.input, quantiles.output, method = "monoH.FC") : 
  length(m) must be at least two

or

Error in stats::splinefun(quantiles.input, quantiles.output, method = "monoH.FC") : 
  zero non-NA points
In addition: Warning message:
In run.sensitivity.analysis(settings) :
  missing >2 runs for 'quantum_efficiency','cuticular_cond','SLA','stomatal_slope','fineroot2leaf','Vcmax' 
 sensitivity analysis or variance decomposition will be performed on these trait(s) 
 it is likely that the runs did not complete, this should be fixed !!!!!!

But as far as I can tell, neither of these is true. The latter error didn't happen when I stepped through the function in debug, I'm pretty sure. Still haven't pinned this one down, but I'll edit this issue when I figure out the problem.

@Aariq Aariq added Type: Bug Topic: Modules Not related to core workflow or specific models labels Mar 30, 2023
@Aariq Aariq self-assigned this Mar 30, 2023
@Aariq
Copy link
Collaborator Author

Aariq commented Mar 30, 2023

The code that triggers the latter error is here:

good.saruns <- sapply(sensitivity.output[[pft$name]], function(x) sum(is.na(x)) <=2)
if(!all(good.saruns)) { # if any bad saruns, reduce list of traits and print warning
bad.saruns <- !good.saruns
warning(paste('missing >2 runs for', vecpaste(traits[bad.saruns]),
'\n sensitivity analysis or variance decomposition will be performed on these trait(s)',
'\n it is likely that the runs did not complete, this should be fixed !!!!!!'))
}

But if I load sensitivity.output manually and inspect it, it has 3 rows and no NAs, so this shouldn't be triggering an error.

@Aariq
Copy link
Collaborator Author

Aariq commented Mar 30, 2023

Oh, this is likely because I deleted the run folders generated for SA for one of the PFTs, which I think is the only way to "turn off" sensitivity analysis for a PFT. I'll still try to see if there is a solution that still exports the data in some form.

mdietze added a commit that referenced this issue Apr 6, 2023
Add optional `pfts` argument to `run.sensitivity.analysis()` (fix/workaround for #3154)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Modules Not related to core workflow or specific models Type: Bug
Projects
None yet
1 participant