E3SM-Project / scream

Fork of E3SM used to develop exascale global atmosphere model written in C++
https://e3sm-project.github.io/scream/
Other
79 stars 56 forks source link

Submit and/or Runtime checking of YAML inputs #2900

Open AaronDonahue opened 4 months ago

AaronDonahue commented 4 months ago

We discussed this during our most recent dev-call. There are 2 feature requests:

  1. Allow for case-insensitive yaml parameters. Right now yaml variables are ignored if they are not the exact correct key, which includes case sensitive. For example Frequency will work for a output yaml file. frequency will not. Is there functionality in EKAT for params.get<>() to treat the key as case insensitive?
  2. Often for output yaml files a typo or unexpected behavior might not get detected until runtime, and sometimes even deep into the run, for example with monthly restarts. The example we discussed today was a parameter that wasn't being used (because it was written w/ the wrong case) which didn't pop up as a problem until deep into the run because it was a monthly output. If we had a yaml checker that could alert users to keys that are unused, for example comparing against a master list, this might avoid wasted cycles.
bartgol commented 3 months ago

I'm a bit reluctant to make the ParameterList class case-insensitive. But we could implement a validator routine for the main classes (atm proc and IO, for instance), so that if the input YAML contains an unrecognized parameter (due to case or misspelling), we can error out. Notice, however, that this can only be done at runtime.