Skip to content

Take CIME constants from the Physical Constants Dictionary - #782

Merged
xylar merged 1 commit into
MPAS-Dev:masterfrom
xylar:cime-constants-from-pcd
Nov 20, 2026
Merged

xylar merged 1 commit into
MPAS-Dev:masterfrom
xylar:cime-constants-from-pcd

Conversation

@xylar

@xylar xylar commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

mpas_tools.cime.constants had 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's share/pcd.yaml (v0.4.0), parsed as in polaris.constants.pcd. Notably, SHR_CONST_REARTH becomes the PCD radius, which MPAS-Ocean now requires (E3SM-Project/E3SM#9208).

For reviewers:

  • ruamel.yaml is 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

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>
@xylar xylar self-assigned this Nov 20, 2026
@xylar
xylar merged commit dfa5cda into MPAS-Dev:master Nov 20, 2026
5 checks passed
@xylar
xylar deleted the cime-constants-from-pcd branch November 20, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Take mpas_tools.cime.constants from the PCD; they're out of date with E3SM

1 participant