Skip to content

PLM sedimentation in WSM3/5/7 and WDM5/6/7 (nislfv_rain_plm) does not conserve mass: top-layer arrivals dropped, partial bottom cell rained out at its mean #2467

Open

Description

@mirfjc

Summary

The semi-Lagrangian sedimentation routine nislfv_rain_plm (and its variants nislfv_rain_plm6 and nislfv_rain_plmr) does not conserve mass. It is used for rain, snow, graupel, hail and cloud ice in WSM3, WSM5, WSM7, WDM5, WDM6 and WDM7, and the same code is in WSM6 in MMM-physics. There are two separate faults.

Fault A: arrivals in the top two layers are dropped

In the remap loop intp, find_kt searches kk=kt,km for the first arrival interface za(kk) at or above the top of target layer k, zi(k+1). With downward fall, za(km) < zi(km), so for the top two layers (k = km-1, km) no kk <= km qualifies. The loop ends without setting kt, kt keeps the stale value from the layer below, and kt = kt - 1 leaves it below kb. Neither branch then sets qn(k), so it stays 0. Whatever mass arrives in those two layers, including the sliver lifted when the 3rd-order interface speed wi goes slightly negative near the top, is lost. The search should include za(km+1), and the part of a layer above za(km+1) is empty.

Fault B: the partly below-ground cell is rained out at its mean

In sum_precip, the arrival cell that straddles the ground is rained out as qa(k)*(0.0-za(k)), the cell mean times the below-ground width. The above-ground part of the same cell goes to layer 1 through the PLM (piecewise linear) integral. When that cell has a slope (qpi(k) /= qmi(k), possible for k >= 2, that is when the fall in one step is deeper than the lowest layer), the two parts do not add up to the cell's mass. With mass increasing upward, as below a rain shaft, the surface precipitation is too high and mass is created.

Size

A standalone copy of the routine (from develop), REAL32, gfortran 16.2.0:

  • A uniform column of 8 units: 6.25 after one call (1.75 lost from the top). A linear ramp of 10 units with fall past the lowest layer: 10.125 (0.125 created at the ground).
  • An Earth-like rain column (50 layers, lowest layer 50 m, rain peak 0.5 g m-3 at 2 km, fall speed 3 to 9 m/s, top layers empty, so only fault B acts): surface precipitation per call too high by 1.06 % (dt 20 s), 0.75 % (60 s) and 0.09 % (120 s). The column aloft is unchanged.
  • Random columns with mass in every layer: worst relative mass error per call 57 % to 68 % (these use extreme Courant numbers, so they overstate real cases).

Where

Line numbers on release-v4.8.1 (find_kt loop / partial-cell precip line):

  • phys/module_mp_wsm3.F: nislfv_rain_plm 1415 / 1467 (nislfv_rain_pcm, 1190, has fault A but is not called)
  • phys/module_mp_wsm5.F: nislfv_rain_plm 1595 / 1647
  • phys/mic-wsm5-3-5-code.h: the vectorized nislfv_rain_plm, 1729 / 1804 (the scalar copy under #if 0, 1356 / 1408, is not compiled)
  • phys/module_mp_wsm7.F: nislfv_rain_plm 2446 / 2501, nislfv_rain_plm6 2713 / 2765
  • phys/module_mp_wdm5.F: nislfv_rain_plm 2088 / 2140
  • phys/module_mp_wdm6.F: nislfv_rain_plmr 2621 / 2673, nislfv_rain_plm6 2883 / 2935
  • phys/module_mp_wdm7.F: nislfv_rain_plmr 3003 / 3055, nislfv_rain_plm6 3265 / 3317

The code is the same on develop (1086c86), release-v4.8.1 (10b0659) and master (06d4240). WSM6 (physics_mmm/mp_wsm6.F90, NCAR/MMM-physics 550b5b494) has both faults in nislfv_rain_plm and nislfv_rain_plm6; I will report it there too.

Suggested fix

A minimal change that leaves every column where neither fault acts bit-for-bit unchanged:

  1. Let find_kt run to km+1. If no interface qualifies, set kt = km+1 and cap the layer top at za(km+1); use that capped top in the two th lines, and scale qn(k) by the filled fraction of the layer.
  2. Rain out the below-ground part of a sloped cell with the same PLM integral the remap uses: (qqd*tl*tl + qmi(k)*tl)*dza(k), with tl = (0.0-za(k))/dza(k), qqd = 0.5*(qpi(k)-qmi(k)).

A PR follows.

Activity

  1. dudhia commented on Nov 17, 2026

    @dudhia
    Collaborator

    @Songyou184 related information on issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions