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

Enhance shared convergence steps #131

Merged
merged 17 commits into from
Oct 10, 2023

Conversation

cbegeman
Copy link
Collaborator

@cbegeman cbegeman commented Oct 6, 2023

This PR makes it possible for all convergence tests to leverage shared convergence steps and implements those shared convergence steps in all convergence tests.

The general approach is that spherical test cases will invoke SphericalConvergenceForward, which descends from ConvergenceForward, and ConvergenceAnalysis and that planar test cases will invoke ConvergenceForward and ConvergenceAnalysis.

The config options are moved into convergence and convergence_forward and only the default resolutions remain in spherical_convergence_forward.

Checklist

  • User's Guide has been updated
  • Developer's Guide has been updated
  • API documentation in the Developer's Guide (api.md) has any new or modified class, method and/or functions listed
  • Documentation has been built locally and changes look as expected
  • Testing comment in the PR documents testing used to verify the changes
  • New tests have been added to a test suite

@cbegeman
Copy link
Collaborator Author

cbegeman commented Oct 6, 2023

Testing

I have run the following convergence tests on chrys with intel, openmpi:

  • ocean/spherical/icos/cosine_bell
  • ocean/planar/inertial_gravity_wave
  • ocean/planar/manufactured_solution

I reran the convergence tests on perlmutter with gnu, mpich.

@cbegeman
Copy link
Collaborator Author

cbegeman commented Oct 6, 2023

@xylar Can you take a look at this when you have a chance and let me know if you are on board with these changes before I write up the documentation?

@cbegeman cbegeman force-pushed the ocn-enhance-convergence-analysis branch from f8f7d67 to 9f86ada Compare October 6, 2023 21:15
Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

This is brilliant! Definitely a good demonstration of the shared-framework philosophy behind Polaris.

I have a few finicky suggestions but the approach looks excellent to me.

polaris/ocean/convergence/analysis.py Outdated Show resolved Hide resolved
polaris/ocean/convergence/spherical/forward.py Outdated Show resolved Hide resolved
polaris/ocean/convergence/forward.py Outdated Show resolved Hide resolved
polaris/ocean/convergence/forward.py Outdated Show resolved Hide resolved
polaris/ocean/convergence/forward.py Outdated Show resolved Hide resolved
polaris/ocean/tasks/manufactured_solution/init.py Outdated Show resolved Hide resolved
polaris/ocean/tasks/manufactured_solution/init.py Outdated Show resolved Hide resolved
polaris/ocean/tasks/inertial_gravity_wave/init.py Outdated Show resolved Hide resolved
polaris/ocean/tasks/inertial_gravity_wave/viz.py Outdated Show resolved Hide resolved
@cbegeman
Copy link
Collaborator Author

cbegeman commented Oct 8, 2023

@xylar Thanks for the detailed review! I'm on board with all the changes. I'll make them and retest this week.

@cbegeman cbegeman force-pushed the ocn-enhance-convergence-analysis branch from 5ca6bad to 2de2873 Compare October 9, 2023 15:14
@cbegeman cbegeman force-pushed the ocn-enhance-convergence-analysis branch from c37a404 to c5a60df Compare October 9, 2023 20:35
@cbegeman cbegeman self-assigned this Oct 9, 2023
@cbegeman cbegeman added enhancement New feature or request framework Changes relating to the polaris framework as opposed to individual tests or analysis ocean Related to ocean tests or analysis labels Oct 9, 2023
@cbegeman cbegeman marked this pull request as ready for review October 9, 2023 20:39
@cbegeman cbegeman force-pushed the ocn-enhance-convergence-analysis branch from c5a60df to d1885f9 Compare October 9, 2023 22:02
@cbegeman
Copy link
Collaborator Author

cbegeman commented Oct 9, 2023

@xylar This is ready for your (re)review. I also added a convergence suite which is convenient for testing changes to the convergence steps.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

I ran the convergence suite and compared with a baseline from main on Chrysalis. The cosine bell tests are BFB with their counterparts from the cosine_bell_cached_init suite from main. Baseline comparison fails for the planar convergence tests because the number of time slices in the output has changed (from 31 to 2). Since I didn't see an easy way to work around this and the convergence rates look as expected, I didn't pursue this further.

polaris/ocean/convergence/analysis.py Outdated Show resolved Hide resolved
polaris/ocean/tasks/cosine_bell/analysis.py Show resolved Hide resolved
@xylar
Copy link
Collaborator

xylar commented Oct 10, 2023

@cbegeman, if you want to either clarify or remove the print statement I flagged above, I think that's the last thing needed before this can be merged.

@cbegeman cbegeman force-pushed the ocn-enhance-convergence-analysis branch from 3a8c0e1 to 7664324 Compare October 10, 2023 14:17
@cbegeman
Copy link
Collaborator Author

@xylar Thank you for your review! I removed the print statement and will merge once the checks are finished.

@cbegeman cbegeman merged commit df86670 into E3SM-Project:main Oct 10, 2023
5 checks passed
@xylar xylar deleted the ocn-enhance-convergence-analysis branch October 11, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request framework Changes relating to the polaris framework as opposed to individual tests or analysis ocean Related to ocean tests or analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants