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

Update weights for ocean barotropic subcycling in split-explicit solver #6035

Merged

Conversation

mark-petersen
Copy link
Contributor

@mark-petersen mark-petersen commented Oct 31, 2023

These improvements were originally written by @dengwirda, as described in E3SM-Ocean-Discussion#48. Please refer to that PR for additional test results and discussion. Also see test results run in combination with AB2 at #5989 (comment).

This PR updates the weights config_btr_gam1_velWt1, config_btr_gam2_SSHWt1 in the MPAS-Ocean barotropic solver based on recent analysis of this scheme. This update applies to "split explicit" time stepping schemes, i.e. config_time_integrator = 'split_explicit' and the new config_time_integrator = 'split_explicit_ab2' in #5989. The new weights allow for a barotropic time step config_btr_dt to be 25% longer in the tests of EC30to60, thus speeding up the barotropic subcycling. We expect that values of config_btr_dt can be increased by 25% for all meshes.

[NML]
[non-BFB]

* Update weight for the barotropic subcycling in split_explicit and
  split_explicit_ab2 solver by @dengwirda
  - config_btr_gam1_velWt1: 0.5 -> 0.5333
  - config_btr_gam2_SSHWt1: 1.0 -> 0.5333
  - config_btr_dt for EC30to60 meshes: 60 s -> 75 s

* PR in E3SM-Ocean-Discussion
  E3SM-Ocean-Discussion#48
@mark-petersen mark-petersen added mpas-ocean non-BFB PR makes roundoff changes to answers. labels Oct 31, 2023
@mark-petersen
Copy link
Contributor Author

@dengwirda, @jeremy-lilly, @gcapodag: Many thanks for your work on time-stepping methods this past year, and this tuning in particular. Feel free to comment here as time permits.

@mark-petersen
Copy link
Contributor Author

Adding previous comment for completeness (and the great images!!!):

This PR updates the default gamma weights (config_btr_gam1_velWt1, config_btr_gam2_SSHWt1) in the barotropic subcycling phase of the split-explicit solver. Based on work with @jeremy-lilly, @gcapodag and @mark-petersen, a stability analysis of the linearised external mode problem was used to estimate the coefficients that improve the scheme's CFL-limit, while also reducing numerical dissipation. Overall, the new coefficients $\gamma_{1,2} = \frac{8}{15}$ allow larger time-steps to be used; approximately $\frac{4}{3}$ the length of the maximum stable step-size used with the current $\gamma_{1} = \frac{1}{2}$, $\gamma_{2} = 1$ pair. This allows, e.g. config_btr_dt to be increased from 60sec to 75sec for QU30km and EC60to30km meshes and overall runtime to be reduced.

Following Shchepetkin et al., the behaviour of a time-stepping scheme can be analysed using a dissipation-dispersion diagram, in which a 'perfect' integration scheme would reproduce the unit-circle exactly, stability requires the scheme to lie inside the circle, dissipative errors are represented by a reduced curve radius and dispersive errors by angular offset.

Old weights:
old_btr_weights

New weights:
new_btr_weights

The current weights achieve $\mathrm{CFL_{max}} = 1.41$ and the new weights $\mathrm{CFL_{max}} = 1.88$, leading to the $\frac{4}{3}$ time-step extension.

Though there is a third weight config_btr_gam3_velWt2 available, this is typically not used, with config_btr_solve_SSH2 = .false. Initial experiments did not suggest including this step improved either stability or accuracy (the opposite in fact), though additional investigation would be required on this front.

I've confirmed the new weights allow config_btr_dt = 00:00:75 for QU30km and EC60to30km config.'s (vs the current 60 sec time-step) and that 3yr standalone spin-ups lead to eyeball-norm consistent (but non-BFB) output. Additional testing would be required to validate performance in coupled E3SM runs.

  • Shchepetkin, A.F. and McWilliams, J.C., 2009. Computational kernel algorithms for fine-scale, multiprocess, longtime oceanic simulations. In Handbook of Numerical Analysis (Vol. 14, pp. 121-183).

