Skip to content

Add ensemble functionality#17

Open
KristianHMoller wants to merge 13 commits into
dmidk:mainfrom
KristianHMoller:feature/ensemble_support
Open

Add ensemble functionality#17
KristianHMoller wants to merge 13 commits into
dmidk:mainfrom
KristianHMoller:feature/ensemble_support

Conversation

@KristianHMoller

@KristianHMoller KristianHMoller commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

The underlying probabilistic advection method has the option of running an ensemble with noise. However, until now, this option has not been implemented into sunflow.

This PR allows for running as an ensemble by specifying the CLI argument --ensemble_members to be different from one. Per default, the output will be selected ensemble statistics, but specifying --full_ensemble when calling sunflow will instead provide the full ensemble as output. The output_mode global attribute in the NetCDF file will specify the type of output: full ensemble, ensemble_statistic or deterministic.

If only a subset of the ensemble statistics are desired, this can be specified by exporting the environment variable ENSEMBLE_STATISTICS with the desired variables comma separated.

The default values of the noise parameters alpha and beta are 0 for deterministic mode and using other values will result in a warning.
For ensemble mode, currently, the default values are taken from Carpentieri et al.: https://www.sciencedirect.com/science/article/pii/S030626192301139X

@KristianHMoller

KristianHMoller commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Scientific question 1: Which values to use for alpha and beta?
Currently using optimal values from Carpentieri et al., but these may be country-specific and are presumably derived with the potential error in the implementation (dmidk/SolarSTEPS#2).
Also: @irenelivia , we used slightly different values in our previous code. Do you recall why?

@KristianHMoller

Copy link
Copy Markdown
Collaborator Author

Implementation question 1: Do we want warning or failure if running deterministically (only one ensemble member) with noise?

@KristianHMoller

KristianHMoller commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Implementation question 2: Do we want the number of ensemble members and noise parameters to be CLI arguments rather than environemnt variables? I.e. parameters called when running sunflow: sunflow --ens_members 10?

Current decision: CLI argument

@KristianHMoller KristianHMoller marked this pull request as ready for review July 1, 2026 13:34
@KristianHMoller

KristianHMoller commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Ideas for ensemble spread variables: Quantiles, 10/90 percentile
Implemented as default options: 10, 25, 75 and 90th percentiles

@KristianHMoller

KristianHMoller commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator Author

Mean vs. median - which is more useful?
Current decision: Default uses both

@KristianHMoller

Copy link
Copy Markdown
Collaborator Author

@irenelivia If you want, you can try this out to see if anything obvious stands out as ideas for improvements or things that should be changed.

Ideas for simple commands to test:
source .venv/bin/activate

sunflow --ensemble_members 10

sunflow --ensemble_members 10 --full_ensemble

export ENSEMBLE_STATISTICS=mean,median
sunflow --ensemble_members 10

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.

1 participant