Skip to content

User configurability of switches in CMake#12

Draft
anton-seaice wants to merge 6 commits intodev/2025.08from
11
Draft

User configurability of switches in CMake#12
anton-seaice wants to merge 6 commits intodev/2025.08from
11

Conversation

@anton-seaice
Copy link
Collaborator

@anton-seaice anton-seaice commented Feb 4, 2026

Closes #11

This is a draft of allowing users to set the configuration switches through spack.

No defaults are changed,

So, for example, if a user sets IC3 then IC3 is used, otherwise, CMake will apply the current setting (IC4).

There would be a spack variant "switches", which is a string of switches the user would like to set. Defaults are applied for all switch terms which are not provided.

e.g.

I might set switches="IC4", which then it passed through to CMake and use, but no other switches are changed.

Does this look useful @ezhilsabareesh8 ? Does it make sense for the Output swtiches or some other switches to also be configurable ?

@dougiesquire FYI / for a pre-review

@anton-seaice anton-seaice self-assigned this Feb 4, 2026
#prefix; default value
"PR;PR1" # Propogation scheme
"FLX;FLX4" # Flux computation
"LN;LN1" # Linear Input
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"LN;LN1" # Linear Input
"LN|SEED;LN1" # Linear Input

(or however it works in regex)

Selection of linear input:
ln0 No linear input.
seed Spectral seeding of Eq. (3.70).
ln1 Cavaleri and Malanotte-Rizzoli with filter.
lnx Experimental (user supplied).

endforeach()

# Infrastructure switches, unlikely to change
list(APPEND WW3_SWITCHES "${UserSwitches}" "CESMCOUPLED" "DIST" "MPI" "NOGRB")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
list(APPEND WW3_SWITCHES "${UserSwitches}" "CESMCOUPLED" "DIST" "MPI" "NOGRB")
list(APPEND WW3_SWITCHES "CESMCOUPLED" "DIST" "MPI" "NOGRB")

@anton-seaice
Copy link
Collaborator Author

The mixture of some hard coded and some configurable switches is potentially confusing

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.

Improve configurability of switches

1 participant