bt_rem_u/v ≡ 1 (the init value). bt_rem_u/v is otherwise reset
only by compute_bt_rem, which only runs when bt_substep_drag
is on. compute_bt_rem_wave_drag MULTIPLIES into bt_rem_u/v,
so when wave drag is on and bt_substep_drag is off, something
must still reset it to 1 each stage — otherwise it compounds
geometrically across outer steps (bt_rem = R^n after n stages),
silently annihilating the barotropic mode. See
src/core/ocean/README.md for the multiplicative-accumulator
contract this establishes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(barotropic_workstate_t), | intent(inout) | :: | bt_work |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | nx | ||||
| integer, | private | :: | ny |
pure subroutine reset_bt_rem(grid, bt_work) !! bt_rem_u/v ≡ 1 (the init value). `bt_rem_u/v` is otherwise reset !! only by `compute_bt_rem`, which only runs when `bt_substep_drag` !! is on. `compute_bt_rem_wave_drag` MULTIPLIES into `bt_rem_u/v`, !! so when wave drag is on and `bt_substep_drag` is off, something !! must still reset it to 1 each stage — otherwise it compounds !! geometrically across outer steps (bt_rem = R^n after n stages), !! silently annihilating the barotropic mode. See !! `src/core/ocean/README.md` for the multiplicative-accumulator !! contract this establishes. type(hgrid_t), intent(in) :: grid type(barotropic_workstate_t), intent(inout) :: bt_work integer :: i, j, nx, ny nx = grid%nx_total ny = grid%ny_total do concurrent(j=1:ny, i=1:nx + 1) bt_work%bt_rem_u(i, j) = 1.0_wp end do do concurrent(j=1:ny + 1, i=1:nx) bt_work%bt_rem_v(i, j) = 1.0_wp end do end subroutine reset_bt_rem