Skip to content

Sync with MPAS-Dev v8.4.2 release - #287

Open
clark-evans wants to merge 17 commits into
ufs-community:noaa/developfrom
clark-evans:merge_master_8.4.2
Open

Sync with MPAS-Dev v8.4.2 release#287
clark-evans wants to merge 17 commits into
ufs-community:noaa/developfrom
clark-evans:merge_master_8.4.2

Conversation

@clark-evans

Copy link
Copy Markdown
Collaborator

This PR brings in the bugfixes from the MPAS-Dev v8.4.2 release. The only merge conflicts were:

  • Version number in the README.md
  • Version number in core_atmosphere/Registry.xml
  • Package definitions for the lbc_ni and lbc_nr files in core_atmosphere/Registry.xml; the ufs-community versions were kept but with their order swapped following MPAS-Dev v8.4.2.
  • Version number in core_init_atmosphere/Registry.xml

The bugfixes generally do not impact our forecasts, so I expect this to not be answer changing.

This should not be squash-merged to ensure the commit history from upstream is retained.

Mandatory Questions

  • Does this PR include any additions or changes to external inputs (e.g., microphysics lookup tables, static data for gravity-wave drag -- things like that)?
    • no
  • Does this PR require updating one or more baselines for the CI tests? If so, what?
    • no

Reviews

  • Is this PR currently draft, still being worked on, or ready for review?
    • ready for review
  • For when this PR begins review, please list the developers/collaborators you'd like to prioritize for review; e.g.,:

mgduda and others added 17 commits July 23, 2026 16:22
…PRINT macro

Registry-generated code in setup_packages.inc (generated by the
gen_pkg_debug_info registry function in gen_inc.c) may contain continuation
lines in the invocation of the PACKAGE_LOGIC_PRINT macro, and this can lead to
compilation failures with the nvfortran compiler. To work around this issue,
this commit avoids continuation lines with the PACKAGE_LOGIC_PRINT macro only
when compiling with the nvfortran or pgf90 compilers. This may result in source
lines longer than 132 columns, but in practice, recent releases of the nvfortran
compiler appear to have no problems with any of the source lines generated in
the current version of MPAS.
…om 2 to 4

