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

Bug in bottom depth in MPAS-Ocean global_ocean init mode #6453

Closed
xylar opened this issue May 31, 2024 · 1 comment · Fixed by #6454
Closed

Bug in bottom depth in MPAS-Ocean global_ocean init mode #6453

xylar opened this issue May 31, 2024 · 1 comment · Fixed by #6454
Assignees
Labels
bug MPAS-Ocean standalone Issues and features for standalone MPAS-Ocean code that dont impact E3SM.

Comments

@xylar
Copy link
Contributor

xylar commented May 31, 2024

A bug was introduced in #6310 in MPAS-Ocean's standalone init mode. In the global_ocean test case, the bottom depth is incorrectly altered, such that all but the shallowest layers have zero layer thickness.

As an example, see:
#6310 (comment)

This appears to be an incorrect change from a max() to a min() operator on this line:

bottomDepth(iCell) = min(bottomDepth(iCell), refBottomDepth(minimum_levels))

@xylar xylar added bug MPAS-Ocean standalone Issues and features for standalone MPAS-Ocean code that dont impact E3SM. labels May 31, 2024
@xylar
Copy link
Contributor Author

xylar commented May 31, 2024

It isn't clear to me why 987126d, the commit that introduced this bug, was necessary. We compute minimum_levels above:

do k = 1, nVertLevels
if (refBottomDepth(k).gt.config_global_ocean_minimum_depth) then
minimum_levels = k
exit
end if
end do

such that refBottomDepth(minimum_levels) is deeper than config_global_ocean_minimum_depth. It seems like the only circumstance where this would not be true is if config_global_ocean_minimum_depth is deeper than the deepest entry in refBottomDepth, and that should indicate that refBottomDepth should have been altered to accommodate the required config_global_ocean_minimum_depth.

Update: I think I may see. It's an issue when you have only one layer and refBottomDepth(1) == config_global_ocean_minimum_depth. Then, minimum_levels doesn't get set at all (which I think is still a problem).

jonbob added a commit that referenced this issue May 31, 2024
… next (PR #6454)

Fix bottom depth deepening in global_ocean init mode

A bug was introduced in #6310 that made the ocean shallower rather than
deeper than the minimum allowed depth. This merge fixes that bug.

Fixes #6453
[BFB] -- mpas-ocean standalone only
@jonbob jonbob closed this as completed in 8939709 Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug MPAS-Ocean standalone Issues and features for standalone MPAS-Ocean code that dont impact E3SM.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants