Skip to content

Bugfix on total column thickness for wetting#975

Merged
Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
herrwang0:bugfix-zref-thickness
Dec 3, 2025
Merged

Bugfix on total column thickness for wetting#975
Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
herrwang0:bugfix-zref-thickness

Conversation

@herrwang0
Copy link
Copy Markdown

@herrwang0 herrwang0 commented Sep 25, 2025

In a number of cases, total resting column thickness is calucated as G%bathyT + G%z_ref, which is largely correct but for wetting, i.e. G%bathyT + G%z_ref < 0. This commit makes a correction for seven cases with this potential bug.

List of modules/processes affected:

  • MOM_barotropic
    • affects only surface stress when BT_NONLIN_STRESS is False.
  • MOM_wave_speed
  • h2 calculations in
    • subroutine internal_tides_init
    • subroutine int_tide_input_int
    • subroutine tidal_mixing_init
  • MOM_lateral_mixing_coeffs
  • MOM_MEKE

There is no answer changes if no wetting points are used and G%Z_ref is zero.

@herrwang0 herrwang0 force-pushed the bugfix-zref-thickness branch from 53d92c3 to 61039e2 Compare September 25, 2025 16:22
@herrwang0 herrwang0 added the bug Something isn't working label Sep 25, 2025
Copy link
Copy Markdown
Member

@adcroft adcroft left a comment

Choose a reason for hiding this comment

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

These fixes make sense to me. I have just one suggest about a re-calculation in the barotropic solver. I've not tested yet...

Comment thread src/core/MOM_barotropic.F90 Outdated
Comment thread src/core/MOM_barotropic.F90 Outdated
@herrwang0 herrwang0 force-pushed the bugfix-zref-thickness branch from 61039e2 to a67ff8e Compare October 1, 2025 16:37
@Hallberg-NOAA Hallberg-NOAA added enhancement New feature or request answer-changing A change in results (actual or potential) labels Nov 17, 2025
Comment thread src/parameterizations/vertical/MOM_set_viscosity.F90
Comment thread src/tracer/MOM_tracer_Z_init.F90
Copy link
Copy Markdown
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

These changes should avoid encountering nonsensical values (e.g., NaNs or negative total thicknesses) when unmasked points have topography above the mean sea-level. Moreover all of the altered blocks of code have runtime options that could avoid their use. It may be worthwhile revisiting these spots in the code later to see whether a better solution is available, but for now these changes do correct some obvious problems with the code.

In a number of cases, total resting column thickness is calucated as
G%bathyT + G%Z_ref, which is largely correct but for wetting, i.e.
G%bathyT < 0. This commit makes a correction for seven cases with this
potential bug.

There is no answer changes if no wetting points are used and G%Z_ref is
zero.

List of modules/processes affected:
* MOM_barotropic
    * affects only surface stress when BT_NONLIN_STRESS is False.
* MOM_wave_speed
* h2 calculations in
    * subroutine internal_tides_init
    * subroutine int_tide_input_int
    * subroutine tidal_mixing_init
* MOM_lateral_mixing_coeffs
* MOM_MEKE
@Hallberg-NOAA
Copy link
Copy Markdown
Member

This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/29417.

@Hallberg-NOAA Hallberg-NOAA merged commit ba6032b into NOAA-GFDL:dev/gfdl Dec 3, 2025
52 checks passed
Hallberg-NOAA added a commit that referenced this pull request Dec 9, 2025
  The CHANNEL_DRAG option was using a harmonic mean to interpolate adjacent
bottom depths at velocity points to vorticity points.  However, this is not well
behaved when the bottom depth is negative (i.e., above sea level), as was noted
as a part of PR #975. This commit adds the new runtime parameter
CHANNEL_DRAG_SHELFBREAK_DEPTH to set a depth below which a harmonic mean bottom
depth is still used to mimic a continental shelfbreak profile, but above which a
simple arithmetic mean is used to interpolate bathymetry to vorticity points for
use with CHANNEL_DRAG. The expressions vary continuously with depth and avoid
the previous problems with division by zero or a badly formed harmonic mean.  By
default, all answers are bitwise identical in any cases that worked previously,
but cases with oceans (or Great Lakes) in basins with bottoms that are above
sea-level should now work sensibly when CHANNEL_DRAG is enabled.  There is a new
runtime parameter in some cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

answer-changing A change in results (actual or potential) bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants