Repository navigation
Take CIME constants from the Physical Constants Dictionary - #782
Merged
Merged
Conversation
E3SM now sets most constants in shr_const_mod from the Physical Constants Dictionary (PCD) in share/pcd.yaml, so several hard-coded values in mpas_tools.cime.constants were out of date, including the Earth radius and gravity. Add mpas_tools.constants with a copy of E3SM's pcd.yaml (v0.4.0) and a parser adapted from polaris.constants.pcd, and build the SHR_CONST_* constants from it as shr_const_mod does. The test now checks the packaged PCD against E3SM's and evaluates shr_const_mod.F90 to check each constant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
mpas_tools.cime.constantshad fallen out of date with E3SM, which now takes its constants from the Physical Constants Dictionary (PCD). This PR takes them from a packaged copy of E3SM'sshare/pcd.yaml(v0.4.0), parsed as inpolaris.constants.pcd. Notably,SHR_CONST_REARTHbecomes the PCD radius, which MPAS-Ocean now requires (E3SM-Project/E3SM#9208).For reviewers:
ruamel.yamlis a new run dependency; PyYAML misreads some PCD values.mpas_tools.constants.get_constant()is new public API for looking up constants by PCD name.Fixes #781
Posted by Claude Code on @xylar's behalf. The wording above is AI-authored; please check it accordingly.
🤖 Generated with Claude Code