Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend plant hydraulics rooting depth to support fields #783

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

imreddyTeja
Copy link
Contributor

@imreddyTeja imreddyTeja commented Sep 19, 2024

Purpose

Towards spatially varying canopy parameters
Move the root_distribution function to src
Make rooting_depth, an argument to root_distribution, a parameter of PlantHydraulicsParameters
Make rooting depth support ClimaCore fields.
Closes #772

PlantHydraulicsParameters previously held a root distribution function
that had a default value for rooting depth. This function is
always the same outside testing, so it was removed as a parameter
and placed into src. rooting_depth, an argument to the distribution function
is now a parameters that is either a Float or a field. The tests are changed to
check passing rooting_depth as a float or a field of floats that are the same everywhere.

To-do

  • Add to ClimaArtifacts

Content

  • Rooting_depth map created
  • rooting_depth added as parameter
  • rooting_distribution moved to source
  • all calls to PlantHydraulicsParameters changed accordingly
  • tests changed to also test rooting_depth as a field
  • add message in NEWS.md

PlantHydraulicsParameters previously held a root distribution function
that had a default value for rooting depth. This function is
always the same outside testing, so it was removed as a parameter
and placed into src. rooting_depth, an argument to the distribution function
is now a parameters that is either a Float or a field. The tests are changed to
check passing rooting_depth as a float or a field of floats that are the same everywhere.

The rooting_depth map can be seen here:

rooting_depth


  • I have read and checked the items on the review checklist.

PlantHydraulicsParameters previously held a root distribution function
that had a default value for rooting depth. This function is
always the same outside testing, so it was removed as a parameter
and placed into src. rooting_depth, an argument to the distribution function
is now a parameters that is either a Float or a field. The tests are changed to
check passing rooting_depth as a float or a field of floats that are the same everywhere.
One test in plant_hydraulics_test.jl only checks the case of when rooting_depth is a float
because changing to a field requires extensive changes to the entire test.
The test solves a system of functions which is defined in
initial_compute_expected_tendecy!. That function is now changed
to support fields, but each equation in the system of equations still
outputs a scalar. This is done by taking a mean across the resulting field.
This is done because NLsolve does not work of equations on fields.
longruns/land.jl, benchmarks/land.jl and longruns/land_regional.jl
are changed to use the root depth map from the clm data
@imreddyTeja imreddyTeja marked this pull request as ready for review September 20, 2024 00:31
Comment on lines +9 to +11
- ![][badge-💥breaking] Remove root_distribution from PlantHydraulicsParameters and add rooting_depth,
which supports fields
PR[#783](https://github.com/CliMA/ClimaLand.jl/pull/783)
Copy link
Member

Choose a reason for hiding this comment

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

If something is breaking, it is always a good idea to describe how it is breaking and what users might need to do to fix it

),
) * AI[plant_hydraulics.compartment_labels[i]]
end
F[i] = mean(fa .- T0A)
Copy link
Member

Choose a reason for hiding this comment

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

Let's discuss this. I would have expected F to be a Field here too

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.

Add spatially varying rooting depth to plant hydraulics
2 participants