Skip to content

Conversation

climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented May 15, 2025

Detect invalid horizontal dimensions (loop variables) in metadata for host and schemes

Detect invalid horizontal dimensions (loop variables) in metadata for host and schemes. For schemes, horizontal_dimension is invalid in the run phase, all other options (horizontal_loop_extent, horizontal_loop_begin, horizontal_loop_end) are only valid in the run phase. For host models, only horizontal_dimension is valid.

Tests are added for both scheme and host metadata, and existing tests are fixed, namely bad horizontal dimensions in:

  • test/unit_tests/sample_files/test_bad_var_property_name.meta
  • test/unit_tests/sample_files/test_multi_ccpp_arg_tables.meta
  • test/capgen_test/make_ddt.meta
  • test/capgen_test/temp_set.meta
  • test/ddthost_test/make_ddt.meta
  • test_prebuild/test_tracked_data/scheme3.meta
  • test_prebuild/test_unit_conv/data.*

Further: I commented out test for blocked data structures in test_prebuild/run_all_tests.sh; this test can no longer be run, since blocked data structures required the host model to define the horizontal dimension for blocked data as horizontal_loop_extent. This test and all code related to supporting blocked data structures in ccpp_prebuild.py will be removed in a follow-up PR (out of scope of this PR).

User interface changes?: No

Fixes #521

Testing: all tests pass
tests added: test that invalid horizontal dimensions are detected correctly for host and scheme metadata
tests removed: commented out blocked data tests for ccpp_prebuild
unit tests:
system tests:
manual testing:

@climbfuji climbfuji self-assigned this May 15, 2025
@climbfuji climbfuji added the capgen bugs, requests, etc. that involve ccpp_capgen label May 15, 2025
@climbfuji climbfuji moved this to In progress in capgen unification May 15, 2025
Test User added 2 commits May 14, 2025 20:46
…st/temp_set.meta, ddthost_test/make_ddt.meta
…_var_property_name.meta, sample_files/test_multi_ccpp_arg_tables.meta
@climbfuji climbfuji linked an issue May 15, 2025 that may be closed by this pull request
@climbfuji climbfuji force-pushed the bugfix/detect_invalid_loop_vars_in_metadata branch from 54d46ef to 436531c Compare May 15, 2025 12:46
@climbfuji climbfuji marked this pull request as ready for review May 15, 2025 13:23
Copy link
Member

@dustinswales dustinswales left a comment

Choose a reason for hiding this comment

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

@climbfuji These changes look good to me. Just a small comment on an error message.

Copy link
Collaborator

@peverwhee peverwhee left a comment

Choose a reason for hiding this comment

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

looks good to me - thanks for adding that test also!

@climbfuji
Copy link
Collaborator Author

With approvals from NOAA and CGD (and NRL ...) I'll go ahead and merge this.

@climbfuji climbfuji merged commit 4d4dc78 into NCAR:develop May 22, 2025
19 checks passed
@climbfuji climbfuji deleted the bugfix/detect_invalid_loop_vars_in_metadata branch May 22, 2025 17:02
@climbfuji climbfuji moved this from In progress to Done in capgen unification Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
capgen bugs, requests, etc. that involve ccpp_capgen
Projects
Development

Successfully merging this pull request may close these issues.

Add check to disallow usage of horizontal_dimension in the run phase
3 participants