Skip to content

Fix RUC soil moisture/temperature init from 4-layer first-guess soil - #332

Open
LarissaReames wants to merge 2 commits into
ufs-community:noaa/developfrom
windborne:noaa/develop
Open

LarissaReames wants to merge 2 commits into
ufs-community:noaa/developfrom
windborne:noaa/develop

Conversation

@LarissaReames

Copy link
Copy Markdown

Summary

When init_atmosphere makes a 9-level RUC start file (config_nsoillevels = 9) from 4-layer first-guess soil (nFGSoilLevels == 4, e.g. GFS), init_soil_properties_ruc in src/core_atmosphere/physics/mpas_atmphys_initialize_real.F has two coding errors. Both differ from the WRF routine it was ported from (share/module_soil_pre.F, init_soil_3_real).

Effects:

  • the RUC soil column is dried by roughly a quarter relative to the first-guess water it is meant to match;
  • the wrong temperature is put at 3 m.

This PR fixes the two lines and changes nothing else.


The bugs

Bug 1: the RUC bucket sum never accumulates (line 775)

     smtotr(iCell)=0.0_RKIND
     DO iSoil=1,nSoilLevels-1
          smtotr(iCell)=smtotn(iCell) + smois(iSoil,iCell) *dzs(iSoil,iCell)   ! adds Noah's total + one layer
     ENDDO
  • After the loop, smtotr holds Noah's bucket plus only the last RUC layer, not the RUC column.
  • The correction just below, smois = smois*smtotn/(0.9*smtotr), then scales levels 1-8 by too small a factor. The RUC column ends at about 0.76 of the Noah water.
  • With the sum fixed, the same line gives smtotn/0.9, about 1.11 times the Noah water, as in WRF (see Background below).
  • WRF accumulates smtotr = smtotr + smois(k)*dzs(k) (module_soil_pre.F, WRF 4.7.1 lines 2072-2076).
  • The later sums in the same MPAS routine, after the correction, already accumulate correctly.

Fix: smtotr(iCell)=smtotn(iCell) + ... → smtotr(iCell)=smtotr(iCell) + ...

Bug 2: the 3 m anchor overwrites the 4th first-guess depth (line 756)

     zhave(nFGSoilLevels,iCell) = 300.0_RKIND / 100.0_RKIND
  • zhave has nFGSoilLevels+2 entries:
    • 0 m;
    • the four first-guess depths;
    • 3 m, where st_input holds tmn and sm_input repeats the deepest value.
  • This line overwrites entry 4 (the 1 m depth) with 3 m and leaves entry 6 unset.
  • As a result the first-guess 100-200 cm layer is never used:
    • RUC levels below 40 cm are interpolated between the 40 cm value and a "3 m" point that really holds the 40-100 cm values;
    • tmn never reaches 3 m.
  • WRF sets zhave(num_st_levels_input+2) = 300./100. (module_soil_pre.F, WRF 4.7.1 lines 1987 and 2042).
  • The Noah path in the same file (line 554) already uses zhave(nFGSoilLevels+2,iCell).

Fix: zhave(nFGSoilLevels,iCell) → zhave(nFGSoilLevels+2,iCell)


Background

Where these lines came from

  • Both lines date from the routine's first version: commit 87c8f99 (2024-03-28) in Add up-to-date RUC LSM and surface diagnostics to the gsl/develop #3 ("Add up-to-date RUC LSM and surface diagnostics to the gsl/develop"). It was squash-merged as e38a63e.
  • Neither line has changed since.
  • That same commit wrote the Noah path's 3 m line correctly, with a comment: zhave(nFGSoilLevels+2,iCell) = 300._RKIND/100._RKIND ! Set depth of bottom of last layer to 3m.
  • So both bugs look like slips in porting WRF's init_soil_3_real, not choices.

Background: the 0.9 factor

  • The 0.9 in the scaling line is deliberate. It came from Bug fix for initializing RUC LSM from GFS soil moisture data wrf-model/WRF#288 (commit 881a2db, 2017; source Tanya Smirnova, NOAA/ESRL/GSD).
  • That PR addressed RUC initialized from GFS/NAM soil producing "an enormous moist and cold bias due to excessive soil moisture". Its description says it "computes the Noah and RUC soil moisture buckets in the top 2 m, allows RUC bucket to be larger, but to compensate for that it reduces soil moisture in the top layers in case the surface is drier than underlying layers". That last part is the 0.75-0.95 factorsm step.
  • MPAS carries the same design, but bug 1 defeats it: the column ends up drier than the first-guess water rather than slightly wetter.
  • This PR restores the WRF behaviour and leaves the 0.9 and factorsm as they are.

What changes and what does not

Changes: only smois and tslb, only on land cells, only in 9-level RUC start files made from 4-layer first-guess soil.

Unchanged:

  • start files with 4 soil levels (Noah / Noah-MP);
  • the nFGSoilLevels == 9 input branch (RAP/HRRR initial conditions);
  • water cells.

