TF2: Getting CAM w/ new CLUBB external to match old CAM-CLUBB results #101
Replies: 11 comments 21 replies
-
For UWM's reference (@bmg929), UWM's private discussion concerning this merge is at https://github.com/larson-group/cam/issues/140. I wonder if this older larson-group/cam tag https://github.com/larson-group/cam/releases/tag/cam_12a6970_clubb_335d83b_20211111 based on the 031 trunk would reproduce either Kate's new branch or else the 053 trunk. Likewise, does that older larson-group/cam tag match the newest version of larson-group/cam branch clubb_silhs_devel? |
Beta Was this translation helpful? Give feedback.
-
The versions of CLUBB in these two repos are Clean 053 CAM tag: Feb 20, 2020, commit b0575cc936312f99dcffe9f1f7bea6932cd1fd4a I am currently running some tests comparing Brian Griffin's Nov 11 CAM-CLUBB tag from the Larson-group repo---which is based on a CAM 031 tag---to a clean CAM 031 tag. Brian thought those results were similar. If they are this might help to narrow down where the differences are coming from. |
Beta Was this translation helpful? Give feedback.
-
My tests from a clean 031 tag and from the latest version of the Larson group CAM repo failed, well into the run, with NaN's coming from advance_xp2_xpyp. I wasn't running with the debugger so I don't have that output. Seems strange to me that a clean 031 tag and the latest Larson group repo would crash for similar reasons, I will look into it later today if I have some time. My test with the Nov 11 Larson group CAM tag passed, so I'll also post the SWCF from that when I get a sec. |
Beta Was this translation helpful? Give feedback.
-
After manually fixing a known bug that existed in the earlier CAM code, my runs for the clean 031 tag, Brian's Nov 11 Larson-group CAM tag, and the Larson-group March 10 repos ran to completion for 1-year tests. It looks to me like Brian's Nov 11 tag and the clean 031 tag have very similar SWCF, not b4b but quite similar. Brian's Nov 11 Larson-group tag: I'm in the process of completing another couple of runs from the Larson-group CAM repo from March 10, the same code base that Kate is incorporating into her PR. I originally was going to use the most recent version of the LG CAM repo but thought I should use March 10 since this might carry more info regarding the code Kate is using. The March 10 repo has opposite settings for the a3_coef clipping and the l_min_xp2 and l_enable_relaxed_clipping flags so I'm toggling those to see what they do (i.e. I'm doing two tests with the March 10 repo). These should be done in a few hours and I'll post them here. |
Beta Was this translation helpful? Give feedback.
-
For documentation purposes I'll add here that I've gone through the commits marked "BIT_CHANGING" since Brian's Nov 11 Larson-group CAM tag, and the only ones that are actually answer-changing are the things we've previously identified: PDF call put into the "post" position, l_enable_relaxed_clipping turned off, and a3_coef clipping removed. Additionally the l_min_*p2_from_corr_wx flags were turned on in CAM a few months ago (these were set to true in CLUBB standalone years ago). All other commits marked BIT_CHANGING are just changes that affect the netcdf output but not the answers. |
Beta Was this translation helpful? Give feedback.
-
possible breakthrough Ok, when I first ran the March 10 Larson-group CAM repo with everything reverted (using clipping on a3_coef, setting l_min_xp2=F and l_enable_relaxed_clipping=T, and setting PDF placement into the "pre" position), I got these results: So this suggests I should be able to get Kate's latest code base to agree with the clean 053 tag in a similar way, which I will try tomorrow and update here again. I've checked that the clean 053 tag also sets the expldiff_rtm_thlm flag to true in the same unintended way, and Kate's code doesn't, so I'm betting this explains the differences we were seeing. |
Beta Was this translation helpful? Give feedback.
-
The commit that removed the line
(and the whole block that this line was a part of) from clubb_intr.F90 was made by Gunther Huebler on Jan 31 2022, and then Kate merged the Larson-group CAM repo into her PR on Mar 17 so that's how that line got lost. I'm not sure whether Gunther realized the l_do_expldiff_rtm_thlm flag was set differently than the other flags when he made the commit, since it looks like he just thought he was improving the configurable flag setup process. But this may be important for users to be aware of. |
Beta Was this translation helpful? Give feedback.
-
Ok, so when the l_do_expldiff_rtm_thlm flags match (=T), there is basically consistency between the clean 053 tag and Kate's PR: There are slight differences but obviously much closer agreement than before. Is this close enough agreement to feel confident that the new CLUBB external is backward-compatible when the settings are reverted? |
Beta Was this translation helpful? Give feedback.
-
I made some more progress this weekend on getting Kate's new PR code to agree with the previous CAM 053 tag. I wasn't having any more luck hunting down different flags or parameters, or answer-changing differences in clubb_intr.F90 (@Katetc suggested a few to check), so I bit the bullet and went back two years in the Larson group CLUBB repo and looked for answer-changing commits. I found a number of commits that will affect answers due to structural changes to CLUBB's code (i.e. not changes to tunable parameter values or configurable flags). Some are very easy to revert (and they help to make new CAM look more like old CAM), but some would take some time to revert since they involve many lines of code. The list of changes and links to associated commits is here:
I had been doing one-year runs to test various reversions, but Julio suggested that longer runs might help to smooth out differences from minor order-of-operations changes, etc. When I revert z_displace from (1), the upwp_forcing and vpwp_forcing coefficients from (2), the order-of-operations changes from (3), the sigma threshold from (4), and the magic number for clipping from (5), and run the original 053 tag and the new code for 5 years with all tunable parameters and configurable flags agreeing, I get the following results which are pretty close. Kate's PR code (reverted as described): As you can see now there's only a 0.07 difference in the mean SWCF, with the new code having a slightly stronger effect. I'm thinking that if I were to revert the (6), (7), and (8), we might get back to rounding error only, but I'm not sure if it's worth the work to do it (although my brain thinks it would be fun to try). |
Beta Was this translation helpful? Give feedback.
-
@vlarson and @JulioTBacmeister and I have decided these results are close enough to the original 053 tag that the question of reproducing the same climate has been satisfactorily answered for now. This discussion does contain potentially useful info about reproducing the older CAM version climate however so this discussion may be better locked rather than deleted. |
Beta Was this translation helpful? Give feedback.
-
For future reference, here are |
Beta Was this translation helpful? Give feedback.
-
@vlarson suggested it would be useful to recover old CAM results with the new CLUBB external, as a check to make sure that the new CLUBB code is backward compatible. Since Kate's pull request is using an 053 tag, I thought the way to proceed would be to clone a clean 053 tag and run it, then try and reproduce those results with Kate's new PR code.
So far the two code bases shows pretty different climates from 14-month runs using the following create_newcase command:
where compset=FHIST and driver=mct.
I have found a couple of differences between the code bases that I thought might be important, for example the values of
omicron
andupsilon_precip_frac_rat
(Brian says these should have no effect unless SILHS is active), and also in Kate's code the PDF call placement was in the "post" position while in the clean 053 tag it was in the "pre" position, so I've reverted those things and I still find pretty significant disagreement. I've gone through all other parameters and flags and am not aware of any other disagreements, so my next guess is structural changes to CLUBB's code, which may be harder to track down.Here is SWCF as an example of the differences in climate.
From old CAM 053 tag:
SWCF from Kate's PR code:
Beta Was this translation helpful? Give feedback.
All reactions