Skip to content

Average abiotic quantities over relevant soil layers#803

Merged
jacobcook1995 merged 8 commits intodevelopfrom
533-soil-model-should-average-abiotic-quantities-over-relevant-soil-layers
Mar 27, 2025
Merged

Average abiotic quantities over relevant soil layers#803
jacobcook1995 merged 8 commits intodevelopfrom
533-soil-model-should-average-abiotic-quantities-over-relevant-soil-layers

Conversation

@jacobcook1995
Copy link
Copy Markdown
Collaborator

Description

This PR changes the soil model so that it averages abiotic quantities over the relevant soil layers. The temperature and matric potential averaging works the same as in the litter model. The soil moisture "averaging" is something I just added, so sanity checking that would be really appreciated!

Fixes #533

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works
  • Relevant documentation reviewed and updated

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.65%. Comparing base (606cff7) to head (509a671).
Report is 495 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #803   +/-   ##
========================================
  Coverage    94.64%   94.65%           
========================================
  Files           74       74           
  Lines         5120     5127    +7     
========================================
+ Hits          4846     4853    +7     
  Misses         274      274           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

# Find the fraction of each layer that lies within the microbially active zone
layer_weights = (
layer_structure.soil_layer_active_thickness
/ layer_structure.soil_layer_thickness
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might need to use the soil layer depth instead of the soil layer thickness here. If both layers are 1m thick, the depth of the first on is 1m, the depth of the second is 2m. if your microbial depth is then 1.2 m, you want all of the first layer but only 0.2 of the second layer, right? At the moment it looks like it always starts from zero?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll add a note explaining what layer_structure.soil_layer_active_thickness is as that isn't really clear from the name alone

@jacobcook1995 jacobcook1995 requested a review from vgro March 27, 2025 11:27
Copy link
Copy Markdown
Collaborator

@vgro vgro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jacobcook1995 jacobcook1995 merged commit e5cd021 into develop Mar 27, 2025
16 checks passed
@jacobcook1995 jacobcook1995 deleted the 533-soil-model-should-average-abiotic-quantities-over-relevant-soil-layers branch April 23, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Soil model should average abiotic quantities over relevant soil layers

3 participants