mom-ocean / MOM6

Modular Ocean Model
Other
185 stars 230 forks source link

Scalar SAL sign incorrect in barotropic solver #1496

Closed herrwang0 closed 1 year ago

herrwang0 commented 3 years ago

A sign related to the scalar approximation the self-attraction and loading (SAL) term is incorrect in the barotropic solver.

https://github.com/NOAA-GFDL/MOM6/blob/b560b2ccb65280a5f78b47ef1f01123d434e529e/src/core/MOM_barotropic.F90#L1047-L1052

The third line in the block above should be

   dgeo_de = 1.0 - det_de + CS%G_extra 

The bug only impacts cases

  1. in split mode
  2. TIDES is turned on.
  3. USE_SAL_SCALAR and/or USE_PREV_TIDES is true.

The proposed correction will be answer changing for these cases.


Justification:

Derivation

  1. eta{tidal} = eta{eq} + eta_{sal} https://github.com/NOAA-GFDL/MOM6/blob/b560b2ccb65280a5f78b47ef1f01123d434e529e/src/parameterizations/lateral/MOM_tidal_forcing.F90#L620 https://github.com/NOAA-GFDL/MOM6/blob/b560b2ccb65280a5f78b47ef1f01123d434e529e/src/parameterizations/lateral/MOM_tidal_forcing.F90#L630 https://github.com/NOAA-GFDL/MOM6/blob/b560b2ccb65280a5f78b47ef1f01123d434e529e/src/parameterizations/lateral/MOM_tidal_forcing.F90#L641-L642

  2. In the scalar approximation, eta{sal} = beta * eta, where eta is the sea surface height. Therefore, d(eta{tidal})/d(eta) = + SAL_SCALAR, which is the output of subroutine tidal_forcing_sensitivity: https://github.com/NOAA-GFDL/MOM6/blob/b560b2ccb65280a5f78b47ef1f01123d434e529e/src/parameterizations/lateral/MOM_tidal_forcing.F90#L567-L573

  3. As du/dt ~ -grad(eta - eta{tidal}), eta{tidal} is subtracted from eta. For example: https://github.com/NOAA-GFDL/MOM6/blob/b560b2ccb65280a5f78b47ef1f01123d434e529e/src/core/MOM_PressureForce_FV.F90#L581

  4. d(geo)/d(eta) = d(eta - eta_{tidal})/deta = 1 - d(eta_tidal)/d(eta) = 1 - SAL_SCALAR

Example

The bug results in an incorrect sensitivity of the tidal error to the baroclinic time step size (see figure). This sensitivity is not seen with the fixed code and non-split mode.

Screen Shot 2021-09-04 at 11 51 24 AM
Hallberg-NOAA commented 1 year ago

The fix to this bug was made the default option on the main branch of MOM6 as a part of PR #1586, so it can now be closed.