Skip to content
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

Improve accuracy of the SCM "Replay" mode #3051

Merged
merged 18 commits into from
Aug 15, 2019

Conversation

bogensch
Copy link
Contributor

@bogensch bogensch commented Jul 9, 2019

This PR improves the accuracy of the SCM Replay mode. Previous implementation allowed the user to “replicate the behavior” of an E3SM run in SCM, but with temperature errors on the order of ~0.1 K after a day. This PR will provide the user with capability to produce “quasi-bit-for-bit” results with Replay mode, with temperature errors on the order of ~1.e-5 K.

The reason why Replay mode is unable to provide fully B4B results is because the dynamics tendency computed for Replay is not identical to the way that the full model computes its dynamics tendencies (which involves sub-cycling in the SE dynamical core). Thus, there is issue with roundoff. Note that in the past, CAM Replay mode with Eulerian dy-core could produce “B4B” results but only because if the flag to generate Replay mode output was turned on, they updated their T and Q based on the tendency computed for Replay purposes. Thus the run to generate Replay forcing was NOT b4b with a normal production run. We are working on a truly B4B Replay mode for E3SM and a future PR will support this which will involve higher precision computation of the dynamical tendencies.

This PR also renames the old “-camiop” flag to “-e3smreplay” flag to be more current and consistent with E3SM. Other flags are renamed accordingly throughout the code.

Note that in this PR the e3sm_developer test “SMS_R_Ld5.ne4_ne4.FSCM5A97” is an expected fail when comparing results to baseline. This is because where the large-scale vertical velocity is read in and updated had to be moved so that CLUBB could see it at the consistent timestep. It was validated that results for selected tested cases (ARM97, GOAMAZON, DYCOMS-RF01, BOMEX) have very minimal impacts with this fix included.

All other e3sm_developer tests pass.

@@ -1887,7 +1887,7 @@ subroutine cime_init()
!----------------------------------------------------------