<config_btr_dt ocn_grid="ECwISC30to60E1r2">'0000_00:01:00'</config_btr_dt>
<config_btr_dt ocn_grid="oEC60to30v3">'0000_00:01:15'</config_btr_dt>
<config_btr_dt ocn_grid="oEC60to30v3wLI">'0000_00:01:15'</config_btr_dt>
<config_btr_dt ocn_grid="ECwISC30to60E1r2">'0000_00:01:15'</config_btr_dt>
<config_btr_dt ocn_grid="oRRS30to10v3">'0000_00:00:24'</config_btr_dt>
<config_btr_dt ocn_grid="oRRS30to10v3wLI">'0000_00:00:18'</config_btr_dt>
<config_btr_dt ocn_grid="oRRS18to6v3">'0000_00:00:12'</config_btr_dt>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To take full advantage of this PR, we should lengthen config_btr_dt where we can for other meshes. @hyungyukang could you please extend your 18to6 run a bit (10 days?) with the new btr weights, and see if you can use config_btr_dt of 15s (or even 16?) rather than 12s?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mark-petersen , Sure, I'm going to run the same 18to6 run I've done with updated btr weights and see if we can use larger BTR time step size. I will report here once I finish the tests.

<config_btr_dt ocn_grid="oRRS30to10v3">'0000_00:00:24'</config_btr_dt>
<config_btr_dt ocn_grid="oRRS30to10v3wLI">'0000_00:00:18'</config_btr_dt>
<config_btr_dt ocn_grid="oRRS18to6v3">'0000_00:00:12'</config_btr_dt>
<config_btr_dt ocn_grid="oRRS15to5">'0000_00:00:11.25'</config_btr_dt>
<config_btr_dt ocn_grid="oARRM60to10">'0000_00:00:24'</config_btr_dt>
<config_btr_dt ocn_grid="oARRM60to6">'0000_00:00:10'</config_btr_dt>
<config_btr_dt ocn_grid="ARRM10to60E2r1">'0000_00:00:24'</config_btr_dt>
<config_btr_dt ocn_grid="EC30to60E2r2">'0000_00:01:00'</config_btr_dt>
<config_btr_dt ocn_grid="EC30to60E2r2">'0000_00:01:15'</config_btr_dt>
<config_btr_dt ocn_grid="WC14to60E2r3">'0000_00:00:15'</config_btr_dt>
<config_btr_dt ocn_grid="WCAtl12to45E2r4">'0000_00:00:15'</config_btr_dt>
<config_btr_dt ocn_grid="SOwISC12to60E2r4">'0000_00:00:15'</config_btr_dt>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonbob, @darincomeau and @xylar, I suspect these three could all be extended from 15s to 19 or 20s. I think it is too much to test all this right now for this PR, but as we test and add E3 version grids, we should test with the value of config_btr_dt that is 25% longer.

@mark-petersen
Copy link
Contributor Author

I ran one year of this PR plus #5989 with gnu on chrysalis in MPAS-O standalone, using compass ec30to60 and ecwisc30to60 suites, but with cached mesh and init steps to save time. This then takes the model through the spin up process, then I extended the simulation step to 360 days. The results for AB2 look very good. It is stable with the same spin-up procedure, and min and max on temperature and salinity remain constant.

@dengwirda
Copy link
Contributor

@mark-petersen and all, as you've said, these changes should allow config_btr_dt to be lengthened in general, and I previously had success across a range of meshes + standalone spin-ups wrt. similar % increases --- would expect similar impact irrespective of resolution, etc. Of course, tuning for max config_btr_dt will be a per-mesh experience, so those tests would have to be done for each config. individually...

