Skip to content

User configurability of switches in CMake#12

Draft
anton-seaice wants to merge 1 commit into
dev/2026.03from
11
Draft

User configurability of switches in CMake#12
anton-seaice wants to merge 1 commit into
dev/2026.03from
11

Conversation

@anton-seaice
Copy link
Copy Markdown
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
Comment thread CMakeLists.txt
#prefix; default value
"PR;PR1" # Propogation scheme
"FLX;FLX4" # Flux computation
"LN;LN1" # Linear Input
Copy link
Copy Markdown
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).

Comment thread CMakeLists.txt
endforeach()

# Infrastructure switches, unlikely to change
list(APPEND WW3_SWITCHES "${UserSwitches}" "CESMCOUPLED" "DIST" "MPI" "NOGRB")
Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

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

@anton-seaice anton-seaice changed the base branch from dev/2025.08 to dev/2026.03 May 15, 2026 04:33
@dougiesquire
Copy link
Copy Markdown

Could you please resolve the conflicts after you changed the base branch (I think just remove the first 7 commits?)

better var names

better var names

better var names

better var names

better var names
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

2 participants