Skip to content

Resolve O(100) "unknown varfield/stash variable" warnings in each KGO workflow - #305

Open
lewisn-met wants to merge 4 commits into
developfrom
bugfix/not-recognised-warnings
Open

lewisn-met wants to merge 4 commits into
developfrom
bugfix/not-recognised-warnings

Conversation

@lewisn-met

Copy link
Copy Markdown
Contributor

Description of Problem

When running malak/sith KGOs, all jopa_process_background tasks are currently swamped with large quantities of warnings of the form

<a href="http://www-nwp/~opsrc/OPS/view/dev/doc/opsinputs_varobswriter_addrequiredgeovars.html">opsinputs_varobswriter_addrequiredgeovars</a>
<span style="color: maroon">WARNING</span>
Varfield not recognized: 10
<a href="http://www-nwp/~opsrc/OPS/view/dev/doc/opsinputs_cxwriter_addrequiredgeovars.html">opsinputs_cxwriter_addrequiredgeovars</a>
<span style="color: maroon">WARNING</span>
Stash code not recognized: -32768

thrown by the varobs and cx writers. For example, a typical aircraft run has 278 occurrences of such warnings, namely:

  • 100 occurrences of Varfield not recognized: -32768, where 4 fields are selected from a 104 element namelist in which unused slots are padded by the IMDI integer missing data indicator -32768. This value is incorrectly reported as an unrecognised Varfield.
  • 4 occurrences of Varfield not recognized: n, where n is some valid Varfield value. GeoVaL discovery is confusing "does not require GeoVaLs" with "unsupported field". Population handlers for these fields exist and a warning/error would be thrown during population if they did not.
  • 174 occurrences of Stash code not recognized: -32768, where 13 fields are selected from a 100 element namelist in which unused slots are again padded by the IMDI. 87 unused slots are reported in each of two routines.

The affected routines are: opsinputs_varobswriter_addrequiredgeovars, opsinputs_cxwriter_addrequiredgeovars, opsinputs_cxwriter_populatecx.

Solution

Removing the warnings

  • In the three routines, we now skip reporting when a namelist contains IMDI in place of a Varfield.
  • In varobswriter, supported fields needing no GeoVaLs no longer emit "unsupported varfield" warnings.
  • Genuinely unsupported fields are still reported during population/validation.
  • Warnings for unknown, non-IMDI STASH codes are preserved.

Testing

  • Added a CMake variable EXPECTED_WARNINGS and corresponding script to capture warning output from the test executables.
  • The behaviour of existing tests is predominantly unchanged, aside from the fact they now fail when unrecognised-varfield and unrecognised STASH variable warnings are thrown (regardless of executable success).
  • Added a new test for each of the writers (cx and varobs) to ensure that they do not produce warnings about STASH codes or Varfields which include the IMDI, and produces the warnings listed in EXPECTED_WARNINGS. These also require the executable to succeed.

Impact

All existing KGOs should pass, with significantly shorter job.out files due to the reduction in warnings thrown.
Opsinputs tests should continue to pass, unless they have a genuinely unknown varfield/stash variable in their namelist.

@lewisn-met

Copy link
Copy Markdown
Contributor Author

Matt Shin (@matthewrmshin) opsinputs appears to have some fortitude sadness again, is this expected?

@ctgh Chris Thomas (ctgh) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this feature - it will provide a useful cleanup of the output logs. I like the new testing framework.

Comment thread test/check_writer_warnings.cmake Resolved

@ctgh Chris Thomas (ctgh) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants