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
{{ message }}
Repository navigation
write.config.SIPNET() errors when the soil_physics file has no depth dimension #4218
write.config.SIPNET() logs a warning for a soil_physics file with no depth dimension ("No depth info was found in the soil file. Will use the default or user-specified soil depth") and then fails in the next line:
vals[...] with single brackets returns a list, so the multiplication fails. The branch that does have depth uses unlist() on the same value.
Reproduction
x<-list(vals=list(volume_fraction_of_water_in_soil_at_saturation=0.4))
x$vals["volume_fraction_of_water_in_soil_at_saturation"] *100#> Error: non-numeric argument to binary operator
In write.config.SIPNET() this stops the whole config for a soil file such as a single-layer netCDF with volume_fraction_of_water_in_soil_at_saturation and no depth.
Proposed fix
Use [[ ]] (a one-character-pair change). I have a branch with a test that builds such a soil file; it errors on current develop and passes with the fix. Happy to send a PR if wanted.
Activity
madhavzanwar commentedon Nov 2, 2026
@infotroph a fix and a test are ready: https://github.com/madhavzanwar/pecan/tree/GH-4218-sipnet-soilwhc-no-depth ([ ] to [[ ]]; the new test builds a soil file without a depth dimension, errors on develop, and passes with the fix). Happy to open the PR whenever you’d like.
madhavzanwar commentedon Nov 19, 2026
@infotroph PR is up: #4258
Merge upstream develop into PecanProjectGH-4218-sipnet-soilwhc-no-depth
Merge upstream develop into PecanProjectGH-4218-sipnet-soilwhc-no-depth
Merge upstream develop into PecanProjectGH-4218-sipnet-soilwhc-no-depth
Merge upstream develop into PecanProjectGH-4218-sipnet-soilwhc-no-depth