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

*+Make Leith viscosity runs layout-invariant #286

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

Hallberg-NOAA
Copy link

Added the new function hor_visc_vel_stencil() to return the velocity stencil of the velocity fields used by horizontal_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 to horizontal_viscosity(). Also adjusted the size of the loops used to set up DX_dyBu and DY_dxBu in the hor_visc control structure depending on the horizontal viscosity options and added a test in hor_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.

  Added the new function hor_visc_vel_stencil to return the velocity stencil of
the velocity fields used by horizontal_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 to horizontal_viscosity.  Also adjusted the size of
the loops used to set up DX_dyBu and DY_dxBu in the hor_visc control structure
depending on the horizontal viscosity options and added a test in hor_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.
@alperaltuntas
Copy link
Member

I've confirmed that, with these changes, NCAR configuration leads to bitwise identical results when run with the standalone driver. With the CESM NUOPC driver, however, the results are different across different PE layouts due to the way ESMF online mapping works.

@alperaltuntas alperaltuntas merged commit 99edf23 into NCAR:dev/ncar Jul 16, 2024
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants