You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously untested: rootdepth_main (entirely) and the !freedrain branch of soilfluxes. Running these paths exposed three bugs in RootDepth.jl that caused runtime errors before any assertions could be checked.
Bugs fixed in RootDepth.jl
freedrain type mismatch — soilfluxes expects freedrain::Bool but rootdepth_main passes freedrain::Int directly as a keyword arg; Julia does not auto-convert. Fixed with Bool(freedrain).
Undefined isotope variables — Lines referencing transpo18step and updated_o18 (removed when isotope tracking was commented out from soilfluxes) caused UndefVarError on any active vegetation cell. Commented out.
dθ scope bug — dθ was first assigned inside the for itime loop but read at line 260 outside it. Julia may not expose loop-internal variables in the enclosing scope. Fixed by pre-initializing dθ = zeros(Float64, nzg) before the loop.
Tests added
test/test_rootdepth.jl — Four testsets: zero-landmask skip, water-body cell (veg=1), free-drain vegetation cell (veg=7), non-free-drain vegetation cell (veg=7). Exercises the full call chain including extraction, soilfluxes, and updatewtd_shallow.
test/test_soil_fluxes.jl — Three new testsets for !freedrain: jwt≤2 branch (water table below all layers), jwt>3 branch (water table at a mid-layer), and a free vs. non-free-drain comparison verifying rech=0 for non-free-drain and rech<0 for free-drain (negative = downward drainage).
Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.
Thanks for integrating Codecov - We've got you covered ☂️
rootdepth_main tests — added test/test_rootdepth.jl with four testsets: zero-landmask skip, water-body cell (veg=1), free-drain vegetation cell, and non-free-drain vegetation cell. Also fixed three bugs in RootDepth.jl that blocked active-cell execution (undefined transpo18step/updated_o18 variables; freedrain::Int → Bool mismatch in soilfluxes call).
!freedrain (非自由排水) tests — added three new testsets in test_soil_fluxes.jl: jwt≤2 branch (water table below all layers), jwt>3 branch (water table in a middle layer), and a free vs non-free-drain comparison verifying that rech=0.0 for non-free-drain and rech<0 for free-drain (downward drainage sign convention).
CopilotAI
changed the title
Add comprehensive tests for Julia-translated modules; fix 4 source bugs blocking test execution
Add comprehensive tests for Julia-translated modules; fix 6 source bugs blocking test execution
May 31, 2026
CopilotAI
changed the title
Add comprehensive tests for Julia-translated modules; fix 6 source bugs blocking test execution
Add tests for rootdepth_main & soilfluxes !freedrain; fix 3 source bugs in RootDepth.jl
May 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously untested:
rootdepth_main(entirely) and the!freedrainbranch ofsoilfluxes. Running these paths exposed three bugs inRootDepth.jlthat caused runtime errors before any assertions could be checked.Bugs fixed in
RootDepth.jlfreedraintype mismatch —soilfluxesexpectsfreedrain::Boolbutrootdepth_mainpassesfreedrain::Intdirectly as a keyword arg; Julia does not auto-convert. Fixed withBool(freedrain).transpo18stepandupdated_o18(removed when isotope tracking was commented out fromsoilfluxes) causedUndefVarErroron any active vegetation cell. Commented out.dθscope bug —dθwas first assigned inside thefor itimeloop but read at line 260 outside it. Julia may not expose loop-internal variables in the enclosing scope. Fixed by pre-initializingdθ = zeros(Float64, nzg)before the loop.Tests added
test/test_rootdepth.jl— Four testsets: zero-landmask skip, water-body cell (veg=1), free-drain vegetation cell (veg=7), non-free-drain vegetation cell (veg=7). Exercises the full call chain includingextraction,soilfluxes, andupdatewtd_shallow.test/test_soil_fluxes.jl— Three new testsets for!freedrain:jwt≤2branch (water table below all layers),jwt>3branch (water table at a mid-layer), and a free vs. non-free-drain comparison verifyingrech=0for non-free-drain andrech<0for free-drain (negative = downward drainage).