-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend plant hydraulics rooting depth to support fields (#783)
* Change PlantHydraulicsParameters to hold rooting_depth 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. * Update calls to PlantHydraulicsParameters * Change plant hydraulics integration test to use fields 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. * Change runs to use spatially varying rooting depth longruns/land.jl, benchmarks/land.jl and longruns/land_regional.jl are changed to use the root depth map from the clm data * Add message in NEWS.md * Make suggested changes * Edit root_distribution docstring * Use new clm artifact in runs * Change plant_hydraulics_test to follow previous behavior Previously the Plant hydraulics model integration tests were changed to work with rooting_depth as a field. In the test, the solution of a system of equations is found using NLsolve. The previous change redefined each equation in the system of equations to create a field of values the equation evaluates to, and then takes the mean of the field so the equation still results in a scalar. To better follow the functionality of the previous test, this commit reverts the system of equations to only work on a scalar rooting_depth. The solution to the system of equations is returned as a vector of floats. It is not possible to create a ClimaCore Field of vectors. Instead, the solution is stored as a vector of fields. To implement this, a function that returns a function representing a system of equations is created. This results in a system of equations for each cell. At first, each system of equations was solved once for each variable in the vector of solutions, resulting in many repeated equations solves. To prevent this a dictionary is used. Each variable in the solution must be returned independently in order to create a vector of fields. * Make changes not breaking Add a constructor that finds rooting_depth from root_distribution * Remove unnecessary import * Edit comments for hydraulics test * Revert to breaking change A previous commit made the change not breaking by making constructor accept a rooting_distribtion parameter, and then calculating rooting_depth from that. That calculation assumes that rooting_distribuion will be in a specific form. * Add docstring for constructor * Make changes non-breaking (again) Added support for root_distribution. The PlantHydraulicsParameters struct has root_distribtion again. Both root_distribution and root_depth can be nothing. The constructor uses depwarn when root_distribution is passed in. If neither root_depth or root_distribution are passed in to the constructor, an error is thrown. There were two uses of root_distribution. At these spots, a new function is defined, which takes in the rooting_depth and a z as an argument. If that rooting_depth argument is nothing, then it calls root_distribution form the params. Otherwise it calls from src. Removes breaking change from NEWS.md * Add deprecated_featured.md
- Loading branch information
1 parent
4277593
commit d2ffa43
Showing
20 changed files
with
238 additions
and
174 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Deprecated Features List | ||
|
||
This file lists deprecated features and the recommended alternative practice | ||
|
||
- ## `root_distribution` | ||
|
||
The `root_distribution` in `PlantHydraulicsParameters` is replaced by `rooting_depth`. | ||
If using a `root_distribution` function of the form P(x) = 1/d e^(z/d), then `rooting_depth` | ||
is equivalent to d. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.