E3SM-Project / E3SM-Project/scream
Move diagnostics calculation out of IO classes
- Dominant language
- No language data
- Stars
- 79
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
It just occurred to me that in case of multiple output streams, we may be re-computing the same diagnostic quantities multiple times. If the same diag is needed in two streams (which, say, differ only in terms of the avg quantity, or the remap file) then both output streams will compute the diag.
Perhaps, we should have the diags calculation handled by the AD, like so:
- at init time, before creating the output managers, parse the output yaml files, and look for diagnostics. Create the needed diags, and store in an array.
- at run time, before calling the output managers, compute all diags
There are a few kinks to fix, of course. A few questions and tentative answers
- Q: How to pass diags fields to I/O?
A: we could put them in the FM, since by now all classes that needed a FM have been inited, and it won't be passed around anymore (it's just a container now). Can we foresee an issue with that?
- Q: IO classes do not make the 1d host view alias the field view, if the field is a diagnostic field, so how do we tell IO that a certain field is a diag?
A: perhaps add diags to the group "diagnostics".
- Q: we need to make the AD aware of the structure of the output yaml files, effectively duplicating parsing code (AD and IO). Can we avoid this?
A: perhaps add a free function in share/io that parses a yaml file, and returns the list of fields names?
Other issues I am not foreseeing?
@AaronDonahue
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.