Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor and standardize per-ageclass history #1252
base: main
Are you sure you want to change the base?
Refactor and standardize per-ageclass history #1252
Changes from all commits
d7b5097
3458eb6
f66a99b
ae92beb
9492573
8375545
bf3684d
7e1bf60
92ddeeb
309086c
8356d40
92c6ebd
1aff666
7d5d8f9
e11f2fd
4d22d79
ae499bf
9d9da65
bcc15e7
d967fdc
c60f83b
f54db49
acb58bb
2242bd1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets double check the units on the natural versus the logging mortality, I seem to remember they were different, such as their usage here:
https://github.com/NGEET/fates/blob/main/biogeochem/EDMortalityFunctionsMod.F90#L347-L354
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's what the
per_year
option is for—depending on its value, one will be converted into units of the other. I'll add units to comments in revision.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the problem is that one is in # individuals and the other is fraction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samsrabin here is an example of how to get total carbon biomass from the cohort, if you want to add it into this routine. This will help you convert from number of individuals to kgC:https://github.com/NGEET/fates/blob/main/main/FatesHistoryInterfaceMod.F90#L3895-L3903I looked at how this sum mortality was being used, and I had the units wrong, it looks like the function is being called with the expectation that the output units are not in carbon but the abundance rate.
Part of the confusion is related to our incorrect labeling of the rates on the cohort structures. Here is where we apply mortality to actually change number density, dndt is a fraction per time (because that fraction is multiplying by cohort%n:
https://github.com/NGEET/fates/blob/main/main/EDMainMod.F90#L804
https://github.com/NGEET/fates/blob/main/biogeochem/EDMortalityFunctionsMod.F90#L352-L354