Skip to content

Methane: snow and pond resistance double-counted in the saturated ch4_tran pass (grnd_ch4_cond overwritten in sat=0 pass) #4350

In review

Description

@wwieder

Brief summary of bug

At the end of each ch4_tran call, grnd_ch4_cond(c) (associated with ch4_inst%grnd_ch4_cond_col) is overwritten with spec_grnd_cond(c,1), which already includes the snow and pond resistances. The driver calls ch4_tran first for the unsaturated fraction (sat = 0) and then for the inundated fraction (sat = 1) without resetting grnd_ch4_cond_col in between. The sat = 1 pass therefore adds the snow and pond resistances a second time. Under snow or ponded water, the inundated-fraction CH4 and O2 surface exchange uses a doubled resistance. The WTGQ history field (surface tracer conductance) is written from this value and reports the doubled resistance.

Found in the CTSM correctness audit at ctsm5.4.065 (finding CH4-002, severity A-critical: https://project.cgd.ucar.edu/projects/bdobbins/ctsm/#i~CH4-002). Re-checked by hand: the bug is still present on master (ctsm5.4.069).

General bug information

CTSM version you are using: ctsm5.4.065, and still present at ctsm5.4.069. Present since the methane model was brought to the trunk in clm4_0_60 (2013).

Does this bug cause significantly incorrect results in the model's science? Small effect on fluxes (the water-layer resistance usually dominates for the inundated fraction), but definitely wrong, and WTGQ is wrong under snow.

Configurations affected: All runs with use_lch4 = .true. (the default whenever soil_decomp_method is not None) when snow or ponded water is present. Lake columns are not affected.

Details of bug

The surface boundary conductance should combine each resistance once, in series: g = 1 / (1/w + R_snow + R_pond).

In ch4 (driver, ctsm5.4.069), the bare boundary-layer conductance is set once per timestep, before the saturated/unsaturated loop:

2109   call p2c (bounds, num_soilc, filter_soilc, &
            grnd_ch4_cond_patch(bounds%begp:bounds%endp), &
            grnd_ch4_cond_col(bounds%begc:bounds%endc))
       ...
2127   do sat = 0, 1 ! 0 == unsaturated; 1 = saturated
          ...
2196      call ch4_tran (bounds, num_soilc, filter_soilc, jwt(begc:endc), dtime_ch4, sat, lake, ...)
       enddo

In ch4_tran:

4224   spec_grnd_cond(c,s) = 1._r8/(1._r8/grnd_ch4_cond(c) + snowres(c) + pondres)
       ...
4737   ! For history make sure that grnd_ch4_cond includes snow, for methane diffusivity
4738   grnd_ch4_cond(c) = spec_grnd_cond(c,1)

After the sat = 0 call, grnd_ch4_cond already includes snowres and the unsaturated pondres. The sat = 1 call then computes 1/(1/w + 2·R_snow + R_pond,unsat + R_pond,sat). For O2 (s = 2), the base it starts from in the sat = 1 pass also contains the CH4 snow resistance. p2c resets the value every timestep, so nothing accumulates across timesteps.

Lakes are not affected: LakeTemperatureMod resets grnd_ch4_cond_col every step, and lakes go through ch4_tran once, with sat = 1.

History

The overwrite and the sat = 0, 1 loop structure have been there since the methane model (Riley et al. 2011) arrived on the trunk in clm4_0_60 (f003690b8, 2013-02-11, "Bring CLM4.5 code from clm45sci branch to trunk"). In that version p2c sets grnd_ch4_cond_col once (line 391), the loop do sat = 0, 1 (line 414) calls ch4_tran twice, and ch4_tran overwrites the conductance with spec_grnd_cond(c,1) (line 2394). The development history before that lives on the clm45sci branch, which is not in this repository's history.

git blame on master attributes the lines to f2d2d1a47 (Sean Swenson, 2026-03-04, "wetland/methane updates", in ctsm5.4.056), but that commit only moved them; the logic is unchanged. Before it, blame gives 9cb738a4f (clm4_5_1_r081, 2014), which moved the clm4_5 source tree into src/, and then f003690b8.

Proposed fix

Only write the snow- and pond-inclusive value back for history on the last call of the timestep (sat = 1, which also covers the single lake call):

! For history make sure that grnd_ch4_cond includes snow, for methane diffusivity.
! Only do this on the last (saturated / lake) call of the timestep: ch4_tran is
! called for sat=0 and then sat=1 with the same grnd_ch4_cond, so overwriting it
! during the sat=0 call would add the snow and pond resistances a second time
! in the sat=1 call.
if (sat == 1) then
   grnd_ch4_cond(c) = spec_grnd_cond(c,1)
end if

A cleaner alternative is a separate diagnostic array (e.g. grnd_ch4_cond_tot_col) for WTGQ, leaving the input conductance untouched. The guard above is the minimal change.

Suggested testing

  • ERP_D_Ld10_P64x2.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-ciso_decStart (December start, so there is snow): expect baseline diffs in CH4_SURF_*_SAT and WTGQ only where snow or ponding is present. Restart tests must stay bit-for-bit.

Analysis prepared with AI assistance (Claude) from the audit record, the ctsm5.4.069 source and git history; reviewed by the issue author.

Activity

  1. added
    bug
    science
    on Nov 23, 2026
  2. self-assigned this
    on Nov 23, 2026
  3. added theissue type on Nov 23, 2026
  4. added
    AI (LLM) guidance
    on Nov 23, 2026
  5. added
    AI (LLM) guidance
    AI-generated
    investigation
    and removed
    AI (LLM) guidance
    on Nov 23, 2026
  6. wwieder commented on Dec 3, 2026

    @wwieder
    ContributorAuthor

    @swensosc can you help evaluate this bug and the suggested fix in #4351?

  7. swensosc commented on Dec 4, 2026

    @swensosc
    Contributor

    grnd_ch4_cond is initially calculated in BareGroundFluxesMod.F90 and CanopyFluxesMod.F90, and passed to ch4_tran. Near the end of ch4_tran, it gets overwritten by spec_grnd_cond(c,1). So subsequent calls to ch4_tran will use the updated value. The fix eliminates the intermediate overwrite, so both calls see the same value of grnd_ch4_cond, after which it is overwritten. Lake behavior is unchanged, because lake columns only call ch4_tran once, for saturated conditions (s==1).

  8. wwieder commented on Dec 4, 2026

    @wwieder
    ContributorAuthor

    just clarifying Sean did confirm this is a bug, his logic for this is above.

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

Metadata

Metadata

Assignees

Labels

AI-generatedbuginvestigationscience

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions