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.
In ALE mode MOM_diabatic_aux should not advect momentum via diffusion between layers, since momentum is already mixed by MOM_vert_friction. We found that when viscosity is disabled, momentum is still mixed due to diffusivity in this part of the code. Therefore, a flag has been added to disable these lines of codes when in ALE mode.
A simple test case was prepared with constant wind stress forcing and constant viscosity. When the constant viscosity is set into variable Kv, which is accessed by subroutine find_coupling_coef (in MOM_vertical_friction.F90), the resulting current profile matches the analytical solution. However, if the constant viscosity is instead set into variable Kv_turb (accessed in the same subroutine), then the resulting current profile is under mixed. I notice that parameter 'a' (output from find_coupling_coef) is set to 2x Kv and 2x Kvbbl, but for Kv_turb, 'a' is set to (1x) Kv_turb . I believe that this 2 comes from a reorganization of the factor of 2 in the h_shear calculation, since h_shear is equal to twice the level thickness (but shears are computed over one level difference). Since this factor of 2 is missing in setting 'a' from Kv_turb, but it is there when setting from Kv, this explains why using Kv gives the correct solution but using Kv_turb does not. Therefore, a factor of 2 has been introduced when setting 'a' from Kv_turb, and the result now agrees with the analytical solution. The current profile has also been compared using GOTM for redundancy, which agrees with the profile from the analytical solution, using Kv, and using the Kv_turb with the additional factor of 2.