-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend photosynthesis mechanism to support fields
This change is applied to both OptimalityFarquharParameters and FarquharParameters. Previously, the mechanism parameter was held as an empty struct of type ::C3 or ::C4 to allow for dispatch. Because it is not possible to create a ClimaCore field of different structs, the mechanism param is changed to a is_c3 param that holds 1s and 0s. This choice was made because reading a NetCDF file requires regridding, which must be performed over Numbers. If the input data file must store the mechanism as a float, then it is easiest to also internally represent the mechanism as a float. The C3/C4 structs are now removed. The functions that previously used C3/C4 structs for dispatching are converted to two seperate functions, which are called based on the is_c3 value. The constructor checks that the mechanism value of field is between 0 and 1, and throws an error otherwise. Regridding a field of 0s and 1s may result in values between 0 and 1, so the constuctor rounds them to the nearest integer. This implementation allows for future support of mixed mechanisms in an area represented by proportion c3 without many changes. All calls to the FarquharParameters constructor are changed to work with the changes to mechanism representation. Tests are also changed to work with new constructor and representation of mechanism. The tests in canopy_model are changed to run twice using a for loop. The first run has all the parameters as floats, and the second run has all canopy parameters that can be fields as fields. In this case, the photosynthesis mechanism is tested as a field that alternates between 1.0 and 0.0, which represents alternating between C3 and C4. The tests were previously all run over a Point domain. The tests that use FarquharParameters are changed to run on a spherical surface. Additionally, a test for vcmax as a field is added. Land.jl and land_region.jl are changed to use the mechanism map from the clm data.
- Loading branch information
1 parent
b47ef0f
commit 3e9a73a
Showing
28 changed files
with
244 additions
and
159 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
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
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.