From 15bb9ab937236b4b95de6b0362490cda28eb77a9 Mon Sep 17 00:00:00 2001 From: Michael Duda Date: Mon, 15 Jun 2026 14:06:39 -0600 Subject: [PATCH 1/3] In atmosphere package setup, setup registry-defined packages after all 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. --- src/core_atmosphere/mpas_atm_core_interface.F | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core_atmosphere/mpas_atm_core_interface.F b/src/core_atmosphere/mpas_atm_core_interface.F index 21c651905e..ddae97d997 100644 --- a/src/core_atmosphere/mpas_atm_core_interface.F +++ b/src/core_atmosphere/mpas_atm_core_interface.F @@ -134,11 +134,6 @@ function atm_setup_packages(configs, streamInfo, packages, iocontext) result(ier integer :: local_ierr - ierr = atm_setup_packages_when(configs, packages) - if (ierr /= 0) then - return - end if - ! ! Incremental analysis update ! @@ -259,6 +254,11 @@ function atm_setup_packages(configs, streamInfo, packages, iocontext) result(ier #endif + ierr = atm_setup_packages_when(configs, packages) + if (ierr /= 0) then + return + end if + end function atm_setup_packages From 5825930eff38b15e68462a64c60d465d8c79bee4 Mon Sep 17 00:00:00 2001 From: Michael Duda Date: Mon, 15 Jun 2026 14:15:06 -0600 Subject: [PATCH 2/3] Simplify logic for the atmosphere core's 'sfclayer' registry-defined 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'. --- src/core_atmosphere/Registry.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 425e0349d1..89b49e67e7 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -487,7 +487,7 @@ active_when="trim(config_les_model) /= 'none'"/> + active_when="trim(config_sfclayer_scheme) /= 'off'"/> From fe73db6737de38fde54812f0ce20bd6e79aeeba9 Mon Sep 17 00:00:00 2001 From: Michael Duda Date: Mon, 15 Jun 2026 14:20:26 -0600 Subject: [PATCH 3/3] Only define the atmosphere core's 'sfclayer' package if DO_PHYSICS is 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. --- src/core_atmosphere/Registry.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 89b49e67e7..8c2b7a427b 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -485,9 +485,11 @@ +#ifdef DO_PHYSICS +#endif