Skip to content

Add pio_reader Fortran unit tests#403

Merged
nusbaume merged 141 commits into
ESCOMP:developmentfrom
nusbaume:pio_reader_tests
Jul 15, 2025
Merged

Add pio_reader Fortran unit tests#403
nusbaume merged 141 commits into
ESCOMP:developmentfrom
nusbaume:pio_reader_tests

Conversation

@nusbaume

@nusbaume nusbaume commented Jul 2, 2025

Copy link
Copy Markdown
Collaborator

Tag name (required for release branches):
Originator(s): @mwaxmonsky @nusbaume

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

This PR introduces pFUnit Fortran unit tests for the pio_reader implementation of the ccpp_io_reader abstract class that is used in CAM-SIMA, which should now run automatically with any PR to CAM-SIMA as part of the Fortran unit tests Github Action.

Note that although several tests are added by this PR, the code coverage is not complete, as several of the edge cases require specialized NetCDF files that will need to be created. Github issue #404 can be used to keep track of this.

Describe any changes made to build system:

A src/physics/utils/CMakeLists.txt
M test/unit/fortran/CMakeLists.txt
A test/unit/fortran/ccpp_framework_stub/CMakeLists.txt
A test/unit/fortran/cmake/FindNetCDF.cmake
A test/unit/fortran/cmake/FindPIO.cmake
A test/unit/fortran/mock_routines/CMakeLists.txt
A test/unit/fortran/src/pio_reader/CMakeLists.tx

  • Add files needed to build the pio_reader unit tests and their dependencies using CMake.

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:

A test/unit/fortran/ccpp_framework_stub/ccpp_kinds.F90
A test/unit/fortran/mock_routines/cam_pio_utils.F90
A test/unit/fortran/src/pio_reader/test_pio_reader.pf

  • Add pio_reader unit tests (and associated dependencies).

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

M .github/workflows/fortran_unit_tests.yml

  • Add pio_reader unit tests to Github Action worfklow.

M .gitignore

  • Have git ignore all compiled Fortran files (".o" and ".mod").

M src/physics/utils/pio_reader.F90

  • Fix bugs and remove un-needed host model dependencies found during testing.

M src/utils/cam_pio_utils.F90

  • Add optional "errcode" variable that can be used during testing (and to ensure that pio_reader doesn't kill the host model).

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:

nusbaume and others added 30 commits July 2, 2025 14:04
@nusbaume
nusbaume requested a review from mwaxmonsky July 9, 2025 14:25

@mwaxmonsky mwaxmonsky 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.

Looks great @nusbaume! Found two unused mpi_ierr locals left over but otherwise, no issues here! Thanks for tackling this one!

Comment thread test/unit/fortran/src/pio_reader/test_pio_reader.pf Outdated
Comment thread test/unit/fortran/src/pio_reader/test_pio_reader.pf Outdated
@nusbaume
nusbaume requested a review from peverwhee July 9, 2025 20:18

@peverwhee peverwhee 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 @nusbaume - teeny nitpicks that shall not prevent my approval!

Comment thread .github/workflows/fortran_unit_tests.yml Outdated
Comment thread src/physics/utils/pio_reader.F90 Outdated
Comment thread .github/workflows/fortran_unit_tests.yml
@nusbaume
nusbaume merged commit c88ee96 into ESCOMP:development Jul 15, 2025
12 checks passed
@nusbaume
nusbaume deleted the pio_reader_tests branch July 16, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Github action Related to Github Actions for this repo. testing system Related to SIMA testing and/or test scripts

Projects

Status: Tag

Development

Successfully merging this pull request may close these issues.

3 participants