*+Make Leith viscosity runs layout-invariant #286
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the new function
hor_visc_vel_stencil()
to return the velocity stencil of the velocity fields used byhorizontal_viscosity()
depending on the options that are in use, and then use this information in the group_pass calls for the velocities that are passed tohorizontal_viscosity()
. Also adjusted the size of the loops used to set upDX_dyBu
andDY_dxBu
in the hor_visc control structure depending on the horizontal viscosity options and added a test inhor_visc_init()
for a large enough halo size for the options that are in use. Both of these answer-changing modifications are necessary for MOM6 to reproduce across PE count and layout) when Leith viscosity parameterizations are in use.The MOM_hor_visc code was also revised slightly in several places to more closely adhere to MOM6 style with respect to using a 2-point indent and similar purely cosmetic considerations.
This commit does change answers when a Leith viscosity is in use, and adds a new publicly visible function. Answers are bitwise identical when a Leith viscosity is not being used.