-
Notifications
You must be signed in to change notification settings - Fork 382
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
Implement alternating control of Fortran P3 codes for eam and scream #5496
Conversation
The alternating switch, determined by the case configuration option (a scream case or else), serves to control which version of Fortran P3 codes being used to build the model. A test is needed to track scream configuration. The version for the EAM version is currently just a skelton, which will be replaced by the eventual P3 PR from v3atm [BFB] A new test added.
The following tests verified BFB between master and this branch, with one using mg2 (but p3 codes built in) and the other with scream p3.
When reviewing, please ignore files in eam/src/physics/p3/eam. Files there are merely skeltons extracted from the actual p3_PR, and will be replaced entirely when the p3_PR is merged. |
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.
looks good!
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 creating this, @wlin7. It looks good to me, especially given that your tests with SCREAM compset and non-P3 compsets come back BFB with master before merging.
@@ -210,6 +210,7 @@ | |||
"SMS_D_Ld1.T62_oEC60to30v3.DTESTM", | |||
"SMS_D_Ld3.T62_oQU120.CMPASO-IAF", | |||
"SMS_D_Ld1.ne30pg2_r05_EC30to60E2r2.WCYCL1850", | |||
"SMS_Ln5.ne30pg2_ne30pg2.F2010-SCREAM-LR-DYAMOND2", |
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'd like to see a DP test 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.
DP test added to the developer test 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.
DP = "doubly-periodic" ? Hard to tell from the name that its that kind of domain.
components/eam/bld/configure
Outdated
@@ -1752,6 +1752,12 @@ if (defined $opts{'cppdefs'}) { | |||
} | |||
$cfg_ref->set('cppdefs', $usr_cppdefs); | |||
|
|||
# define is_scream_config flag to select which P3 version codes to use | |||
my $is_scream_config = 0; | |||
if ($usr_cppdefs =~ /\-DSCREAM/) { |
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.
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.
Good catch!
IIRC, that's used only by Homme. But I think we never tested it for SCREAMv0, so I am not sure what it would produce there. Grepping in Homme folder, all but a few of the matches are of the form
#if !defined(CAM) && !defined(SCREAM)
or its opposite without the !
's, which are good (we do what EAM would do). There are however a few cases where CAM and SCREAM would be treated differently:
- adjust_ps is
false
for SCREAM, andtrue
otherwise - for theta-l_kokkos target, if SCREAM is defined, forcing is not pushed back to f90 (I guess we assume we're running eamxx), while we do push to f90 for CAM.
I suspect the last of the two points above would cause wrong results in this case. I would leave -DSCREAM
out of the compile line, and use -DCAM
instead (which I think is already in the compile line anyways).
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 have vague recollection that DSCREAM
does not mean what a normal person would think. Maybe we should create a git issue in SCREAM to figure out whether we still need it or not? Though maybe it will naturally go away when we remove support for the F90 code in a few months?
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.
EAMxx does need -DSCREAM
(and in fact we do have it). But I think v0 should be considered as "EAM" from the point of view of Homme.
@wlin7 - I'd like to see a DP test case and |
Sorry I had an illusion this PR already merged and not watching. DP-SCREAM test added to atm_developer (and tested working well). Note that there is another global LR test for SCREAM in the integration test suite. @PeterCaldwell , regarding use of |
@wlin7 - Hmm. I think some people (like Po-Lun) are using SCREAM configurations with MAM rather than SPA, so -spa might cause problems. I could also easily imagine people comparing SHOC vs CLUBB, which would make -shoc_sgs in appropriate. I'm not sure of a better approach though. I guess I'd recommend connecting p3 version to -shoc_sgs and adding a warning message to the log file about which version of P3 was added. It's not worth doing something complicated since F90-SCREAM isn't officially supported and will be actively discouraged from use a few months from now. |
Good points, @PeterCaldwell . That does suggest it is not reliable to use those physics option as an indication of scream config. How about keeping |
I thought Luca said above that -DSCREAM was always false for F90 scream runs (so it won’t work to differentiate EAM versus scream). Have you confirmed that’s not the case? |
Yeah, I agreed with @bartgol 's assessment. No effect mostly because -DCAM and -DSCREAM are used redundantly. The exception is in
|
The 9f2d8bb now determines a scream case when p3 is used together with shoc_sgs. DPSCREAM and a regular EAM F2010 cases have been tested and verified the proper p3 version is selected for the build. |
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 is fine from the point of view of homme now. I can't comment much on the rest.
The alternating switch, determined by the case configuration option (a scream case or else), serves to control which version of Fortran P3 codes being used to build the model. A test is needed to track scream configuration. The version for the EAM version is currently just a skelton, which will be replaced by the eventual P3 PR from v3atm [BFB] Two new tests SMS_Ln9_P24x1.ne4_ne4.FDPSCREAM-ARM97 and SMS_Ld1.ne30pg2_ne30pg2.F2010-SCREAM-LR-DYAMOND2
Merged to next. |
gcp12 tests had runtime fails on next:
|
Merged to master. Note that the issues on gcp12 and on ascent ibm will need to be resolved in a subsequent PR. |
The alternating switch, determined by the case configuration option (a scream case or else), serves to control which version of Fortran P3 codes being used to build the model. A test is needed to track scream configuration. The version for the EAM version is currently just a skelton, which will be replaced by the eventual P3 PR from v3atm [BFB] Two new tests SMS_Ln9_P24x1.ne4_ne4.FDPSCREAM-ARM97 and SMS_Ld1.ne30pg2_ne30pg2.F2010-SCREAM-LR-DYAMOND2
The alternating switch, determined by the case configuration option (a scream case or else), serves to control which version of Fortran P3 codes being used to build the model. A test is needed to track scream configuration. The version for the EAM version is currently just a skelton, which will be replaced by the eventual P3 PR from v3atm
[BFB] Two new tests SMS_Ln9_P24x1.ne4_ne4.FDPSCREAM-ARM97
and SMS_Ld1.ne30pg2_ne30pg2.F2010-SCREAM-LR-DYAMOND2