From 848ce21aa400c06218893abca0c61f201746697a Mon Sep 17 00:00:00 2001 From: wwieder Date: Mon, 23 Nov 2026 06:18:36 -0700 Subject: [PATCH] NO3 runoff: keep the mixing-zone fraction of the straddling layer For the layer straddling depth_runoff_Nloss, the included fraction (D - z_{j-1})/dz was cancelled by dividing by (D - z_{j-1}), so the layer lost NO3 as if fully inside the mixing zone. Divide by the full layer thickness instead, consistent with surface_water. Fixes #4353 Co-Authored-By: Claude Opus 5.5 --- src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 index f0a42b379c..2e9a632998 100644 --- a/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90 @@ -234,9 +234,12 @@ subroutine SoilBiogeochemNLeaching(bounds, num_bgc_soilc, filter_bgc_soilc, & smin_no3_runoff_vr(c,j) = disn_conc * qflx_surf(c) * & h2osoi_liq(c,j) / ( surface_water(c) * col%dz(c,j) ) elseif ( zisoi(j-1) < depth_runoff_Nloss ) then + ! Only the fraction (depth_runoff_Nloss - zisoi(j-1))/dz of this layer's water + ! is in the mixing zone (consistent with surface_water above). The flux is + ! per unit volume of the whole layer, so divide by the full layer thickness. smin_no3_runoff_vr(c,j) = disn_conc * qflx_surf(c) * & h2osoi_liq(c,j) * ((depth_runoff_Nloss - zisoi(j-1)) / & - col%dz(c,j)) / ( surface_water(c) * (depth_runoff_Nloss-zisoi(j-1) )) + col%dz(c,j)) / ( surface_water(c) * col%dz(c,j) ) else smin_no3_runoff_vr(c,j) = 0._r8 endif