-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure UM via models #139
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed in VC.
- Put the defaults for conf variables in the *.conf files.
- Do not rename conf variables when used for variant names.
- Treat boolean variants as string variants by using strings "on"/"off"
- Add TODO comments where there is a good opportunity improve clarity by creating functions that can be called from multiple locations.
- Don't include DR_HOOK as a variant if it's not usable.
All comments addressed, except that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, well done!
Closes #135
The changes are extensive.
model
variant, and a correspondingmodel/
directory. The string value ofmodel
determines which subdirectory ofmodel/
to use to find the correspondingrose-app.conf
file. There are currently 3 subdirectories,vn13
(default),vn13p0-rns
(corresponding to the RNS suiteu-dg768
) andvn13p5-rns
.model/*/rose-app.conf
now has a corresponding variant.rose-app.conf
that take the valuestrue
orfalse
correspond to eitherbool
or off/on variants.bool
variants are normal Spackbool
variants, taking the valueFalse
orTrue
. The lambda functionbool_to_str
transforms these to the environment variable values"false"
or"true"
, determined by the value of the variant. The value given inrose-app.conf
is ignored. Currently onlyeccodes
andnetcdf
arebool
variants. The default value of thesebool
variables isTrue
, corresponding to the value used in the RNS suiteu-dg768
."none"
,"off"
or"on"
. The Spack default is"none"
. Leaving the value as"none"
results in the corresponding environment variable being set to the value given inrose-app.conf
. Otherwise, the lambda functionoff_on_to_str
transforms"off"
to"false"
or"on"
to"true"
and this is the value used for the corresponding environment variable, overriding the value given inrose-app.conf
.rose-app.conf
, other thanum_rev
, correspond to revision variants. For revision variants, the Spack default is"none"
. If the variant value left as"none"
, then if the value inrose-app.conf
defined and non-empty, it is used as the environment variable value, otherwise the value is"um{version}"
whereversion
is the UM version. If the variant value is not"none"
then it is used as the environment variable value, overriding any value inrose-app.conf
.rose-app.conf
, with the exception of"um_rev"
, correspond tostr
variants. The default value for each of these variants is"none"
. Leaving this value as"none"
results in the corresponding environment variable being set to the value given inrose-app.conf
. If the variant is set to a value other than"none"
, then this value overrides the value given inrose-app.conf
. This effectively makes the value inrose-app.conf
the default.