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

Make it easier to "turn off" the canopy #250

Open
kmdeck opened this issue Jun 26, 2023 · 5 comments
Open

Make it easier to "turn off" the canopy #250

kmdeck opened this issue Jun 26, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@kmdeck
Copy link
Member

kmdeck commented Jun 26, 2023

Is your feature request related to a problem? Please describe.
In global runs, we will have areas with and without a canopy, but due to software restrictions from using ClimaCore, every point in the domain requires a CanopyModel with the same number of prognostic variables.

Option 1. Run the same model everywhere (i.e. even when there is no canopy present, there will still be a canopy model with prognostic variables, but these will not change in time, and all canopy fluxes will be zero). In this case, make it easier to set up a default with no canopy present (LAI = RAI=0), i.e. dont require the user to set parameters, canopy height information, etc. Currently, PR #238 makes it so setting LAI=RAI=SAI gives zero transpiration, root extraction, absorption of radiation, and zero fluxes with the plant system, but you still need to define the parameters...

Option 2: Alternatively, if we run each column in the simulation independently, we may be able to set up something that has a different # of prognostic variables at each point. This feels more natural (though it wont work when we have lateral flow in the soil, since then each column is not independent; so this is not a long term solution, Option 1 or similar is unavoidable at this point). In this case, we would need to make it so there is a "no canopy" version of the model with no prognostic vars, parameters, etc. TBD if this type of setup would be harder for the coupler to work with for now as well.

Describe the solution you'd like
Let's discuss

@kmdeck kmdeck added the enhancement New feature or request label Jun 26, 2023
@kmdeck kmdeck mentioned this issue Jun 26, 2023
1 task
@AlexisRenchon
Copy link
Member

I am open on this choice - convince me and I'll change my mind!
For now, I prefer option 1. It makes sense to me to have the same model everywhere (with a canopy), and that canopy having LAI and fluxes equal to zero.

@braghiere
Copy link
Member

I am right there with @AlexisRenchon. Option 1 is easier.

@juliasloan25
Copy link
Member

I also think option 1 sounds more straightforward, and it'll be nice to have a solution that we don't have to re-work in the long term.

Is this something that relates only to the canopy model? It sounds like we'll have to define all surface model types across the entire space (canopy, snow, soil, etc?

Also, for global runs how will we demarcate where the land model exists? Will we define our space as an entire spherical shell on the surface (and a similar shape with depth for the subsurface) over the whole surface area of the earth, then use a land mask to label which areas are land? And then we would only perform land calculations on these specified land areas?

@kmdeck
Copy link
Member Author

kmdeck commented Jun 26, 2023

Thank you, @braghiere @AlexisRenchon @juliasloan25 !

And youre right, Julia. We will need the canopy to behave well (zero fluxes) as LAI -> 0, and snow to do the same thing as snow water equivalent -> 0. All models in the LSM will be defined everywhere.

For global runs, for now, yeah, we need a land mask. our only options for "domain" are a bunch of columns or the whole spherical shell w. depth. It would be nifty to only do the computation where there is land, worst case we do it everywhere but then set the tendencies to zero over the ocean...

Does that change your opinion at all? we can discuss more in person. otherwise I am happy to go with Option 1 as well.

@juliasloan25
Copy link
Member

Thanks for the info. That doesn't change my mind - I think option 1 is still good. If the tendencies are just set to zero over the ocean we won't be doing too much extra work.

bors bot added a commit that referenced this issue Jun 28, 2023
238: Zero lai r=kmdeck a=kmdeck

## Purpose 
In the current codebase, setting the area indices of the plant to zero would result in a 0/0, because, for example, we have:
` d theta_leaf/dt = [stem_flux *LAI - canopy_transpiration]/ (LAI x Delta z)`, where canopy_transpiration involves a multiplication by LAI as well. 

Because we cannot have a changing number of prognostic variables across the domain, even when there is no vegetation present, we need to have a canopy model with some prognostic variables, parameters, etc. To turn off the canopy, setting LAI = SAI = RAI = 0 will imply zero fluxes and zero root extraction, and no change in the initial conditions of the plant prognostic variables. 

Therefore, update the codebase so that when LAI=SAI=RAI = 0, `d theta/ dt = 0` and there is no divide by zero.

Once we get closer to global runs, we should do some refactoring as it makes sense to make it so you dont need to define all these parameters where there is no vegetation. See Issue #250.

## Content
1. Change "LAI/(LAI x dz)" terms to "LAI/max(LAI x dz, eps(FT))". When LAI = 0, this gives zero flux and does not divide by zero.
2. Add consistency checks to the PlantHydraulics constructor:
- if LAI == 0, all area indices should be zero (no plant present)
- if LAI is nonzero, RAI must be nonzero (a plant cannot exist without roots)
- if n_stem == 0, the stem area index must be zero for consistency.
3. Adds unit tests to make sure consistency checks pass and that when LAI =RAI = SAI = 0, the root extraction and transpiration are both zero.

Review checklist

I have:
- followed the codebase contribution guide: https://clima.github.io/ClimateMachine.jl/latest/Contributing/
- followed the style guide: https://clima.github.io/ClimateMachine.jl/latest/DevDocs/CodeStyle/
- followed the documentation policy: https:/CliMA/policies/wiki/Documentation-Policy
- checked that this PR does not duplicate an open PR.

In the Content, I have included 
- relevant unit tests, and integration tests, 
- appropriate docstrings on all functions, structs, and modules, and included relevant documentation.

----
- [X] I have read and checked the items on the review checklist.


Co-authored-by: kmdeck <[email protected]>
mitraA90 pushed a commit that referenced this issue Dec 22, 2023
238: Zero lai r=kmdeck a=kmdeck

## Purpose 
In the current codebase, setting the area indices of the plant to zero would result in a 0/0, because, for example, we have:
` d theta_leaf/dt = [stem_flux *LAI - canopy_transpiration]/ (LAI x Delta z)`, where canopy_transpiration involves a multiplication by LAI as well. 

Because we cannot have a changing number of prognostic variables across the domain, even when there is no vegetation present, we need to have a canopy model with some prognostic variables, parameters, etc. To turn off the canopy, setting LAI = SAI = RAI = 0 will imply zero fluxes and zero root extraction, and no change in the initial conditions of the plant prognostic variables. 

Therefore, update the codebase so that when LAI=SAI=RAI = 0, `d theta/ dt = 0` and there is no divide by zero.

Once we get closer to global runs, we should do some refactoring as it makes sense to make it so you dont need to define all these parameters where there is no vegetation. See Issue #250.

## Content
1. Change "LAI/(LAI x dz)" terms to "LAI/max(LAI x dz, eps(FT))". When LAI = 0, this gives zero flux and does not divide by zero.
2. Add consistency checks to the PlantHydraulics constructor:
- if LAI == 0, all area indices should be zero (no plant present)
- if LAI is nonzero, RAI must be nonzero (a plant cannot exist without roots)
- if n_stem == 0, the stem area index must be zero for consistency.
3. Adds unit tests to make sure consistency checks pass and that when LAI =RAI = SAI = 0, the root extraction and transpiration are both zero.

Review checklist

I have:
- followed the codebase contribution guide: https://clima.github.io/ClimateMachine.jl/latest/Contributing/
- followed the style guide: https://clima.github.io/ClimateMachine.jl/latest/DevDocs/CodeStyle/
- followed the documentation policy: https:/CliMA/policies/wiki/Documentation-Policy
- checked that this PR does not duplicate an open PR.

In the Content, I have included 
- relevant unit tests, and integration tests, 
- appropriate docstrings on all functions, structs, and modules, and included relevant documentation.

----
- [X] I have read and checked the items on the review checklist.


Co-authored-by: kmdeck <[email protected]>
@kmdeck kmdeck mentioned this issue Feb 5, 2024
15 tasks
@kmdeck kmdeck mentioned this issue Jul 2, 2024
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants