-
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
allow disturbance in nocomp mode #833
Conversation
…s adds up to 1-pftpatcharea
biogeochem/EDPatchDynamicsMod.F90
Outdated
do while(associated(currentPatch)) | ||
|
||
cp_nocomp_matches_1: if ( hlm_use_nocomp .eq. ifalse .or. & |
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.
where the do loops have labels they include the word 'loop' in them, so I feel like the if statement labels might be easier for people to parse if they have 'if' in their name.
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.
Yeah I wasn't very consistent in how I did this. It would probably be easier to read if each label does have an 'if' or 'loop' or something like that in it. So will edit to try to be more consistent.
|
||
!----------------------------------------------------------------------------------- | ||
! check to see if both patches are older than the age at which we force them to fuse | ||
!----------------------------------------------------------------------------------- | ||
|
||
if ( tpp%age .le. max_age_of_second_oldest_patch .or. & | ||
maxage_if: if ( tpp%age .le. max_age_of_second_oldest_patch .or. & |
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.
This one being an example of an 'if' label having an 'if' in it...
if(hlm_use_nocomp.eq.itrue.and. & | ||
tpp%nocomp_pft_label.ne.currentPatch%nocomp_pft_label)then | ||
fuse_flag = 0 | ||
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.
So this is deleted because it's redundant with the code on line 2766?
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.
@rosiealice yes that's right
I ran the fates suite tests for this with comparison against the baseline on Cheyenne. There's an issue with the nocomp testmod, although all other expected tests pass b4b against the baseline. The nocomp testmod is a 30 day test and should finish up in a couple of minutes, but it's hitting the 40 min wall clock limit. I've resubmitted it to double check, but as of this writing the run is a 14 mins so it's probably a real issue. Looking at the lnd.log I'm seeing the following:
I've got another run for this test going with debug modes on (i.e. both |
Thanks @glemieux. Sounds like its probably getting caught in an infinite loop, either in |
The debug mode test location on Cheyenne: |
… catch them in other cases
The fix in b705816 allowed the nocomp testmod to pass: Rerunning the fates suite with baseline comparison. |
All expected tests pass b4b against baseline now. The NoComp test mod is resulting in DIFFs as expected: |
@@ -2282,6 +2304,19 @@ subroutine fuse_patches( csite, bc_in ) | |||
primary_land_fraction_afterfusion = 0._r8 | |||
|
|||
nopatches(1:n_anthro_disturbance_categories) = 0 | |||
|
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.
Also, shouldn't this be the actual number of unique pfts on this site? And if so, would we change this to not have the hlm_use_fixed_biogeog part of the logic.
If it not the actual number of pfts on the site, and instead is the number defined by the parameter file, then we should move this logic to FatesInterfaceMod, perform this evaluation once, and then remove the "parameter" designation of maxPatchesPerSite_by_disttype, and update maxPatchesPerSite_by_disttype.
tpp => currentSite%youngest_patch | ||
do while(associated(tpp)) | ||
tpp_loop: do while(associated(tpp)) |
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.
love all these labels
currentPatch%anthro_disturbance_label .eq. i_disttype) then | ||
|
||
nocomp_pft_labels_match_if: if (hlm_use_nocomp .eq. ifalse .or. & |
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.
makes sense
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.
This PR looks good, see questions in line.
Retest after updates per b5f2c45 results in all expected tests passing B4B against the baseline, with the expected exception of the |
all tests nominal, expecting the following BASELINE fail: ERS_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.cheyenne_intel.clm-FatesColdDefReducedComplexNoComp |
Currently, disturbance processes are turned off while in nocomp mode. This PR includes changes that enables the tracking of patch-level nocomp PFT labels during patch creation and fusion processes, which allows for turning on disturbance when nocomp mode is active.
Note that this still does not allow for disturbance in SP mode, because that wouldn't really make sense. But it does enable it in non-SP nocomp modes.
This should not require any changes to the interface or parameter file.
Description:
To do this, a few things needed to be done:
Since the disturbance and in particular patch fusion code already has a lot of nested if and do blocks, I also went through fairly liberally and added names to a lot of these blocks. I had to do this to be able to figure out where to insert the code in the right places. Hopefully this adds a greater degree of readibility to those codes. I have not (so far) gone through and re-indented the code, as that will generate a ton of whitespace changes.
Collaborators:
Some discussion with @rosiealice and @rgknox
Expectation of Answer Changes:
should be bit for bit in all non-nocomp and SP configurations. Should be answer changing in non-SP nocomp configurations.
Checklist:
Test Results:
not yet tested.
CTSM (or) E3SM (specify which) test hash-tag:
CTSM (or) E3SM (specify which) baseline hash-tag:
FATES baseline hash-tag:
Test Output: