@@ -128,9 +128,9 @@ function register_Kelvin_OBC(param_file, CS, US, OBC_Reg)
128128 call register_OBC(casename, param_file, OBC_Reg)
129129 register_Kelvin_OBC = .true.
130130
131- if (CS% mode > 0 ) call MOM_error(WARNING, &
132- " register_Kelvin_OBC: The Kelvin_initialization code is not yet working properly unless KELVIN_WAVE_MODE = 0." )
133131 ! TODO: Revisit and correct the internal Kelvin wave test case.
132+ ! Specifically, using wave_speed() and investigating adding eta_anom
133+ ! noted in the comments below.
134134
135135end function register_Kelvin_OBC
136136
@@ -212,7 +212,7 @@ subroutine Kelvin_set_OBC_data(OBC, CS, G, GV, US, h, Time)
212212 real :: PI ! The ratio of the circumference of a circle to its diameter [nondim]
213213 real :: depth_tot(SZI_(G),SZJ_(G)) ! The total depth of the ocean [Z ~> m]
214214 real :: mag_SSH ! An overall magnitude of the external wave sea surface height at the coastline [Z ~> m]
215- real :: mag_int ! An overall magnitude of the internal wave at the coastline [L2 T-2 ~> m2 s-2 ]
215+ real :: mag_int ! An overall magnitude of the internal wave at the coastline [L T-1 ~> m s-1 ]
216216 real :: x1, y1 ! Various positions [L ~> m]
217217 real :: x, y ! Various positions [L ~> m]
218218 real :: val1 ! The periodicity factor [nondim]
@@ -247,14 +247,11 @@ subroutine Kelvin_set_OBC_data(OBC, CS, G, GV, US, h, Time)
247247 omega = 2.0 * PI / CS% wave_period
248248 val1 = sin (omega * time_sec)
249249 else
250- ! This is supposed to be a linear internal Kelvin wave case, so I do not understand the purpose
251- ! of the squared velocity here. -RWH
252- mag_int = CS% inflow_amp** 2
250+ mag_int = CS% inflow_amp
253251 N0 = sqrt ((CS% rho_range / CS% rho_0) * (GV% g_Earth / CS% H0))
254252 lambda = PI * CS% mode * CS% F_0 / (CS% H0 * N0)
255253 ! Two wavelengths in domain
256- ! The reason for the factor of 0.001 is unclear, but it is needed to recreate the previous answers. -RWH
257- omega = (4.0 * CS% H0 * N0) / (CS% mode * (0.001 * G% grid_unit_to_L)* G% len_lon)
254+ omega = (4.0 * CS% H0 * N0) / (CS% mode * (G% grid_unit_to_L* G% len_lon))
258255 ! If the modal wave speed were calculated via wave_speeds(), we should have
259256 ! lambda = CS%F_0 / CS%cg_mode
260257 ! omega = (4.0 * PI / (G%grid_unit_to_L*G%len_lon)) * CS%cg_mode
@@ -312,16 +309,13 @@ subroutine Kelvin_set_OBC_data(OBC, CS, G, GV, US, h, Time)
312309 ! in MOM_wave_speed() based on the horizontally uniform initial state.
313310 if (segment% nudged) then
314311 do k= 1 ,nz
315- ! Note that mag_int is the square of the specified inflow amplitude, in [L2 T-2 ~> m2 s-2].
316- ! The following expression is dimensionally correct, but I do not understand why the
317- ! normal velocities should scale with the square of their amplitude. -RWH
318- segment% nudged_normal_vel(I,j,k) = mag_int * lambda / CS% F_0 * &
312+ segment% nudged_normal_vel(I,j,k) = mag_int * &
319313 exp (- lambda * y) * cos (PI * CS% mode * (k - 0.5 ) / nz) * &
320314 cos (omega * time_sec)
321315 enddo
322316 elseif (segment% specified) then
323317 do k= 1 ,nz
324- segment% normal_vel(I,j,k) = mag_int * lambda / CS % F_0 * &
318+ segment% normal_vel(I,j,k) = mag_int * &
325319 exp (- lambda * y) * cos (PI * CS% mode * (k - 0.5 ) / nz) * &
326320 cos (omega * time_sec)
327321 segment% normal_trans(I,j,k) = segment% normal_vel(I,j,k) * h(i+1 ,j,k) * G% dyCu(I,j)
@@ -373,12 +367,12 @@ subroutine Kelvin_set_OBC_data(OBC, CS, G, GV, US, h, Time)
373367 segment% normal_vel_bt(i,J) = 0.0
374368 if (segment% nudged) then
375369 do k= 1 ,nz
376- segment% nudged_normal_vel(i,J,k) = mag_int * lambda / CS % F_0 * &
370+ segment% nudged_normal_vel(i,J,k) = mag_int * &
377371 exp (- lambda * y) * cos (PI * CS% mode * (k - 0.5 ) / nz) * cosa
378372 enddo
379373 elseif (segment% specified) then
380374 do k= 1 ,nz
381- segment% normal_vel(i,J,k) = mag_int * lambda / CS % F_0 * &
375+ segment% normal_vel(i,J,k) = mag_int * &
382376 exp (- lambda * y) * cos (PI * CS% mode * (k - 0.5 ) / nz) * cosa
383377 segment% normal_trans(i,J,k) = segment% normal_vel(i,J,k) * h(i,j+1 ,k) * G% dxCv(i,J)
384378 enddo
0 commit comments