Making parameters flexible

I have a suite that runs an ensemble and uses

     member = 1..10

Now I need to specify the beginning member and the size of the ensemble.
I tried this

       ensemble_start = 10
       ensemble_end = 20
       member = $ensemble_start .. $ensemble_end

but I think I can’t use variables in the member parameter. Any suggestions?

Hi @Jim

You can’t use shell environment variables like that (they are made available to shell processes executed by the scheduler). But you can use Jinja2 code anywhere in the workflow configuration (think of Jinja2 as a preprocessor that programmatically generates the final workflow config that the scheduler sees).


{% set ensemble_start = 10 %}
{% set ensemble_end = 20 %}
# ...
        member = {{ensemble_start}}..{{ensemble_end}}
# ...


I already use jinja2, but didn’t think of it. Works great, thanks!