MetOffice / MetOffice/lfric_apps
Check valid diagnostic requests
- Dominant language
- Fortran
- Stars
- 31
- Forks
- 118
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 8
Description
### Are there any linked Issues or Pull Requests?
_No response_
### Brief description
As described by Mike:
"
A crucial question is, does the lfric_apps diagnostics system have anything equivalent to STASH option codes for diagnostics in the UM? i.e. if I switch to a model configuration in-which an existing diagnostic I've requested is no-longer available, what happens? In the UM I'd get a warning telling me the STASH request has been rejected, and the field wouldn't be there in the output file, so I'd soon find out if my downstream thing tried to use the unavailable field. In LFRic, is the field similarly non-existent in the output file if I run a configuration that doesn't calculate it? Or is the field there but contains zero or junk? (that would be worrying!)
"
Currently the answer is no - the field will appear in the output file with missing data (so slightly better than zeros or junk, but still not ideal).
I think we have all the infrastructure in place to implement something, i.e. I believe:
* `field_is_enabled` will return true if a diagnostic has been requested at any point in the run (n.b. different to `field_is_active` which tells you about the current timestep)
* we would need the opposite of `enable_field` to disable the field in the diagnostic requests - pretty trivial to add
### Further details of the issue.
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing diagnostic request handling around field_is_enabled, field_is_active, and enable_field. Follow how requested fields reach the output file, then establish the behavior for unavailable diagnostics: the request should be identified as invalid and the unavailable field should not be emitted with missing data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fortran
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100