-
Notifications
You must be signed in to change notification settings - Fork 318
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 some max_patch_per_col and maxsoil_patches loops #2056
Refactor some max_patch_per_col and maxsoil_patches loops #2056
Conversation
@rgknox I added you as reviewer, since you pointed out that you performed a similar (or the same) refactor in CNCIsoFluxMod yourself. Test-suites: |
Resolved conflicts: src/biogeochem/CNPhenologyMod.F90
Test-suites: Cheyenne WAIT for compute nodes to become available |
Since this PR is bfb, I agreed with @ekluzek that it could be merged with one of his other bfb PRs if he so decides. |
I tried merging this with #1959 to see how ugly the merge would be. It's ugly enough that we should wait until after #1959 comes in. The files with merge conflicts are:
For the last two the merges are pretty trivial. The top three have merges that aren't completely horrible, but complex enough that we should wait. Then a few that are trivial. When this does come in it might be good for a few of us to examine them closely to make sure we are adopting the best solution. Probably at least @slevis-lmwg and @rgknox. And I'd be willing to part of that as well. So I'm leaving this as a draft, to come in later. |
Resolved conflicts and this test passed: |
Resolved conflicts: doc/ChangeLog doc/ChangeSum src/biogeochem/CNCIsoFluxMod.F90 src/biogeochem/CNDriverMod.F90 src/biogeochem/CNPhenologyMod.F90 src/soilbiogeochem/SoilBiogeochemVerticalProfileMod.F90
Izumi test-suite PASS |
Resolved conflicts: doc/ChangeLog doc/ChangeSum
Updated to dev137 and running test-suites. I plan to merge this tomorrow. @ekluzek would you like to review this PR before I merge? If so, either late this afternoon or tomorrow morning. Let me know what you think. Or would you prefer that I reach out to someone else? |
I think it would be good for me to look it over. I'll try to get to that tonight. I'm not sure there's anyone else. @rgknox did work on this so maybe him. But, it's too late in the day to expect that. |
Test-suites |
if (pi <= col%npatches(c)) then | ||
p = col%patchi(c) + pi - 1 | ||
|
||
if (patch%active(p)) 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.
Ahhh, yes this is a nice improvement, just loop over the soil patches in the filter, and remove the if statements to make sure they are active and within range.
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, this is awesome, and results in a nice cleanup of the code. Not having to send both column and patch filters down is a nice simplification. And the result looks a lot cleaner (and slightly more efficient) than how this was previously done. Glad you worked on this and bringing it in.
I have one small request in the ChangeLog.
doc/ChangeLog
Outdated
Bugs fixed or introduced | ||
------------------------ | ||
CTSM issues fixed (include CTSM Issue #): | ||
Fixes #2025 |
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 helpful to give the summary of the issue fixed in the ChangeLog, since the issue isn't connected to github.
Other details | ||
------------- | ||
Pull Requests that document the changes (include PR ids): | ||
https://github.com/ESCOMP/ctsm/pull/2056 |
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 usually give the one line comment for PR's, but it's OK here. That's important when several PR's are merged together. But, with one PR in a tag, there's no reason to give the description. It's also easier for a single PR in a tag to just give the number, so I'll do that in the future as well.
Description of changes
Issue #2025 shows examples of such loops that can be refactored for a clearer and more efficient code.
Specific notes
Contributors other than yourself, if any:
@glemieux @ekluzek @billsacks
CTSM Issues Fixed (include github issue #):
#2025
Are answers expected to change (and if so in what way)?
No, based on most recent testing.
Any User Interface Changes (namelist or namelist defaults changes)?
No.
Testing performed, if any:
...on the changes that I have made this far:
PASS
./create_test SMS_D_Ld3.f10_f10_mg37.I1850Clm50BgcCrop.cheyenne_intel.clm-default -c /glade/p/cgd/tss/ctsm_baselines/ctsm5.1.dev130
Cheyenne test-suite is in progress and hasn't raised any failures this far