-
Notifications
You must be signed in to change notification settings - Fork 368
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
C-based harvest in ELM-FATES #5106
Conversation
The PR description should describe the code changes and not just point to another PR description. |
Needs action and review from @sshu88 @rgknox @bishtgautam |
Still needs action and review from @sshu88 @rgknox @bishtgautam |
telecon notes: Waiting for a FATES update before removing WIP. |
!if ( (errsol(p) /= spval) .and. (abs(errsol(p)) > 1.e-7_r8) ) then | ||
! solar radiation balance error is high when running FATES | ||
! adjust the threshold to 5.e-7 | ||
if ( (errsol(p) /= spval) .and. (abs(errsol(p)) > 5.e-7_r8) ) then |
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.
!if ( (errsol(p) /= spval) .and. (abs(errsol(p)) > 1.e-7_r8) ) then | ||
! solar radiation balance error is high when running FATES | ||
! adjust the threshold to 5.e-7 | ||
if ( (errsol(p) /= spval) .and. (abs(errsol(p)) > 5.e-7_r8) ) then |
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.
If we bump this value up to suppress warnings, that seems fine for a FATES run. We are very aware that an audit needs to be done to reduce these fine errors in radiation scattering. However, we may want to only apply it to a fates governed patch. This "is_fates" can tell us if we are on a fates patch and if we should apply different logic:
https://github.com/E3SM-Project/E3SM/blob/v2.0.0/components/elm/src/data_types/VegetationType.F90#L70
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.
telecon notes: still waiting for FATES PR. |
@rgknox this is waiting on a FATES PR and then I guess an update of FATES to E3SM. |
@bishtgautam We can go ahead and merge the work once the FATES part is merged. |
@bishtgautam I'm working on the final deconflict and test on the fates-side right now. |
fates-nutrient coupling api changes
The changes just merged into this branch, in 13d0f5a , were originally overlooked, but nonetheless required for compatibility with fates API 25. |
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.
One question about the hardcoded allow_harvest_bypass_criteria
end if | ||
|
||
call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest) | ||
call set_fates_ctrlparms('use_harvest_bypass_criteria',ival=pass_harvest_bypass_criteria) |
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.
I don't see any setup for this on the fates side pr 888. Is this a future feature? I'm assuming so given that it's hard coded to false just above this.
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.
It's an old flag. I forgot to delete this line in ELM side.
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.
Ok, cool. In that case would you push an update to remove it please?
use dynHarvestMod , only : num_harvest_vars, harvest_varnames | ||
use dynHarvestMod , only : num_harvest_vars, harvest_varnames, wood_harvest_units | ||
use dynHarvestMod , only : harvest_rates ! these are dynamic in space and time | ||
use dynHarvestMod , only : num_harvest_vars, harvest_varnames, wood_harvest_units |
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.
@sshu88 it looks like there is some duplicate code here as well.
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.
Thanks for checking.
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.
Just one more minor piece of code cleanup.
@sshu88 would you remove the "[WIP]" from the title now? |
@bishtgautam we still need to update the pointer to the fates side, but the associated PR hasn't been merged yet. I'll give you a heads up when that happens |
Are the existing tests cover the new physics? Or, should we add a new test? |
We should add new tests, but I would like to defer that to a future PR in which we review and update all of the fates tests for the land developer suite. |
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.
I noticed one change that affects non-fates runs that needs to be addressed.
this%prod10c(begc:endc) = spval | ||
call hist_addfld1d (fname='PROD10C', units='gC/m^2', & | ||
avgflag='A', long_name='10-yr wood product C', & | ||
ptr_col=this%prod10c, default='inactive') | ||
|
||
this%prod100c(begc:endc) = spval | ||
call hist_addfld1d (fname='PROD100C', units='gC/m^2', & | ||
avgflag='A', long_name='100-yr wood product C', & | ||
ptr_col=this%prod100c, default='inactive') | ||
|
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.
@sshu88 was this a temporary change to make sure that you could read the prod10c
and prod100c
for when fates was running?
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.
These are two outputs I added to the history output file for checking the change of product pool size. So it is a temporary change. But the product pool size shall be a basic output in land surface model when considering anthropogenic disturbances.
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.
To clarify, does this need to be available when fates is running? The current issue is that the same call is made just below behind a .not. use_fates
check, which means this will get called twice and cause a build failure for non-fates runs. If it's not necessary for fates right now, would you mind removing these lines? Otherwise, the part that is behind the .not. use_fates
check could be removed.
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.
I have removed the part below .not. use_fates
check.
I'm running the land-developer tests and seeing two unexpected failures. I haven't looked into them much yet, but one is a fates smoke test failing during runtime in PhosphorusDynamicsMod and the other is a model build failure for folder location (Cori):
Note I'm using Cori as perlmutter is down right now. |
I submitted some updates to @sshu88 's branch to resolve the issues with the fates_eca test. Tests were passing on Cori. Should update once we get it approved and checked. |
fixes for nutrient enabled fates
@sshu88 I created a PR to your branch to update the fates pointer now that NGEET/fates#888 is integrated on the fates-side. @bishtgautam I ran land developer tests on Cori and all the tests except |
Update fates submodule pointer to carbon harvest compatible tag
@bishtgautam this can be closed per #5429. |
This pull request contains modification in E3SM corresponding to another FATES PR #888.
In detail, necessary input to enable FATES C-based harvest from ELM is passed to FATES through
bc_in
. Output from FATES used to calculate land use emission and net biosphere productivity is passed to ELM throughbc_out
.