This commit changes the default value of the atmosphere core namelist option
config_number_of_sub_steps from 2 to 4 in the Registry.xml file. This change
addresses an issue in convection-permitting simulations where noise can
sometimes appear in the jet streams using the previous default value
(config_number_of_sub_steps = 2). The noise, when present, also produces
unphysical features in horizontal kinetic energy spectra at high wavenumbers.
…4.2 (PR MPAS-Dev#1495)

This merge modifies the Registry code generation to work around an issue with
continuation lines in instances of the PACKAGE_LOGIC_PRINT macro when building
with the nvfortran compiler.

Registry-generated code in setup_packages.inc (generated by the
gen_pkg_debug_info registry function in gen_inc.c) may contain continuation
lines in the invocation of the PACKAGE_LOGIC_PRINT macro, and this can lead to
compilation failures with the nvfortran compiler. To work around this issue,
this merge avoids continuation lines with the PACKAGE_LOGIC_PRINT macro only
when building with the nvfortran or pgf90 compilers (or, more generally, when
the CPRPGI macro is defined). This may result in source lines longer than 132
columns, but in practice, recent releases of the nvfortran compiler appear to
have no problems with any of the source lines generated in the current version
of MPAS.

* framework/workaround_nhvpc_macro_issue:
  Work around nvfortran issue with continuation lines in PACKAGE_LOGIC_PRINT macro
…PAS-Dev#1496)

This merge changes the default value of the atmosphere core namelist option
config_number_of_sub_steps from 2 to 4 in the Registry.xml file. This change
addresses an issue in convection-permitting simulations where noise can
sometimes appear in the jet streams using the previous default value
(config_number_of_sub_steps = 2). The noise, when present, also produces
unphysical features in horizontal kinetic energy spectra at high wavenumbers.

Note: Increasing the number of sub-steps from 2 to 4 can be expected to increase
the computational cost of the dynamics by ~10%, and the computational cost of a
full-physics simulation by ~5%.

* atmosphere/sub_steps_default_4:
  Change default value of atmosphere core config_number_of_sub_steps from 2 to 4
…xml file

This commit swaps the order of 'lbc_ni' and 'lbc_nr' in the atmosphere core's
Registry.xml file so that the LBC fields for the 'ni' and 'nr' scalars are
defined in the same order as the tendencies ('tend_ni' and 'tend_nr') and state
('ni' and 'nr') for these scalars.

Note that unless LBCs are provided for 'ni' and 'nr', the previously incorrect
order of 'lbc_ni' and 'lbc_nr' would not affect results, as both fields would
be filled with zero values.
…PAS-Dev#1498)

This merge swaps the order of 'lbc_ni' and 'lbc_nr' in the atmosphere core's
Registry.xml file so that these LBC fields for the 'ni' and 'nr' scalars are
defined in the same order as the tendencies ('tend_ni' and 'tend_nr') and state
('ni' and 'nr') for these scalars.

Note that unless LBCs are provided for 'ni' and 'nr', the previously incorrect
order of 'lbc_ni' and 'lbc_nr' would not affect results, as both fields would be
filled with zero values.

Thanks to Trude Eidhammer (NSF NCAR / RAL; @trudeeidhammer) for identifying the
issue addressed in this merge.

* atmosphere/fix_lbc_ni_nr_order:
  Correct order of lbc_ni and lbc_nr in the atmosphere core's Registry.xml file
This commit fixes the OpenACC data movement for the field rho_zz in routine
mpas_atm_pre_compute_solve_diagnostics. Previously, an OpenACC create statement
was used for this field. This is still correct for the cold initialization case
, but produces incorrect results in the case of a restarted run. This has now
been changed to a copyin statement.

This issue was discovered as a result of restarted real simulations on GPUs
crashing. The unphysical values from the dynamical core lead to a segmentation
fault occuring in the SW radiation calls. Furthermore, the Jablonowski-
Williamson baroclinic wave case also showed discrepancies between the cold
initialization and the restarted test case. Both of these issues have been
addressed by this commit.
The library built from src/external/esmf_time_f90 contains MPAS's bundled
ESMF time-manager stubs, not the full ESMF. Naming the output file libesmf
lets the dynamic loader substitute a real ESMF library found via
LD_LIBRARY_PATH, which breaks every MPAS executable.

Set the target's OUTPUT_NAME to esmf_time so the library is built and
installed as libesmf_time.{so,a}, resolving the name conflict. The CMake
target and alias names are unchanged.
This merge addresses a lack of TKE in MPAS-A with the 1.5-order prognostic TKE
option when there is no TKE in the initial conditions (for example, in real-data
cases). In the prognostic TKE option, the source terms depend on non-zero TKE
through the horizontal and vertical diffusion coefficients, and so if the ICs
contain no TKE, no TKE will be generated. This merge addresses this issue by
setting a small lower-bound (0.01 m^2/s) on the 'eddy_visc_horz' and
'eddy_visc_vert' fields in the les_models() routine.

* lesfix-8.4.1:
  add minimum value for Kh and Kv to allow for zero initial tke
…MPAS-Dev#1503)

This merge corrects the OpenACC data movement for the field rho_zz in routine
mpas_atm_pre_compute_solve_diagnostics. Previously, an OpenACC 'create'
statement was used for this field. This was correct for cold-start simulations,
but produces incorrect results in the case of a restarted simulation. This merge
changes the 'create' statement to a 'copyin' statement, thereby correcting the
model restart capability when running on GPUs.

This issue was discovered as a result of restarted real-data simulation on GPUs
crashing. The unphysical values from the dynamical core lead to a segmentation
fault occurring in the SW radiation calls. Furthermore, the Jablonowski and
Williamson baroclinic wave case also showed discrepancies between the cold
initialization and the restarted test case. Both of these issues have been
addressed by this merge.

* atmosphere/fix_acc_data_movement:
  Fix for GPU-enabled restart runs
…ev#1506)

This merge renames the internal ESMF time manager library to libesmf_time in
CMake builds of MPAS, matching the name used in GNU Make builds.

The library built from src/external/esmf_time_f90 contains MPAS's bundled ESMF
time-manager, not the full ESMF. Prior to this merge, naming the library file
libesmf allowed the dynamic loader substitute a full ESMF library found via
LD_LIBRARY_PATH, breaking the MPAS executable. By setting the target's
OUTPUT_NAME to esmf_time in src/external/esmf_time_f90/CMakeLists.txt so the
library is built and installed as libesmf_time.{so,a}, this issue can be
avoided. Note that the CMake target and alias names are unchanged.

* bugfix/external-esmf-fix:
  Rename bundled ESMF time-manager library output to esmf_time
This merge addresses several issues in the MPAS-Atmosphere model and in the MPAS
infrastructure. Specific changes include:

 * Fix an issue with the naming of MPAS's internal ESMF time-keeping library in
   CMake builds of MPAS. (PR MPAS-Dev#1506)

 * Fix an issue with restart runs in MPAS-Atmosphere on GPUs. (PR MPAS-Dev#1503)

 * Address a lack of TKE in MPAS-Atmosphere with the 1.5-order prognostic TKE
   option when there is no TKE in the initial conditions (for example, in
   real-data cases). (PR MPAS-Dev#1499)

 * Correct the ordering of the 'lbc_ni' and 'lbc_nr' scalars in the atmosphere
   core's Registry.xml file. Note that unless LBCs are provided for 'ni' and
   'nr', the previously incorrect order of 'lbc_ni' and 'lbc_nr' would not
   affect results, as both fields would be filled with zero values. (PR MPAS-Dev#1498)

 * Change the default value of the config_number_of_sub_steps namelist option
   from 2 to 4 in the atmosphere core's Registry.xml file to address an issue in
   convection-permitting simulations where noise can sometimes appear in the jet
   streams using the previous default value of 2. The noise, when present, also
   produces unphysical features in horizontal kinetic energy spectra at high
   wavenumbers. (PR MPAS-Dev#1496)

   Note: Increasing the number of sub-steps from 2 to 4 can be expected to
   increase the computational cost of the dynamics by ~10% and the
   computational cost of a full-physics simulation by ~5%.

 * Work around an issue with continuation lines in instances of the
   PACKAGE_LOGIC_PRINT macro that prevented successful compilation of
   MPAS-Atmosphere with the 'nvfortran' compiler. (PR MPAS-Dev#1495)

* hotfix-v8.4.2:
  Rename bundled ESMF time-manager library output to esmf_time
  Fix for GPU-enabled restart runs
  Correct order of lbc_ni and lbc_nr in the atmosphere core's Registry.xml file
  add minimum value for Kh and Kv to allow for zero initial tke
  Change default value of atmosphere core config_number_of_sub_steps from 2 to 4
  Work around nvfortran issue with continuation lines in PACKAGE_LOGIC_PRINT macro
  Update version number to 8.4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Not assigned

Development

Successfully merging this pull request may close these issues.

5 participants