-
Notifications
You must be signed in to change notification settings - Fork 16
Add CI workflows and implement unit tests for MPAS dynamical core #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CI workflows and implement unit tests for MPAS dynamical core #427
Conversation
To reviewers, if you are interested in the CI workflow logs, look for "MPAS Dynamical Core CI" in the "Checks" tab of this PR. |
Both Intel Fortran classic (ifort) and LLVM (ifx) compilers fail to compile some, but not all, perfectly valid internal (i.e., nested) subroutines. Versions 2024.2, 2025.0, and 2025.1 are affected. This issue seems to be related to host associations being mishandled. Child subroutines somehow lose access to the variables from the parent scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing in all of these unit tests @kuanchihwang! I mostly just had a few comment-related requests, as well as a request that would slightly expand the scope of this PR (so feel free to say no if it is too burdensome).
Also add `staging/*` branch as a way to trigger CI in forks for testing purposes.
`ubuntu-latest` points to the latest LTS version of Ubuntu, which is currently 24.04. It is a moving target with a 2-year cadence. Pin runner image version and upgrade manually as needed in the future to ensure CI stability.
In CI, we do not care about the documentation and tests of PIO. Skip building them to save time.
Also pin RRTMGP data version for better CI stability.
When using `--output-junit` with CTest, test output will be truncated at 1024 bytes by default, which makes the test log incomplete and not very useful. Increase the size limit to 512 KB.
1. For Debian-based distros, before installing packages, package indexes should be updated first by running `apt update`. 2. `doxygen` brings many dependencies with it and takes time to install. In CI, we do not care about building the documentation in PIO. Remove it to save time. 3. `openmpi-bin` is already included in `libopenmpi-dev`. No need to list it twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bringing in my requests @kuanchihwang! This PR looks good to me now.
Tag name (required for release branches):
None
Originator(s):
kuanchihwang
Descriptions (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):
This PR introduces continuous integration (CI) workflows and implements unit tests for MPAS dynamical core. Additionally, pFUnit files (
*.pf
) are now correctly rendered as Fortran source code on GitHub.Beyond verifying correctness and robustness, the unit tests also report the numerical accuracy of each computational procedure in terms of units in the last place (ULP) away from the exact answers. For example, below is the output for equation of state:
Whenever changes are made in the path of MPAS dynamical core (
src/dynamics/mpas/*
), the CI workflows automatically build and run the unit tests with various versions of GCC. Test results are collected as artifacts and retained for 7 days for reference.Describe any changes made to the build system:
None
Describe any changes made to the namelist:
None
List any changes to the defaults for the input datasets (e.g., boundary datasets):
None
List all files eliminated and why:
None
List all files added and what they do:
List all existing files that have been modified, and describe the changes:
Regression tests:
Except for the known failing test above, all the other tests pass with respect to the last baseline,
sima0_08_002
.