Skip to content

write.config.SIPNET: fix soilWHC for a soil_physics file without depth - #4258

Draft
madhavzanwar wants to merge 5 commits into
PecanProject:developfrom
madhavzanwar:GH-4218-sipnet-soilwhc-no-depth
Draft

madhavzanwar wants to merge 5 commits into
PecanProject:developfrom
madhavzanwar:GH-4218-sipnet-soilwhc-no-depth

Conversation

@madhavzanwar

Copy link
Copy Markdown
Contributor

Fixes #4218

What

For a soil_physics file with no depth dimension, write.config.SIPNET() logs a warning and then multiplied a list by the default thickness (vals["..."] * thickness), which fails with "non-numeric argument to binary operator". Use [[ ]], so soilWHC is computed from the default 100 cm depth as the warning says. NEWS and CHANGELOG entries added.

Testing

The new test builds a single-layer soil file without a depth dimension; it errors on develop and passes with the fix. I resolved a conflict in test-write.config.SIPNET.R with develop by keeping both new tests; PEcAn.SIPNET cannot be loaded in my environment, so please rely on CI for the SIPNET test file

Single brackets returned a list, so multiplying by the default thickness failed. Use [[ ]].

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

write.config.SIPNET() errors when the soil_physics file has no depth dimension

2 participants