areafact_samegrid = .false.
#if (defined BFB_CAM_SCAM_IOP )
#if (defined E3SM_SCM_REPLAY )
if (.not.samegrid_alo) then
call shr_sys_abort(subname//' ERROR: samegrid_alo is false - Must run with same atm/ocn/lnd grids when configured for scam iop')
Copy link
Contributor

@wlin7 wlin7 Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not essential but just to have a more consistent message. change "when configured for scam iop" to " ... for scm replay". Similarly for line 1702.

@@ -3979,7 +3979,7 @@ if ($cfg->get('scam')) {
}

# CAM generates IOP file for SCAM
if ($cfg->get('camiop')) {
if ($cfg->get('e3smreplay')) {
add_default($nl, 'inithist', 'val'=>'CAMIOP');
Copy link
Contributor

@wlin7 wlin7 Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the 'CAMIOP' type of inithist: do we want to rename this type to reflect the current naming convention for this feature? If changed, it would trigger changes in several other files (including configure, build-namelist, namelist_definition.xml, and cam_history.F90). It can certainly be considered in a future PR rather than now.

! if the dataset is a CAM generated dataset set use_camiop to true
! CAM IOP datasets have a global attribute called CAM_GENERATED_IOP
! if the dataset is a CAM generated dataset set use_replay to true
! E3SM IOP datasets have a global attribute called E3SM_GENERATED_IOP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 682 global attribute "E3SM_GENERATED_FORCING" instead of "E3SM_GENERATED_IOP"

call outfld('shflx ',cam_in%shf, pcols, lchnk)
call outfld('lhflx ',cam_in%lhf, pcols, lchnk)
call outfld('trefht ',cam_in%tref, pcols, lchnk)
call outfld('Tg', cam_in%ts, pcols, lchnk)
call outfld('Tsair',cam_in%ts, pcols, lchnk)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cam_in%tref is more suitable as Tsair here. If PS is not exactly reproduced, tsair could be used for vertical interpolation of T.

@wlin7
Copy link
Contributor

wlin7 commented Aug 9, 2019

Hi @bogensch , the PR looks good. The suggested changes are really not essential. Can you take a look if you would like to get this PR into master as is for now, and probably consider the suggested changes in a future PR?

@bogensch
Copy link
Contributor Author

Hi @wlin7 thanks for the careful review, as always. Sounds good to me, yes let's get the PR in for now and I'll consider your comments in another SCM branch I'm working on.

@wlin7
Copy link
Contributor

wlin7 commented Aug 14, 2019

Thanks @bogensch . your plan sounds good to me. Not sure when regression tests are going to start tonight. Look to merge it tomorrow.

wlin7 added a commit that referenced this pull request Aug 14, 2019
Improve accuracy of the SCM "Replay" mode

This PR improves the accuracy of the SCM Replay mode. Previous implementation allowed the user to "replicate the behavior" of an E3SM run in SCM, but with temperature errors on the order of ~0.1 K after a day. This PR will provide the user with capability to produce "quasi-bit-for-bit" results with Replay mode, with temperature errors on the order of ~1.e-5 K.

The reason why Replay mode is unable to provide fully B4B results is because the dynamics tendency computed for Replay is not identical to the way that the full model computes its dynamics tendencies (which involves sub-cycling in the SE dynamical core). Thus, there is issue with roundoff. Note that in the past, CAM Replay mode with Eulerian dy-core could produce "B4B" results but only because if the flag to generate Replay mode output was turned on, they updated their T and Q based on the tendency computed for Replay purposes. Thus the run to generate Replay forcing was NOT b4b with a normal production run. We are working on a truly B4B Replay mode for E3SM and a future PR will support this which will involve higher precision computation of the dynamical tendencies.

This PR also renames the old "-camiop" flag to "-e3smreplay" flag to be more current and consistent with E3SM. Other flags are renamed accordingly throughout the code.

Note that in this PR the e3sm_developer test "SMS_R_Ld5.ne4_ne4.FSCM5A97" is an expected fail when comparing results to baseline. This is because where the large-scale vertical velocity is read in and updated had to be moved so that CLUBB could see it at the consistent timestep. It was validated that results for selected tested cases (ARM97, GOAMAZON, DYCOMS-RF01, BOMEX) have very minimal impacts with this fix included.

All other e3sm_developer tests pass.

[BFB] except for SCM test.
@wlin7
Copy link
Contributor

wlin7 commented Aug 14, 2019

Merged to next.

@wlin7 wlin7 merged commit bf951c4 into master Aug 15, 2019
wlin7 added a commit that referenced this pull request Aug 15, 2019
Improve accuracy of the SCM "Replay" mode

This PR improves the accuracy of the SCM Replay mode. Previous implementation
allowed the user to "replicate the behavior" of an E3SM run in SCM, but with
temperature errors on the order of ~0.1 K after a day. This PR will provide
the user with capability to produce "quasi-bit-for-bit" results with Replay mode,
with temperature errors on the order of ~1.e-5 K.

The reason why Replay mode is unable to provide fully B4B results is because
the dynamics tendency computed for Replay is not identical to the way that the
full model computes its dynamics tendencies (which involves sub-cycling in the
SE dynamical core). Thus, there is issue with roundoff. Note that in the past,
CAM Replay mode with Eulerian dy-core could produce "B4B" results but only
because if the flag to generate Replay mode output was turned on, they updated
their T and Q based on the tendency computed for Replay purposes. Thus the run
to generate Replay forcing was NOT b4b with a normal production run. We are
working on a truly B4B Replay mode for E3SM and a future PR will support this
which will involve higher precision computation of the dynamical tendencies.

This PR also renames the old "-camiop" flag to "-e3smreplay" flag to be more
current and consistent with E3SM. Other flags are renamed accordingly throughout the code.

Note that in this PR the e3sm_developer test "SMS_R_Ld5.ne4_ne4.FSCM5A97"
is an expected fail when comparing results to baseline. This is because
where the large-scale vertical velocity is read in and updated had to be
moved so that CLUBB could see it at the consistent timestep. It was validated
that results for selected tested cases (ARM97, GOAMAZON, DYCOMS-RF01, BOMEX)
have very minimal impacts with this fix included.

All other e3sm_developer tests pass.

[BFB] except for the SCM test.
@wlin7
Copy link
Contributor

wlin7 commented Aug 15, 2019

Merged. Request to bless SCM test on sandiatoss3 and melvin.

@bogensch bogensch deleted the bogensch/atm/SCM_REPLAY_quasiB4B branch August 22, 2019 16:15
rljacob pushed a commit that referenced this pull request Apr 12, 2021
Improve accuracy of the SCM "Replay" mode

This PR improves the accuracy of the SCM Replay mode. Previous implementation
allowed the user to "replicate the behavior" of an E3SM run in SCM, but with
temperature errors on the order of ~0.1 K after a day. This PR will provide
the user with capability to produce "quasi-bit-for-bit" results with Replay mode,
with temperature errors on the order of ~1.e-5 K.

The reason why Replay mode is unable to provide fully B4B results is because
the dynamics tendency computed for Replay is not identical to the way that the
full model computes its dynamics tendencies (which involves sub-cycling in the
SE dynamical core). Thus, there is issue with roundoff. Note that in the past,
CAM Replay mode with Eulerian dy-core could produce "B4B" results but only
because if the flag to generate Replay mode output was turned on, they updated
their T and Q based on the tendency computed for Replay purposes. Thus the run
to generate Replay forcing was NOT b4b with a normal production run. We are
working on a truly B4B Replay mode for E3SM and a future PR will support this
which will involve higher precision computation of the dynamical tendencies.

This PR also renames the old "-camiop" flag to "-e3smreplay" flag to be more
current and consistent with E3SM. Other flags are renamed accordingly throughout the code.

Note that in this PR the e3sm_developer test "SMS_R_Ld5.ne4_ne4.FSCM5A97"
is an expected fail when comparing results to baseline. This is because
where the large-scale vertical velocity is read in and updated had to be
moved so that CLUBB could see it at the consistent timestep. It was validated
that results for selected tested cases (ARM97, GOAMAZON, DYCOMS-RF01, BOMEX)
have very minimal impacts with this fix included.

All other e3sm_developer tests pass.

[BFB] except for the SCM test.
rljacob pushed a commit that referenced this pull request Apr 21, 2021
Improve accuracy of the SCM "Replay" mode

This PR improves the accuracy of the SCM Replay mode. Previous implementation
allowed the user to "replicate the behavior" of an E3SM run in SCM, but with
temperature errors on the order of ~0.1 K after a day. This PR will provide
the user with capability to produce "quasi-bit-for-bit" results with Replay mode,
with temperature errors on the order of ~1.e-5 K.

The reason why Replay mode is unable to provide fully B4B results is because
the dynamics tendency computed for Replay is not identical to the way that the
full model computes its dynamics tendencies (which involves sub-cycling in the
SE dynamical core). Thus, there is issue with roundoff. Note that in the past,
CAM Replay mode with Eulerian dy-core could produce "B4B" results but only
because if the flag to generate Replay mode output was turned on, they updated
their T and Q based on the tendency computed for Replay purposes. Thus the run
to generate Replay forcing was NOT b4b with a normal production run. We are
working on a truly B4B Replay mode for E3SM and a future PR will support this
which will involve higher precision computation of the dynamical tendencies.

This PR also renames the old "-camiop" flag to "-e3smreplay" flag to be more
current and consistent with E3SM. Other flags are renamed accordingly throughout the code.

Note that in this PR the e3sm_developer test "SMS_R_Ld5.ne4_ne4.FSCM5A97"
is an expected fail when comparing results to baseline. This is because
where the large-scale vertical velocity is read in and updated had to be
moved so that CLUBB could see it at the consistent timestep. It was validated
that results for selected tested cases (ARM97, GOAMAZON, DYCOMS-RF01, BOMEX)
have very minimal impacts with this fix included.

All other e3sm_developer tests pass.

[BFB] except for the SCM test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants