Skip to content

Remove references to physcons module from SCM - #653

Open
scrasmussen wants to merge 1 commit into
NCAR:mainfrom
scrasmussen:rm-physcons-from-scm
Open

Remove references to physcons module from SCM#653
scrasmussen wants to merge 1 commit into
NCAR:mainfrom
scrasmussen:rm-physcons-from-scm

Conversation

@scrasmussen

@scrasmussen scrasmussen commented Jan 15, 2026

Copy link
Copy Markdown
Member

SOURCE: Soren Rasmussen, NSF NCAR

DESCRIPTION OF CHANGES:

  • Removes direct dependencies on the global physcons module from CCPP physics schemes.
  • Supplies physical constants through explicit CCPP arguments, with standard names, units, and metadata.
  • Makes each scheme’s required constants visible in its interface instead of relying on hidden module state.
  • Improves portability and reuse of physics schemes in different host models and configurations.
  • Simplifies dependency tracking, testing, and maintenance by centralizing ownership of physical constants in the host/CCPP framework.

ISSUE: #652

TESTS CONDUCTED:

RELATED PRs:

@scrasmussen
scrasmussen force-pushed the rm-physcons-from-scm branch 2 times, most recently from 68ef7be to c2e06ac Compare January 27, 2026 22:14

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

Code changes look good to me. Only 1 minor comment to take or leave.

Comment thread scm/src/scm_physical_constants.F90 Outdated
real(kind=dp),parameter:: con_avgd =6.0221415e23_dp
real(kind=dp),parameter:: con_amd =28.9644_dp !< molecular wght of dry air (\f$g/mol\f$)
real(kind=dp),parameter:: con_amw =18.0154_dp
real(kind=dp),parameter:: con_amo3 =47.9982_dp

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.

should we add the description for this one that's being added?
!< molecular wght of o3 (\f$g/mol\f$)

@scrasmussen scrasmussen Jan 28, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add that, thanks!

@grantfirl

Copy link
Copy Markdown
Collaborator

Were all new additions to scm_physical_constants.F90/meta from UFS? (e.g. did you have to come up with any new metadata?)

@dustinswales dustinswales left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove the intent attribute from the host-model metadata.
Other than that this looks fine.
Thanks for making these changes!

Comment thread scm/src/scm_physical_constants.meta Outdated
dimensions = ()
type = real
kind = kind_phys
intent = in

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent attribute is not needed for host-model metadata.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks for the feedback!

@scrasmussen

Copy link
Copy Markdown
Member Author

Were all new additions to scm_physical_constants.F90/meta from UFS? (e.g. did you have to come up with any new metadata?)

The metadata changes here are all ones that I came up with (based on the comments in the physics and physcon files). I was able to find existing definitions for a lot of physcon variables but not for these references. I may have missed something but I did check the UFSATM/ccpp/data/*.meta files and the existing metadata files in the SCM.

@scrasmussen
scrasmussen force-pushed the rm-physcons-from-scm branch from 3f8d05a to b9193f1 Compare July 31, 2026 20:51
@grantfirl

Copy link
Copy Markdown
Collaborator

@scrasmussen Unfortunately, this may need some more attention after the capgen-ng merge. I noticed several changes to physcons. Hopefully, it isn't too much additional work.

@scrasmussen

Copy link
Copy Markdown
Member Author

@scrasmussen Unfortunately, this may need some more attention after the capgen-ng merge. I noticed several changes to physcons. Hopefully, it isn't too much additional work.

@grantfirl thanks for the heads up! I was wanting to update this to test the new physcons-less CCPP physics (once I work out those last few bugs and submit the PRs) so shouldn't be too much additional work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants