Skip to content

Atmosphere/package eval order#1473

Draft
mgduda wants to merge 3 commits into
MPAS-Dev:developfrom
mgduda:atmosphere/package_eval_order
Draft

Atmosphere/package eval order#1473
mgduda wants to merge 3 commits into
MPAS-Dev:developfrom
mgduda:atmosphere/package_eval_order

Conversation

@mgduda

@mgduda mgduda commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

This PR incorporates several small modifications to the registry-defined package logic processing in the atmosphere core, especially concerning the sfclayer package, ultimately allowing for improved evaluation of physics namelist options in package logic.

mgduda added 3 commits June 15, 2026 14:06
…l others

This commit moves the call to atm_setup_packages_when (i.e., to the call to
setup registry-defined packages) to the end of the atmosphere core's
atm_setup_packages routine. This allows any modifications to namelist variables
that are applied by earlier package setup logic to be visible to the
registry-defined package logic. In particular, this allows changes to physics
namelist options for physics suites and physics schemes to be visible to the
registry-defined packages.

At present, the only registry-defined package in the atmosphere core that
references physics namelist options is the 'sfclayer' package, and the
conversion of suite-defined physics options (e.g., config_sfclayer_scheme) to
the actual names of physics options will not alter the logic of the 'sfclayer'
package. Accordingly, the changes in this commit will have no impact on the
model.
…package

This commit simplifies the logic defined by the 'active_when' attribute for the
atmosphere core's 'sfclayer' registry-defined package. Since registry-defined
packages are set up after the call to physics_namelist_check, which happens as
part of the broader physics package setup, the 'config_sfclayer_scheme' namelist
option can be assumed to be any of the valid surface layer schemes, or 'off',
and there is no need to consider the possibility that 'config_sfclayer_scheme'
is set to 'suite'.
… defined

Since the 'sfclayer' package refers to physics namelist options that only exist
if MPAS-A is being compiled with it's stand-alone physics options, the
'sfclayer' package should only be defined in the Registry.xml file for the
atmosphere core when DO_PHYSICS is defined.

#endif

ierr = atm_setup_packages_when(configs, packages)

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.

Not sure if users/community are expected to add new logic in this function, but adding a brief comment about this call needing to follow any new logic might be useful.

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.

2 participants