Skip to content

Conversation

herrwang0
Copy link

@herrwang0 herrwang0 commented Sep 23, 2025

This PR contains three commits:

6bb5b63 some safeguards are added when lin_drag_[uv] is applied in barotropic solver, in order to avoid an unusual case that allows Rayleigh_[uv] divided by zero

64e4f75 the warning message regarding negative mass (eta) in non-Boussinesq mode is limited to wet points only.

e33d3af when debug is true, the order of calculating acceleration and velocity checksums are inverted, so that acceleration information can be printed if there is NaN in velocity.

This PR does not change answers.

@herrwang0 herrwang0 added the bug Something isn't working label Sep 23, 2025
* Linear wave drag is limited to be only applied to land points, using
velocity point masks mask2dC[uv].

* Rayleigh_[uv] calculation and bt_rem_[uv] update from linear wave drag
 is limited for Htot>0 only.

This patch eliminates potential NaN in Rayleigh_[uv] in an unusual
scenario that Htot==0.0 and lin_drag_[uv]/=0. The changes do not change
answers: bt_rem_[uv] is zero at land points regardless. Rayleigh_[uv]
is added to [uv]_accel_bt which is masked before updating velocity.
In MOM_barotropic and non-Boussinesq mode, warning message on negative
eta is now only issued at wet points, consistently with Boussinesq.
In MOM_dynamics_split_RK2, now accleration chksum is printed before
velocity with debug on, so that we could know which accleration term is
responsible for a NaN in velocity.
@herrwang0 herrwang0 force-pushed the bugfix-bt-wavedrag-mask branch from e33d3af to 665d547 Compare September 23, 2025 19:40
Copy link
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 proposed changes are now well explained and make sense to me.

@Hallberg-NOAA
Copy link
Member

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

@Hallberg-NOAA Hallberg-NOAA merged commit 665c760 into NOAA-GFDL:dev/gfdl Sep 24, 2025
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants