Skip to content

Clear the SMS-3DTKE nonlocal momentum flux where the column is not convective - #2443

Merged
weiwangncar merged 1 commit into
wrf-model:release-v4.8.1from
mirfjc:sms3dtke_clear_stale_gamu
Nov 14, 2026
Merged

weiwangncar merged 1 commit into
wrf-model:release-v4.8.1from
mirfjc:sms3dtke_clear_stale_gamu

Conversation

@mirfjc

@mirfjc mirfjc commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

TYPE: bug fix

KEYWORDS: SMS-3DTKE, km_opt = 5, nonlocal flux, gamu, gamv

SOURCE: Mark I. Richardson (Aeolis Research)

DESCRIPTION OF CHANGES:
Problem:
In nonlocal_flux (dyn_em/module_diffusion_em.F), gamu and gamv are set only in convective columns. They are state arrays kept from step to step and applied every step in vertical_diffusion_implicit, so a column that stops being convective keeps its last nonlocal momentum flux for as long as it stays stable. Details in #2442.

Solution:
Set gamu and gamv to zero in the ELSE branch, next to pblflg = .false., as nlflux is already zeroed in every column. Convective columns are unchanged.

ISSUE:
Fixes #2442

LIST OF MODIFIED FILES:
M dyn_em/module_diffusion_em.F

TESTS CONDUCTED:

  1. Yes. Real data case, Hurricane Matthew, FNL 2016-10-06_00. d01 only, 100x70 at 30 km, 48 levels, time_step = 180, CONUS suite with bl_pbl_physics = 0, sf_sfclay_physics = 1, diff_opt = 2, km_opt = 5, 6 hours. Cells where the column is not convective (BR > 0, HFX <= 0 or PBLH <= 0) but GAMU or GAMV is not zero: before the fix 312 to 515 at each half-hourly output; after it, 0 at every output. Mean |gam| in convective cells is the same in both runs (8.3-8.9e-4 s-1). Built on release-v4.8.1 (28239d1) with configure option 35, Homebrew gfortran/gcc 16.2.0 at -O2, macOS on Apple Silicon, run on 1 MPI rank.
  2. The regression (Jenkins) tests have passed.

RELEASE NOTE: SMS-3DTKE (km_opt = 5): the nonlocal momentum flux is now cleared in columns that are not convective, instead of keeping its last convective value.

…nvective

nonlocal_flux sets gamu and gamv only in convective columns and leaves them alone elsewhere. They are kept between steps and vertical_diffusion_implicit applies them every step, so a column that stops being convective went on with the last convective value. Set them to zero in the non-convective branch.
@weiwangncar

Copy link
Copy Markdown
Collaborator

The regression test results:

Test Type              | Expected  | Received |  Failed
= = = = = = = = = = = = = = = = = = = = = = = =  = = = =
Number of Tests        : 23           24
Number of Builds       : 60           57
Number of Simulations  : 158           150        0
Number of Comparisons  : 95           86        0

Failed Simulations are: 
None
Which comparisons are not bit-for-bit: 
None

@weiwangncar

Copy link
Copy Markdown
Collaborator

@zhangxsms Can you take a look at this PR? Thanks!

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

Agreed by the original code contributor, Xu Zhang.

@weiwangncar
weiwangncar merged commit 3dac194 into wrf-model:release-v4.8.1 Nov 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants