Introduce source code linting to CAM-SIMA Fortran CI - #530
Merged
kuanchihwang merged 24 commits intoAug 5, 2026
Conversation
GitHub has been releasing major GHA versions rather quickly recently...
In extended regular expressions (ERE), forward slashes are not special characters. They do not need to be escaped.
Instead, use the `output_unit` parameter from the `iso_fortran_env` intrinsic module defined in Fortran 2003.
kuanchihwang
had a problem deploying
to
CI-tests-on-CIRRUS
July 27, 2026 18:05 — with
GitHub Actions
Error
kuanchihwang
temporarily deployed
to
CI-tests-on-CIRRUS
July 27, 2026 18:09 — with
GitHub Actions
Inactive
kuanchihwang
marked this pull request as ready for review
July 27, 2026 18:22
Also guard against zero command line arguments for Fortitude.
kuanchihwang
temporarily deployed
to
CI-tests-on-CIRRUS
July 28, 2026 18:42 — with
GitHub Actions
Inactive
kuanchihwang
temporarily deployed
to
CI-tests-on-CIRRUS
July 30, 2026 17:39 — with
GitHub Actions
Inactive
jimmielin
approved these changes
Aug 3, 2026
jimmielin
left a comment
Collaborator
There was a problem hiding this comment.
This is really cool, thanks @kuanchihwang. I just had a couple of potential changes for your consideration but nothing blocking the review.
kuanchihwang
temporarily deployed
to
CI-tests-on-CIRRUS
August 4, 2026 19:50 — with
GitHub Actions
Inactive
Collaborator
|
Thanks @kuanchihwang for addressing my comments! |
peverwhee
requested changes
Aug 4, 2026
peverwhee
left a comment
Collaborator
There was a problem hiding this comment.
one question and a couple requests on the SIMA toml file. thanks @kuanchihwang !
kuanchihwang
temporarily deployed
to
CI-tests-on-CIRRUS
August 4, 2026 23:33 — with
GitHub Actions
Inactive
kuanchihwang
temporarily deployed
to
CI-tests-on-CIRRUS
August 5, 2026 19:39 — with
GitHub Actions
Inactive
peverwhee
approved these changes
Aug 5, 2026
peverwhee
left a comment
Collaborator
There was a problem hiding this comment.
thanks @kuanchihwang !
Collaborator
|
@kuanchihwang you can go ahead and merge this whenever you're ready |
kuanchihwang
temporarily deployed
to
CI-tests-on-CIRRUS
August 5, 2026 23:23 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tag name
None (Bit-for-bit)
Originator(s)
kuanchihwang
Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number)
This PR introduces source code linting via Fortitude to the CAM-SIMA Fortran CI pipeline. The Fortitude configuration is located at
test/fortitude.toml.Running
fortitude --config-file ./test/fortitude.toml check ./srccurrently generates 40000+ linter errors in the CAM-SIMA codebase. While many of them are stylistic, others reveal real code quality concerns related to correctness, modernization, and portability.To avoid bombarding ourselves and contributors with the sheer number of existing linter errors, this PR takes a more incremental approach: Only the Fortran files that are changed in a PR are checked and reported. This allows us to gradually improve the CAM-SIMA codebase over time.
As a demonstration, this PR fixes the following linter errors in the
cam_logfilemodule:savestatement is superfluous at the module levelCONTAINSshould becontainsactionspecifieriostatused withoutiomsgusestatements are not sortedusestatements are not sortedusefor intrinsic module missing theintrinsicmodifierThe full linter output can be inspected in the CI logs.
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., initial, 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
Pass.
Known failing test.
Pass.