Skip to content

Commit 6b6c1a0

Browse files
Theresa MorrisonTheresa Morrison
Theresa Morrison
authored and
Theresa Morrison
committed
Add bug fix for u_int in radiation OBC
Add an option to use the correct velocity (u_av) in the radation OBC calculation in RK2.
1 parent 6272bbc commit 6b6c1a0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/core/MOM_dynamics_split_RK2.F90

+12-1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ module MOM_dynamics_split_RK2
255255
!! nullified. Flather OBCs use open boundary_CS as well.
256256
!> A pointer to the update_OBC control structure
257257
type(update_OBC_CS), pointer :: update_OBC_CSp => NULL()
258+
logical :: use_obc_uinst_bug !< If true, use a bug in the radiation OBC's (ex
259+
!! Orlanski) where the instantaneous velocity is used rather than the
260+
!! time-averaged velocity.
258261

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

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

1036+
if (associated(CS%OBC) .and. .not.CS%use_obc_uinst_bug) then
1037+
call radiation_open_bdry_conds(CS%OBC, u_av, u_old_rad_OBC, v_av, v_old_rad_OBC, G, GV, US, dt)
1038+
endif
1039+
10331040
!$OMP parallel do default(shared)
10341041
do k=1,nz
10351042
do j=js-2,je+2 ; do I=Isq-2,Ieq+2
@@ -1413,6 +1420,10 @@ subroutine initialize_dyn_split_RK2(u, v, h, tv, uh, vh, eta, Time, G, GV, US, p
14131420
"variables that are needed to reproduce across restarts, similarly to "//&
14141421
"what is already being done with the primary state variables. "//&
14151422
"The default should be changed to true.", default=.false., do_not_log=.true.)
1423+
call get_param(param_file, mdl, "USE_OBC_U_INST_BUG", CS%use_obc_uinst_bug, &
1424+
"If true, use a bug in the update of the radiation open boundary conditions"//&
1425+
"that uses the instantaneous velocity rather than the time-averaged velocity.",&
1426+
default=.true.)
14161427
if (CS%remap_aux .and. .not.CS%store_CAu) call MOM_error(FATAL, &
14171428
"REMAP_AUXILIARY_VARS requires that STORE_CORIOLIS_ACCEL = True.")
14181429
call get_param(param_file, mdl, "DEBUG", CS%debug, &

0 commit comments

Comments
 (0)