Skip to content

Check intent(out) and intent(inout) variables during physics_check_data - #413

Merged
peverwhee merged 6 commits into
ESCOMP:developmentfrom
peverwhee:check-out-variables
Aug 25, 2025
Merged

Check intent(out) and intent(inout) variables during physics_check_data#413
peverwhee merged 6 commits into
ESCOMP:developmentfrom
peverwhee:check-out-variables

Conversation

@peverwhee

Copy link
Copy Markdown
Collaborator

Tag name (required for release branches):
Originator(s): peverwhee

Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):

Updates so that:

  1. Variable set in physics_read_data is only intent(in) and intent(inout) variables (no changes, this is the prior behavior)
  2. Variable set in physics_check_data is only intent(inout) and intent(out) variables (new behavior)
    • Also changed the logic in physics_check_data to not rely on is_read_from_file (because that's set during read_data which is not necessarily done for these variables!) and to not error when a variable cannot be read from file.

closes #411

Describe any changes made to build system: n/a

Describe any changes made to the namelist: n/a

List any changes to the defaults for the input datasets (e.g. boundary datasets): n/a

List all files eliminated and why: n/a

List all files added and what they do: n/a

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status development...<your_branch_name>)

M src/data/write_init_files.py

  • mods to grab two lists of variables - intent(in)/intent(inout) and intent(inout)/intent(out)
  • don't error if variable has weird dimensions/cannot be read from file
  • still check all constituents

M test/unit/python/sample_files/write_init_files/simple_reg.xml
M test/unit/python/sample_files/write_init_files/temp_adjust.F90

  • add new output-only variable to make sure the code is generated to check it

M test/unit/python/sample_files/write_init_files/phys_vars_init_check_.F90
M test/unit/python/sample_files/write_init_files/physics_inputs_
.F90

  • update expected files to account for new check_data logic in generated code

If there are new failures (compared to the test/existing-test-failures.txt file),
have them OK'd by the gatekeeper, note them here, and add them to the file.
If there are baseline differences, include the test and the reason for the
diff. What is the nature of the change? Roundoff?

derecho/intel/aux_sima: all PASS

derecho/gnu/aux_sima: all PASS

If this changes climate describe any run(s) done to evaluate the new
climate in enough detail that it(they) could be reproduced:

CAM-SIMA date used for the baseline comparison tests if different than latest:

@peverwhee
peverwhee requested review from jimmielin and nusbaume August 8, 2025 23:10
@peverwhee peverwhee self-assigned this Aug 8, 2025

@jimmielin jimmielin 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 @peverwhee! Looks good I just had a couple of comment questions that could be made clearer.

Comment thread src/data/write_init_files.py Outdated
Comment thread src/data/write_init_files.py Outdated

@nusbaume nusbaume 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 getting this implemented @peverwhee! I just had one (optional) request.

Comment thread src/data/write_init_files.py Outdated
@peverwhee
peverwhee merged commit 77fa975 into ESCOMP:development Aug 25, 2025
12 checks passed
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