Repository navigation
Enable parsing a 1D JEDI variable into a multi-level OPS variable - #306
Conversation
|
There are a few failures in the coding_norms task from fortitude, some lines with trailing whitespace. |
|
David Davies (@DJDavies2) many thanks for flagging this - there's also a couple of ctests failing which I'll need to investigate, but I don't have much time to over the next few days. Will put this back into draft in the meantime. |
Chris Thomas (ctgh)
left a comment
There was a problem hiding this comment.
Thanks for the fix!
|
Can you please try triggering the CI again? |
There was a problem hiding this comment.
🟡 Changes recommended
Regression coverage is still needed for unsuffixed-variable broadcasting across multiple channels, including missing metadata values and lookups that cannot be masked by ObsGroup’s suffix-stripping fallback.
1 open issue
What changed in this PR
This PR explicitly supports broadcasting 1D JEDI variables across multiple OPS output levels, removing reliance on ObsGroup’s channel-suffix fallback ahead of the OSDF transition.
Changes:
- Adds optional
JediVarHasChannelscontrol, defaulting to true to preserve existing behavior. - Reads unchannelized real, time, and coordinate data once and copies it across output channels.
- Enables this behavior for pressure and selected radar and level metadata.
| File | Description |
|---|---|
src/opsinputs/opsinputs_varobswriter_mod.F90 |
Enables unsuffixed metadata reads at relevant writer call sites. |
src/opsinputs/opsinputs_fill_mod.F90 |
Implements and documents channel-aware lookup and 1D-to-2D broadcasting. |
Review effort: Balanced
|
It is unlikely that I am going to have time to add the extra ctest that copilot has requested today - if the reviewers agree, as this is the last KGO blocking the OSDF switch-on, I'd advocate for merging now and adding the testing in a future PR. I'm happy that this functionality is tested by the KGOs being unchanged in the meantime. |

Description
This PR enables opsinputs to parse a 1D JEDI variable into a multi-level (2D) OPS variable explicitly. This is to enable feature parity between the obsGroup and OSDF when the switch is made.
This change should be net zero for the current KGO path and passes all ctests: KGOs
Previous behaviour
Currently this is possible purely due to a defect in the ObsGroup:
MetaData/pressure(which has no channels) on the no_records 2D write path and a non-empty channel list, opsinputs callsobsspace_has()onMetaData/pressure_<channelnumber>for each channel number in the channel list.MetaData/pressure_<channelnumber>_<channelnumber>off the variable name on each call performs aget_dbonMetaData/pressureinto the 2D array a number of times equal to the size of the channel list. In the OSDF case, the variable is not in the ObsSpace so we don't populate the array.Behaviour after this PR
Following this PR, the parameter
JediVarHasChannels(which defaults to true to preserve existing behaviour) can be set tofalseto allow the querying ofMetaData/pressureby its unsuffixed name when constructing a 2D variable. In this case, the variable is retrieved once usingget_db, then copied into the remaining levels of the 2D variable.This behaviour is extended to variables other than
MetaData/pressure, though these variables are not encountered during any KGO run.