In addition to the longer config_btr_dt, these new weights should also lessen (spurious) dissipation of gravity waves. This was observable in a channel config., though I don't expect this behaviour would feedback significantly onto the mean climate state. @jonbob previously confirmed the expected small diffs in a 30-to-60km B-case (G-case?).

Overall, hopefully this is simply some 'free' MPAS-O performance improvement, via optimisation of the time integrator CFL + truncation behaviour.

@rljacob
Copy link
Member

rljacob commented Nov 16, 2023

@hyungyukang please review.

@rljacob rljacob added this to the v3.0beta02 milestone Nov 16, 2023
@hyungyukang
Copy link
Contributor

hyungyukang commented Nov 16, 2023

@rljacob and @mark-petersen , sorry for my late review.
I ran some cases but forgot to comment here.

I ran several real-world test cases on RRS18to6v3 mesh using the standalone MAPS-O with updated weights and tried to increase btr dt from 12 s (default). Both AB2 and forward-backward schemes were stable for 18 s of btr dt, where AB2 uses 75% of the default del 4 coefficient (config_mom_del4=2.4e09) and config_mom_del4_div_factor=4.0. Below figure shows the average and maximum kinetic energy. Both schemes were blown-up when btr dt is larger than 18 s. This result can be different for other high-resolution simulations, but at least 15 seconds seems stable on the RRS18to6 mesh.

image

Copy link
Contributor

@hyungyukang hyungyukang left a comment

Choose a reason for hiding this comment

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

I'm approving this PR based on visual inspection and testing from @dengwirda , @mark-petersen , and @hyungyukang (also in #5989).

@jonbob jonbob added the NML label Nov 20, 2023
jonbob added a commit that referenced this pull request Nov 20, 2023
Update weights for ocean barotropic subcycling in split-explicit solver

This PR updates the weights config_btr_gam1_velWt1,
config_btr_gam2_SSHWt1 in the MPAS-Ocean barotropic solver based on
recent analysis of this scheme. This update applies to "split explicit"
time stepping schemes, i.e. config_time_integrator = 'split_explicit'
and the new config_time_integrator = 'split_explicit_ab2' in #5989. The
new weights allow for a barotropic time step config_btr_dt to be 25%
longer in the tests of EC30to60, thus speeding up the barotropic
subcycling. We expect that values of config_btr_dt can be increased by
25% for all meshes.

[NML]
[non-BFB]
@jonbob
Copy link
Contributor

jonbob commented Nov 20, 2023

passes sanity testing with expected DIFFs -- merged to next

@jonbob jonbob merged commit f9acba6 into E3SM-Project:master Nov 21, 2023
2 checks passed
@jonbob
Copy link
Contributor

jonbob commented Nov 22, 2023

merged to master and expected DIFFs blessed

@mark-petersen mark-petersen deleted the mark-petersen/ocn/btr-weights branch November 28, 2023 20:52
xylar added a commit to xylar/compass that referenced this pull request Dec 3, 2023
This merge updates the E3SM-Project submodule from [894b5b2](https://github.com/E3SM-Project/E3SM/tree/894b5b2) to [5d5f15c](https://github.com/E3SM-Project/E3SM/tree/5d5f15c).

This update includes the following MPAS-Ocean and MPAS-Frameworks PRs (check mark indicates bit-for-bit with previous PR in the list):
- [ ]  (ocn) E3SM-Project/E3SM#5945
- [ ]  (ocn) E3SM-Project/E3SM#5946
- [ ]  (ocn) E3SM-Project/E3SM#5947
- [ ]  (ocn) E3SM-Project/E3SM#5999
- [ ]  (ocn) E3SM-Project/E3SM#6037
- [ ]  (ocn) E3SM-Project/E3SM#5989
- [ ]  (ocn) E3SM-Project/E3SM#6035
- [ ]  (ocn) E3SM-Project/E3SM#6077
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mpas-ocean NML non-BFB PR makes roundoff changes to answers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants