@@ -128,9 +128,9 @@ function register_Kelvin_OBC(param_file, CS, US, OBC_Reg)
128
128
call register_OBC(casename, param_file, OBC_Reg)
129
129
register_Kelvin_OBC = .true.
130
130
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." )
133
131
! 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.
134
134
135
135
end function register_Kelvin_OBC
136
136
@@ -212,7 +212,7 @@ subroutine Kelvin_set_OBC_data(OBC, CS, G, GV, US, h, Time)
212
212
real :: PI ! The ratio of the circumference of a circle to its diameter [nondim]
213
213
real :: depth_tot(SZI_(G),SZJ_(G)) ! The total depth of the ocean [Z ~> m]
214
214
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 ]
216
216
real :: x1, y1 ! Various positions [L ~> m]
217
217
real :: x, y ! Various positions [L ~> m]
218
218
real :: val1 ! The periodicity factor [nondim]
@@ -247,14 +247,11 @@ subroutine Kelvin_set_OBC_data(OBC, CS, G, GV, US, h, Time)
247
247
omega = 2.0 * PI / CS% wave_period
248
248
val1 = sin (omega * time_sec)
249
249
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
253
251
N0 = sqrt ((CS% rho_range / CS% rho_0) * (GV% g_Earth / CS% H0))
254
252
lambda = PI * CS% mode * CS% F_0 / (CS% H0 * N0)
255
253
! 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))
258
255
! If the modal wave speed were calculated via wave_speeds(), we should have
259
256
! lambda = CS%F_0 / CS%cg_mode
260
257
! 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)
312
309
! in MOM_wave_speed() based on the horizontally uniform initial state.
313
310
if (segment% nudged) then
314
311
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 * &
319
313
exp (- lambda * y) * cos (PI * CS% mode * (k - 0.5 ) / nz) * &
320
314
cos (omega * time_sec)
321
315
enddo
322
316
elseif (segment% specified) then
323
317
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 * &
325
319
exp (- lambda * y) * cos (PI * CS% mode * (k - 0.5 ) / nz) * &
326
320
cos (omega * time_sec)
327
321
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)
373
367
segment% normal_vel_bt(i,J) = 0.0
374
368
if (segment% nudged) then
375
369
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 * &
377
371
exp (- lambda * y) * cos (PI * CS% mode * (k - 0.5 ) / nz) * cosa
378
372
enddo
379
373
elseif (segment% specified) then
380
374
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 * &
382
376
exp (- lambda * y) * cos (PI * CS% mode * (k - 0.5 ) / nz) * cosa
383
377
segment% normal_trans(i,J,k) = segment% normal_vel(i,J,k) * h(i,j+1 ,k) * G% dxCv(i,J)
384
378
enddo
0 commit comments