Not addressed by this PR:

  • For the 9-level path, init_soil_layers_depth leaves zs_fg at the layer bottoms (10, 40, 100, 200 cm).
  • WRF uses layer middles there, as MPAS's own 4-level path does.
  • We tested a switch for that separately. It looks like a choice rather than a bug, so it is left for a separate discussion.

Impact

Measured on a Europe 3 km domain on three August 2026 starts. GFS supplied the land fields; another model's analysis supplied the atmosphere.

Start-file soil water (checked against the routine's own target, not observations)

We made two start files from the same GFS soil input: a 4-level (Noah) file and a 9-level (RUC) file. The reference column below is the first-guess water as the 4-level file carries it. It is the routine's target, not an observation.

Top-1 m soil moisture, land mean (m3/m3):

start 4-level file (GFS soil, the target) RUC, current code RUC, this PR
2026082712 0.158 0.129 (-18%) 0.167 (+6%)
2026081700 0.149 0.117 (-22%) 0.156 (+5%)
2026082206 0.161 0.135 (-16%) 0.171 (+6%)

Column water ratio RUC / 4-level (median over land):

  • current code: 0.70-0.78;
  • this PR: 1.10, which is what the scaling line gives (as in WRF).

Deep soil temperature

  • The 3 m level becomes tmn.

  • Land-mean changes:

    depth change
    0.6 m -0.4 to -0.6 K
    1 m -1.0 to -1.8 K
    3 m -6.5 K
  • Levels 0-0.3 m are unchanged.

Forecasts (checked against observations)

The suite was hrrrv5: RUC LSM, MYNN, Thompson/TEMPO. We ran 48 h forecasts with MPAS 8.4.2 physics on the same three starts and verified them against METAR 2 m observations:

  • 2 m dew point RMSE fell from 2.27 to 1.99 K;
  • the midday dry bias almost disappears;
  • 2 m temperature becomes about 0.3-0.5 K cooler by day.

This is the only comparison with observations. Soil moisture itself was not verified against observations (e.g. SMAP or ISMN).

Operational relevance

RRFS cold starts from GFS take this path (nfgsoillevels = 4, 9 RUC levels). The dried soil then carries through soil cycling from that first cold start.


Testing

The tests used the same two-line change applied to MPAS 8.4.2 (NOAA fork). The code we tested is equivalent to noaa/develop on this path:

  • init_soil_properties_ruc there is identical to noaa/develop apart from these two lines;
  • the 9-level path through init_soil_layers_depth is also unchanged (noaa/develop's new 10-level Noah-MP option does not touch it).
check result
4-level (Noah-MP) start file, patched vs unpatched build all 153 variables byte-identical
9-level RUC start file, patched vs unpatched, three starts 151 variables byte-identical; only smois and tslb differ, only on land
smois vs an independent offline (numpy, float64) version of the fixed routine max abs difference 1.4e-7 over 260,487 land cells
unpatched build vs the offline "as written" version max abs difference 1.0e-7
48 h forecasts, three starts see Forecasts

A build and run from this exact branch will follow as a comment.


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?
    • TBD. Only a baseline whose init case writes 9 RUC levels from 4-layer first-guess soil would change, and only in smois and tslb.

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.,:

cc: @JeffBeck-NOAA @clark-evans

LarissaReames and others added 2 commits November 30, 2026 11:20
init_soil_properties_ruc (nFGSoilLevels == 4 path) had two coding errors,
both different from WRF's share/module_soil_pre.F (init_soil_3_real):

- The RUC bucket sum smtotr was set to smtotn + smois(k)*dzs(k) inside the
  loop instead of accumulating, so the Noah-bucket correction used Noah's
  total plus only the last RUC layer, drying the RUC column to ~0.76 of the
  Noah water instead of the intended 1/0.9.
- The 3 m anchor was written to zhave(nFGSoilLevels) instead of
  zhave(nFGSoilLevels+2), overwriting the 4th first-guess depth, so the
  first-guess 100-200 cm layer was never used and tmn never reached 3 m.

Only smois and tslb on land change, only for 9-level (RUC) start files made
from 4-layer first-guess soil (e.g. GFS).
…p-anchor

Fix RUC soil moisture/temperature init from 4-layer first-guess soil

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the RUC soil-initialization corrections.

No open issues 🎉

What changed in this PR

Fixes two errors in MPAS’s nine-level RUC soil initialization from four-layer first-guess soil data.

Changes:

  • Places the 3 m depth anchor in the correct array entry for interpolation.
  • Correctly accumulates the RUC soil-moisture total before rescaling.
File Description
src/​core_atmosphere/​physics/​mpas_atmphys_initialize_real.F Corrects the depth-anchor index and moisture accumulation in RUC initialization.

Review effort: Balanced

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

Fuck yeah, Larissa!

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