Skip to content

Commit

Permalink
Revert the change from VISC_REM_CONT_VEL_FIX
Browse files Browse the repository at this point in the history
This particular bugfix was proved to be unnecessary and therefore
incorrectly added. Runtime parameter VISC_REM_BUG now controls two
bugfixes, related to RK2 time stepping and barotropic vertical weight,
which are valid.
  • Loading branch information
herrwang0 authored and adcroft committed Nov 5, 2024
1 parent a6d27cf commit 76915ff
Showing 1 changed file with 10 additions and 39 deletions.
49 changes: 10 additions & 39 deletions src/core/MOM_continuity_PPM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ module MOM_continuity_PPM
!! continuity solver for use as the weights in the
!! barotropic solver. Otherwise use the transport
!! averaged areas.
logical :: visc_rem_hvel_fix = .False. !< If true, thickness at velocity points
!! h_[uv] (used by barotropic solver) is not multiplied
!! by visc_rem_[uv].
end type continuity_PPM_CS

!> A container for loop bounds
Expand Down Expand Up @@ -809,22 +806,12 @@ subroutine zonal_mass_flux(u, h_in, h_W, h_E, uh, dt, G, GV, US, CS, OBC, por_fa
endif

if (set_BT_cont) then ; if (allocated(BT_cont%h_u)) then
if (CS%visc_rem_hvel_fix) then
if (present(u_cor)) then
call zonal_flux_thickness(u_cor, h_in, h_W, h_E, BT_cont%h_u, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaU)
else
call zonal_flux_thickness(u, h_in, h_W, h_E, BT_cont%h_u, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaU)
endif
if (present(u_cor)) then
call zonal_flux_thickness(u_cor, h_in, h_W, h_E, BT_cont%h_u, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaU, visc_rem_u)
else
if (present(u_cor)) then
call zonal_flux_thickness(u_cor, h_in, h_W, h_E, BT_cont%h_u, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaU, visc_rem_u)
else
call zonal_flux_thickness(u, h_in, h_W, h_E, BT_cont%h_u, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaU, visc_rem_u)
endif
call zonal_flux_thickness(u, h_in, h_W, h_E, BT_cont%h_u, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaU, visc_rem_u)
endif
endif ; endif

Expand Down Expand Up @@ -1709,22 +1696,12 @@ subroutine meridional_mass_flux(v, h_in, h_S, h_N, vh, dt, G, GV, US, CS, OBC, p
endif

if (set_BT_cont) then ; if (allocated(BT_cont%h_v)) then
if (CS%visc_rem_hvel_fix) then
if (present(v_cor)) then
call meridional_flux_thickness(v_cor, h_in, h_S, h_N, BT_cont%h_v, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaV)
else
call meridional_flux_thickness(v, h_in, h_S, h_N, BT_cont%h_v, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaV)
endif
if (present(v_cor)) then
call meridional_flux_thickness(v_cor, h_in, h_S, h_N, BT_cont%h_v, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaV, visc_rem_v)
else
if (present(v_cor)) then
call meridional_flux_thickness(v_cor, h_in, h_S, h_N, BT_cont%h_v, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaV, visc_rem_v)
else
call meridional_flux_thickness(v, h_in, h_S, h_N, BT_cont%h_v, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaV, visc_rem_v)
endif
call meridional_flux_thickness(v, h_in, h_S, h_N, BT_cont%h_v, dt, G, GV, US, LB, &
CS%vol_CFL, CS%marginal_faces, OBC, por_face_areaV, visc_rem_v)
endif
endif ; endif

Expand Down Expand Up @@ -2713,7 +2690,6 @@ subroutine continuity_PPM_init(Time, G, GV, US, param_file, diag, CS)
!> This include declares and sets the variable "version".
# include "version_variable.h"
character(len=40) :: mdl = "MOM_continuity_PPM" ! This module's name.
logical :: visc_rem_bug ! Stores the value of runtime paramter VISC_REM_BUG.

CS%initialized = .true.

Expand Down Expand Up @@ -2774,11 +2750,6 @@ subroutine continuity_PPM_init(Time, G, GV, US, param_file, diag, CS)
"If true, use the marginal face areas from the continuity "//&
"solver for use as the weights in the barotropic solver. "//&
"Otherwise use the transport averaged areas.", default=.true.)
call get_param(param_file, mdl, "VISC_REM_BUG", visc_rem_bug, default=.true., do_not_log=.true.)
call get_param(param_file, mdl, "VISC_REM_CONT_HVEL_FIX", CS%visc_rem_hvel_fix, &
"If true, velocity cell thickness h_[uv] from the continuity solver "//&
"is not multiplied by visc_rem_[uv]. Default of this flag is set by "//&
"VISC_REM_BUG.", default=.False.) !, default=.not.visc_rem_bug)
CS%diag => diag

id_clock_reconstruct = cpu_clock_id('(Ocean continuity reconstruction)', grain=CLOCK_ROUTINE)
Expand Down

0 comments on commit 76915ff

Please sign in to comment.