Skip to content

Commit

Permalink
Add bug fix for u_int in radiation OBC
Browse files Browse the repository at this point in the history
Add an option to use the correct velocity (u_av) in the radation
OBC calculation in RK2.
  • Loading branch information
Theresa Morrison authored and Theresa Morrison committed May 20, 2024
1 parent 6272bbc commit 6b6c1a0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ module MOM_dynamics_split_RK2
!! nullified. Flather OBCs use open boundary_CS as well.
!> A pointer to the update_OBC control structure
type(update_OBC_CS), pointer :: update_OBC_CSp => NULL()
logical :: use_obc_uinst_bug !< If true, use a bug in the radiation OBC's (ex
!! Orlanski) where the instantaneous velocity is used rather than the
!! time-averaged velocity.

type(group_pass_type) :: pass_eta !< Structure for group halo pass
type(group_pass_type) :: pass_visc_rem !< Structure for group halo pass
Expand Down Expand Up @@ -1015,7 +1018,7 @@ subroutine step_MOM_dyn_split_RK2(u_inst, v_inst, h, tv, visc, Time_local, dt, f
call do_group_pass(CS%pass_av_uvh, G%domain, clock=id_clock_pass)
endif

if (associated(CS%OBC)) then
if (associated(CS%OBC) .and. CS%use_obc_uinst_bug) then
!### I suspect that there is a bug here when u_inst is compared with a previous value of u_av
! to estimate the dominant outward group velocity, but a fix is not available yet.
call radiation_open_bdry_conds(CS%OBC, u_inst, u_old_rad_OBC, v_inst, v_old_rad_OBC, G, GV, US, dt)
Expand All @@ -1030,6 +1033,10 @@ subroutine step_MOM_dyn_split_RK2(u_inst, v_inst, h, tv, visc, Time_local, dt, f
if (G%nonblocking_updates) &
call complete_group_pass(CS%pass_av_uvh, G%Domain, clock=id_clock_pass)

if (associated(CS%OBC) .and. .not.CS%use_obc_uinst_bug) then
call radiation_open_bdry_conds(CS%OBC, u_av, u_old_rad_OBC, v_av, v_old_rad_OBC, G, GV, US, dt)
endif

!$OMP parallel do default(shared)
do k=1,nz
do j=js-2,je+2 ; do I=Isq-2,Ieq+2
Expand Down Expand Up @@ -1413,6 +1420,10 @@ subroutine initialize_dyn_split_RK2(u, v, h, tv, uh, vh, eta, Time, G, GV, US, p
"variables that are needed to reproduce across restarts, similarly to "//&
"what is already being done with the primary state variables. "//&
"The default should be changed to true.", default=.false., do_not_log=.true.)
call get_param(param_file, mdl, "USE_OBC_U_INST_BUG", CS%use_obc_uinst_bug, &
"If true, use a bug in the update of the radiation open boundary conditions"//&
"that uses the instantaneous velocity rather than the time-averaged velocity.",&
default=.true.)
if (CS%remap_aux .and. .not.CS%store_CAu) call MOM_error(FATAL, &
"REMAP_AUXILIARY_VARS requires that STORE_CORIOLIS_ACCEL = True.")
call get_param(param_file, mdl, "DEBUG", CS%debug, &
Expand Down

0 comments on commit 6b6c1a0

Please sign in to comment.