Skip to content

Conversation

@clark-evans
Copy link
Collaborator

This PR merges NCAR's upstream v8.3.1 code into gsl/develop. There are only two changes:

  1. Updated manage_externals tag for NCAR's physics_mmm repo, fixing a recompilation bug.
  2. A fix for the vertical interpolation of relative and specific humidity for lateral boundary conditions when the input data are arranged from top-to-bottom rather than bottom-to-top.

Everything else is a version number change, and I have removed the conflicts from the upstream versions in README.md, core_atmosphere/Registry.xml, and core_init_atmosphere/Registry.xml.

Requested priority reviewers: no preference.

mgduda and others added 6 commits June 13, 2025 13:35
… top-to-bottom

Note: The changes in this commit mirror those in commit f232665, but this
commit concerns to the code for producing LBCs rather than the code for
producing ICs.

The code in the init_atm_case_lbc routine for vertically interpolating relative
humidity and specific humidity for LBCs assumed that first-guess levels would be
given in bottom-to-top order when attempting to vertically extrapolate to model
levels below the lowest first-guess level. The relevant code for relative
humidity read as follows -- the code for specific humidity is similar.

  if (target_z < z_fg(1,iCell) .and. k < nVertLevels) relhum(k,iCell) = relhum(k+1,iCell)

If first-guess levels are not given in bottom-to-top order, then z_fg(1,iCell)
does not necessarily contain the height of the surface in the first-guess data,
resulting in a copy of vertically interpolated relative humidity level k+1 to
level k.

One possible fix for this issue might be to compare target_z with
sorted_arr(1,1). Since sorted_arr is always sorted in ascending order by its
first index, the check to decide when to copy/extrapolate relative humidity
would be independent of the order in which first-guess levels were provided.
If the comparison were to be made against sorted_arr(1,1) rather than against
z_fg(1,iCell), the effect would be to copy the lowest *interpolated* level
downward to model levels below the first-guess ground.

An alternative fix adopted in this commit is to simply delete the logic to
explicitly copy/extrapolate downward, since both relative humidity and specific
humidity are vertically interpolated with extrap=0, which specifies constant-
value extrapolation. In this case, the lowest *first-guess* level -- rather than
the lowest *interpolated* level -- is copied downward.

Note: The issue being addressed by this commit is a dependence on the order in
which levels are given in the input intermediate file, and not on the direction
in which the first-guess model indexes its levels.
This commit updates the tag to 20250616-MPASv8.3 for the MMM-physics external in
the src/core_atmosphere/Externals.cfg file to address an issue with .F90 files
not being re-compiled to .o files if a .F90 file was modified. With the updated
tag, compiling the atmosphere core, then making changes to any of the .F90 files
in src/core_atmosphere/physics/physics_mmm/, then running 'make' again (without
first cleaning) leads to the modified .F90 files correctly being re-compiled.
MPAS-Dev#1335)

This merge fixes a bug in the vertical interpolation of humidity for LBCs when
first-guess levels are given in top-to-bottom order.

Note: The changes in this merge mirror those in merge commit d3ab76a (MPAS-Dev#936),
but this merge concerns to the code for producing LBCs rather than the code for
producing ICs.

The code in the init_atm_case_lbc routine for vertically interpolating relative
humidity and specific humidity for LBCs assumed that first-guess levels would be
given in bottom-to-top order when attempting to vertically extrapolate to model
levels below the lowest first-guess level. The relevant code for relative
humidity read as follows -- the code for specific humidity is similar.

  if (target_z < z_fg(1,iCell) .and. k < nVertLevels) relhum(k,iCell) = relhum(k+1,iCell)

If first-guess levels are not given in bottom-to-top order, then z_fg(1,iCell)
does not necessarily contain the height of the surface in the first-guess data,
resulting in a copy of vertically interpolated relative humidity level k+1 to
level k.

The fix adopted in this merge is to simply delete the logic to explicitly
copy/extrapolate downward, since both relative humidity and specific humidity
are vertically interpolated with extrap=0, which specifies constant-value
extrapolation. In this case, the lowest first-guess level -- rather than the
lowest interpolated level -- is copied downward.

* init_atmosphere/fix_lbc_rh_extrap:
  Fix bug in vertical interp of humidity for LBCs when levels are given top-to-bottom
…PAS-Dev#1337)

This merge updates the MMM-physics external tag to 20250616-MPASv8.3 in the
src/core_atmosphere/Externals.cfg file to address an issue with .F90 files not
being re-compiled to .o files if a .F90 file was modified. With the updated tag,
compiling the atmosphere core, then making changes to any of the .F90 files in
src/core_atmosphere/physics/physics_mmm/, then running make again (without first
cleaning) leads to the modified .F90 files being correctly re-compiled.

* atmosphere/update_mmm_phys_tag:
  Update MMM-physics tag in Externals.cfg to fix .F90 re-compilation issue
@clark-evans
Copy link
Collaborator Author

The new regression tests completed successfully, but one needed to be re-run because of a crash at the miniconda stage. The ufs-community tests all pass with no changes, but the MPAS-Dev tests show differences in the refl10cm_1km_max and updraft_helicity_max diagnostics (history files are unchanged). This is also true for #146 and #161, however. I'll open an issue.

@jderrico-noaa jderrico-noaa merged commit 3e1e439 into gsl/develop Sep 19, 2025
33 checks passed
@clark-evans clark-evans deleted the v8.3.1-merge branch September 19, 2025 16:17
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.

9 participants