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 farquhar mechanism to spatially varying #774

Merged
merged 2 commits into from
Sep 17, 2024

Commits on Sep 17, 2024

  1. 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.
    imreddyTeja committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    3e9a73a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    361b333 View commit details
    Browse the repository at this point in the history