Open bartgol opened 2 years ago
We have all of this now, right @bartgol ? So I think we can close this issue.
Well, the issue was not about implementing metadata, but rather about adding metadata info to most of namelist_defaults_scream.xml
entries. The vast majority of our XML defaults does not have any metadata, so technically this is still not done.
I feel like the type
metadata should be added to all our fields, as a sort of inline documentation. In a way, it would serve a portion of the purpose of namelist_definitions.xml
in EAM.
Recent PRs have shaped our handling of the defaults XML file. Among other things, they added "metadata" attributes, that can be used to validate entries, both during initial generation of the intermediate XML file (e.g., at case.setup time) as well as during any call to
atmchange
.So far, we only added a handful of metadata, to verify that the logic works. We can now think of starting to add metadata to a few more entries, to ensure robustness of inputs.
As a reminder, these are the supported metadata attributes:
type
: eitherinteger
,logical
,real
,string
, orarray(X)
, with X being any of the previous ones.valid_values
: list of valid values for the XML entrylocked
: if true, this entry cannot be altered viaatmchange
. In other words, it's a compset/res-dependent entry that cannot be arbitrarily changed.constraints
: a set of logical equalities/inequalities that the entry needs to satisfyFor all of these, there are already examples in
namelist_defaults_scream.xml
as well as more documentation in the python scripts used bybuildnml
andatmchange
.I encourage people adding new entries to our defaults XML file to take advantage of these features, and add metadata where appropriate.