-
Notifications
You must be signed in to change notification settings - Fork 92
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
parallel disturbance #875
parallel disturbance #875
Conversation
biogeochem/EDPatchDynamicsMod.F90
Outdated
@@ -515,6 +440,8 @@ subroutine spawn_patches( currentSite, bc_in) | |||
! If nocomp is not enabled, then this is not much of a loop, it only passes through once. | |||
nocomp_pft_loop: do i_nocomp_pft = min_nocomp_pft,max_nocomp_pft | |||
|
|||
disturbance_type_loop: do i_disturbance_type = 1,N_DIST_TYPES | |||
|
|||
! calculate area of disturbed land, in this timestep, by summing contributions from each existing patch. |
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 get an indent in here, like the loop label
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 I did a big auto-indent for this subroutine.
biogeochem/EDPatchDynamicsMod.F90
Outdated
currentPatch%disturbance_rates(i_dist2) = currentPatch%disturbance_rates(i_dist2) & | ||
* oldarea / currentPatch%area | ||
end do | ||
end if |
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.
Following through the logic here with a generic example, and I think it checks out:
lets assume that the patch starts out with an area of 1., and all three types apply 0.333 disturbance rates.
After the first disturbance, we have an area of 0.666, and the remaining two rates are bumped up to 0.333*(1/0.666) = 0.5.
After the second disturbance, we have an area of 0.33 = 0.66 * 0.5, and the remaining disturbance rate is bumped up to 0.5*(0.66/0.33) = 1.0
The last disturbance will cover the entire remaining area 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.
I think the changes look great. Only request is that we apply the indent to the big new loop. Also, this change is very central to how FATES operates. I think it would be good if we run a couple of multi-decade sanity check simulations on the f10 grid and compare to base (with fire turned on) just to see how things compare and if the results are sensible. Alternatively, or additionally, we could consider a regional simulation with a higher resolution grid, which may capture a few events with 100% disturbance in high fire areas. But I'm not sure if that is necessary.
I started up a 50 year f10 run on Cheyenne and ran into a patch fusion error around the 12 year mark. I haven't looked into it deeply yet, but wanted to report it asap:
The case directory is here:
|
At first glance, it does seem logical that this error would trigger. If we are looping through the tpp patch loop, while currentPatch is oldest, and we do trigger a fusion, then currentPatch will be set to the next older patch, here: fates/biogeochem/EDPatchDynamicsMod.F90 Lines 2436 to 2440 in bd994a1
However, the patch older than the oldest should be null. |
The reason it is changing the pointer of currentPatch is because it will cease to exist during fuse_2_patches, see these lines: fates/biogeochem/EDPatchDynamicsMod.F90 Lines 2666 to 2679 in bd994a1
I think we just need to add some more complete logic where we set tmpptr prior to the fusion call. if(associated(currentPatch%older))then If the second condition (ie younger) yields a null pointer, then you only have 1 patch. If you only have 1 patch, than you don't need to be fusing, so that shouldn't happen. Anyone else see this the same way? |
At @ckoven suggestion I also ran this for master (using ctsm5.1.dev099) and saw the same issue, although it too a little while longer to crop up (21 years). |
Per the fates software discussion today, it was agreed that I should implement Ryan's suggested fix and retest on this PR branch even though the issue is not directly caused by these changes. |
Prior to running the original long-term case, I also ran regression tests against the baseline. All expected tests pass, with three non-b4b results:
I believe these make sense as two of the three add in explicit disturbance modes to compete with fire and treefall and thus would be more likely to exhibit differences. Differences just due to fire and treefall disturbance are not likely to show up except in File location on Cheyenne: |
Another solution to this issue, which might be a little better, would be to just remove the endun: fates/biogeochem/EDPatchDynamicsMod.F90 Lines 2333 to 2336 in bd994a1
If the currentPatch loop is not associated, it would be because the we just fused the oldest patch and are now pointing to null(), which is an expected outcome. Following this we check for association, so the code should behave. I like this better than the previous idea because we would not be attempting fusion on the second oldest patch again. By attempting fusion on the second oldest, it gets two opportunities to fuse, which is more than the other patches and is not equitable. If more fusion is required, we should restart the loops. Which will be achieved by just removing the endrun listed above.
|
Regression tests re-run with the same results as before. Folder location on cheyenne: |
We've had an issue for ages that on a given day, FATES only resolves the larger of disturbance types between tree fall, fire, and logging. This code changes that so that all three are resolved every day. The solution is to just loop over disturbance types rather than evaluate which is largest.
fixes #490.
Description:
Collaborators:
Expectation of Answer Changes:
This should change answers. In particular, the sum of all disturbance rates should now equal the
FATES_POTENTIAL_DISTURBANCE
rate.Checklist:
Test Results:
CTSM (or) E3SM (specify which) test hash-tag:
CTSM (or) E3SM (specify which) baseline hash-tag:
FATES baseline hash-tag:
Test Output: