This is missing a <size> tag though, and errors uninformatively when run.write.config() is run with Error in if (settings$ensemble$size == 1) { : argument is of length zero
This might only happen if there is also no sensitivity analysis specified. Either way the error should at least be informative.
To Reproduce
pecan.xml:
``` xml
Test Data for PEcAn.ED2/home/ericrscott/model-vignettes/ED2/testoutput/no_ensemble/outdirPostgreSQLbetybetypostgresbetyFALSE/data/dbfilesSetariaWT1ebifarm.c3grass53000TRUE1.2TRUEED2/groups/dlebauer/ed2_results/global_inputs/ed2_2.2.0_singularity.sh14/pecan/models/ed/inst/ED2IN.r2.2.00.0112000001762004-09-01 00:00:002005-01-02 00:00:00/data/sites/ebifarm/ED_MET_DRIVER_HEADER/data/oge2OLD/OGE2_/data/faoOLD/FAO_/data/ed_inputs/glu//data/ed_inputs/2004-09-012005-01-01puma/groups/dlebauer/ed2_results/pecan_remotesbatch --job-name=@NAME@ --account=dlebauer --ntasks=28 --nodes=3 --time=25:00:00 -o @STDOUT@ -e @STDERR@.* ([0-9]+)'squeue --job @JOBID@ &> /dev/null || echo DONE'module load openmpi3/groups/dlebauer/ed2_results/pecan/contrib/modellauncher/modellauncher--partition=standardmodule load openmpi3; mpirun
```
Expected behavior
Either a sensible default for settings$ensemble or an informative error about a missing settings$ensemble
Additional context:
Comment from @mdietze on Slack:
So the possible exceptions would be: 1) if one is just running a sensitivity analysis. In that case I can't remember if the SA will run the "default" case itself or whether it relies on an ensemble of size=1 to provide that default. 2) if one is doing a PDA run, which should take care of parameter sampling and model execution on it's own and you don't want to do an ensemble run first. SDA runs would be similar, but there I think you do need to include the ensemble tag since the SDA runs are all ensemble-based
Bug Description
According to the PEcAn documentation, "As with meta.analysis, if [ensemble] is missing, then PEcAn will not do an ensemble analysis."
What actually happens is
check.ensemble.settings()
adds the following into the settings xml:This is missing a
<size>
tag though, and errors uninformatively whenrun.write.config()
is run withError in if (settings$ensemble$size == 1) { : argument is of length zero
This might only happen if there is also no sensitivity analysis specified. Either way the error should at least be informative.
To Reproduce
pecan.xml:
Expected behavior
Either a sensible default for
settings$ensemble
or an informative error about a missingsettings$ensemble
Additional context:
Comment from @mdietze on Slack: