-
Notifications
You must be signed in to change notification settings - Fork 4
Running LandRCBM in RIA #62
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
base: development
Are you sure you want to change the base?
Running LandRCBM in RIA #62
Conversation
This is awesome!! When you say pools and emissions, I'm not sure if you mean the cbm_vars tables related to those (flux and pools) or if you mean the
Hopefully this all makes some sense! I'm excited to see how it runs with more than 1 simulation year! I know the cbm_vars tables with the python functions can be picky to deal with when it comes to cohorts and IDs. |
Thanks for the info, that helps!
I mean the
I believe that is done with
Ok, so emissions are tracked for the entire landscape? I guess that's fine then. So, it is only the
Yes, I agree. I don't think that it does not work as it is, I just think we might need to rethink how pools are stored across year. How it is written, I don't see how we can, for example, look at how the pools in a given pixel (or subset of pixel) evolve in time, or how a certain species contributes to the carbon dynamics across time. |
Yep, that table only tracks the entire simulated landscape for each year. So if you only have 1 simulation year, that table should only have one row for that year.
I think this is also somewhat true in that table for standard spadesCBM too, at least tracking a subset of pixels over time using the You can however track |
Great work and good discussion all. Here are a few thoughts on Dominique's questions:
|
Ok, great. For tracking cohorts (point 1,2,4), that answer a lot of the answers I had! One thing I need implement is how DOM is tracked. We discussed previously the potential challenge with DOM being more of a pixel attribute and less of a cohort attribute: when a cohort "dies out", there is still carbon in the soil. How it is coded now, when we "update" the cohorts ID, we only keep the cohorts in
This does particularly worries me. I set the priority so that the annual event of CBM happens after LandR and LandRCBM events. Otherwise, it was happening before, and so getting the increments from the previous year. Here is the order of the events for the first year:
So, 1) we do the init event of all modules to get all the data needed (biomass data, yield curves, etc.) at the begining of the simulation. 2) we do the CBM spinup with the initial state of the landscape. 3) we have growth and mortality for the first year. 4) calculate the increments for year 1 (nothing happens at annualDisturbances here). 5) finally, we do the first CBM annual event. |
Leaving some thoughts & a brainstorm for discussion here! Interested in everyone's thoughts. Annual event priorityPrioritizing the annual event to occur a bit later to allow for space to do some work between the spinup and the annual event sounds relatively harmless to me. It seems as though the Tracking cohort groupsPutting a little breakdown of the CBM_core objects here for the sake of highlighting a potential issue and solution that may make reporting easier. CBM_core objectsLooking at our CBM_core objects, I seem them as falling roughly into 3 categories: Input objects: created by other modules to be used in the spinup and annual events; not expected to change during the simulation:
Intermediate objects: these can be "tweaked" as needed throughout the simulation; they are not considered "results" - their purpose is to be used in the annual event; they need to match each other, and also may need to match with the input objects in some cases:
Output objects: rows are added each year with the annual event results; only ever used in plotting or other results summaries:
NPP and cbmPools output objects: incomplete?Unlike with LandR, Proposing a solution!I think we can potentially solve the issue of tracking cohort groups with I think it would require a brainstorm, but I'm imagining:
It would be useful to ask if there's any cohort attributes (e.g. GCID, age) that would be useful to track over time. Looking ahead this may allow us to simplify the |
Looking super awesome and clean! love it! My thoughts: cbmAdminJust wanted to bring to attention this task & where it links to a PR discussion of replacing cbmAdmin with a direct query to the CBM database Event designPresenting a bit of a brainstorm idea with lots of pros/cons to consider I'm sure: I wonder if some of this work could be moved to the For example: perhaps this section be moved to an event in LandR CBM that runs after the spinup, e.g. a
Maybe this could be in a Further: the annual event could potentially be broken into chunks that Annual event priority
I think we could easily go ahead and make this super low in the main CBM repo as well if we want. I think in general it makes sense. Maybe 8? leave 9-10 for accumulateResults & plotting (etc). I can't imagine much would ever need to be done after the annual event but I could be wrong. Tracking cohorts & CBM_core outputs
Tracking cohorts will always be useful for mapping carbon to pixels for repoting & plotting. It is also currently required to make sense of the current I think until we take the time to focus on this I'd say just let the Disturbances: where to process disturbanceRasters into disturbanceEvents
Coincidentally, I've been thinking about this over the past week as well! This likely calls for an in person meeting (deserves its own thread at least) but here's a summary of what I've been thinking about so far: I'm wondering if we would benefit from having an area-generic To make this LandR (and any other module) friendly: I think it would be smart to design this module to only work with the inputs it finds in the simulation so that it would be agnostic to certain objects being there (such as CONS:
PROS:
I think it makes sense to think about the relationship of a module like this to |
Yes - nice work.
Yes, I would like to get rid of the
I like this. @DominiqueCaron what to you think? The cleaner and more streamlined these events can be made, the better. Maybe we put this on our things to discuss for a group meeting early next week? Thoughts? @suz-estella, could you pleae make sure we cover this next week?
Looks like this is already done. (check)
Ok. @suz-estella try to see what you can come-up with to make this happen.
Yes, I have been thinking we could separate the Nice work all. |
Thanks for the comments and thoughts! Here are mine: event design: Yes, I think that dividing some of the events make sense, and would make the module a bit cleaner. I am on vacation next week, so I am not available to meet. event priority: The priority currently works fine. It is pretty easy to change if ever we need. If we add new events, we can also give them numeric values (e.g., the priority for cohort tracking: I have nothing to add. We can keep it as it is for now. disturbanceEvents: I agree that a lot of spatial data preparation are not study specific. The simpler the study area-specific modules are, the simpler it will be to use |
@cboisvenue I think this could potentially be pretty easy. - just a matter of splitting the code in |
Yes - I can take care of the "handling disturbances from modules part" when I am back! |
I added some basic tests. The GHA seems to be running only the "integration" tests. I don't know if that is by design @suz-estella Anyway, I think that everything works. So, once everyone approve, this PR could be merged if we want. |
@DominiqueCaron it's actually skipping the integration tests (with argument About merge-ability:I still think it's worth reviewing this to see what could be moved to either From above:
My 2 cents: I think it makes sense to have the "LandR-bridging-CBM" tasks occurring somewhere other than CBM_core (as must as possible) so that we can keep CBM_core focused on its module purpose. Ideally any changes we commit to CBM_core will make the module more flexible for any module trying to connect to it -- I'd go as far to say that ideally we'd keep any |
I would also like to keep any |
Ok sounds good! Here are a few changes I plan to make after seeing your comments:
|
Sounds good. Some thoughts on this part:
The disturbances will always be coming from either an external model/module (like scfm) and be integrated in both LandR and spadesCBM/LandRCBM. Do we need |
Sounds like a good plan to me!
My only feedback is that I'd aim to even take it a step further and create fully descriptive parameters where possible instead, like
I imagine the list of |
This is exactly what I am hoping would happen: increments could come from other vegetation models then LandR, even from some cohort-based growth and yield models. So I like this idea of a more generic switch with a descriptive name. Maybe you two can go back and forth on this since Dominique has the best understanding of LandRCBM_split3pools and you Susan the best understanding of our new |
Similar to what I wrote here: PredictiveEcology/CBM_dataPrep#1 . For now |
Preface
This is a draft PR, I am not sure it will ever be merged. The purpose is mainly to give an idea of the changes I made to run
CBM_core
withLandR
inputs` (https://github.com/DominiqueCaron/LandRCBM/blob/main/global_LandRCBMsmallRIA.R). It is still pretty rough code.Description
To make
CBM_core
run withLandR
, I've made a number of changes. To avoid interfering with "standard" CBM simulations, most changes are within if else statements. Briefly, the simulation runs for a small area within RIA, but I am 99% that it does not works correctly, since I have not tested anything and have an incomplete understanding ofCBM_core
. This PR is coupled with changes made toCBM_dataPrep_RIA
(PredictiveEcology/CBM_dataPrep_RIA#8) andLandRCBM_split3pools
(PredictiveEcology/LandRCBM_split3pools#25).CBM_core
to make the spinup work. I did some changes in the other repos. I still haven't test whether it works correctly thought.eventPriority = 10
argument to the annual event to make sure thatLandR
does its things between the spinup and the annual event (e.g., for the first year, we want growth & mortality to happen between the spinup and annual).cohortGroups
. For now,LandRCBM
each cohort as a differentgcids
(set of increments), but in the future we could group cohorts based on increments. This is more of an optimization task, so I haven't bother to implement it yet.cohortGroups
andcohortGroupKeep
gets updated each year and only contains the cohorts that are present at time t. I think that works for the annual event, but create problems for tracking pools and emissions across years (see points of discussion).Points of discussion and clarification.
LandR
works after a disturbance. As of now, I believe that the increments for disturbed cohorts returned byLandRCBM_split3pools
is: -(biomass at t-1). If there is regeneration+growth, there is a new cohort (same species but with age 1) with the initial growth.CBM_core
tracks pools and emissions across years percohortGroups
. However, unlike standardCBM
runs, with LandRCBM,cohortGroupsID
andcohortID
are not static, they get updated each year. So, I don't see how we can retrieve whatcohortGroup
X at year Y represent once the simulation is done.