32 implicit none ;
private 34 #include <MOM_memory.h> 36 character(len=40) ::
mdl =
"shelfwave_initialization" 64 logical :: register_shelfwave_OBC
66 real :: kk, ll, PI, len_lat
68 character(len=32) :: casename =
"shelfwave" 72 if (
associated(cs))
then 73 call mom_error(warning,
"register_shelfwave_OBC called with an "// &
74 "associated control structure.")
80 call register_obc(casename, param_file, obc_reg)
85 call get_param(param_file,
mdl,
"SHELFWAVE_X_WAVELENGTH",cs%Lx, &
86 "Length scale of shelfwave in x-direction.",&
87 units=
"Same as x,y", default=100.)
88 call get_param(param_file,
mdl,
"SHELFWAVE_Y_LENGTH_SCALE",cs%Ly, &
89 "Length scale of exponential dropoff of topography\n"//&
90 "in the y-direction.", &
91 units=
"Same as x,y", default=50.)
92 call get_param(param_file,
mdl,
"SHELFWAVE_Y_MODE",cs%jj, &
93 "Cross-shore wave mode.", &
94 units=
"nondim", default=1.)
96 cs%ll = 2. * pi / cs%Lx
97 cs%kk = cs%jj * pi / len_lat
98 cs%omega = 2 * cs%alpha * cs%f0 * cs%ll / &
99 (cs%kk*cs%kk + cs%alpha*cs%alpha + cs%ll*cs%ll)
100 register_shelfwave_obc = .true.
108 if (
associated(cs))
then 117 real,
dimension(G%isd:G%ied,G%jsd:G%jed), &
120 real,
intent(in) :: max_depth
124 real :: y, rLy, Ly, H0
126 call get_param(param_file,
mdl,
"SHELFWAVE_Y_LENGTH_SCALE",ly, &
127 default=50., do_not_log=.true.)
129 default=10., do_not_log=.true.)
131 rly = 0. ;
if (ly>0.) rly = 1. / ly
135 y = ( g%geoLatT(i,j) - g%south_lat )
136 d(i,j) = h0 * exp(2 * rly * y)
149 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
150 type(time_type),
intent(in) :: Time
153 real :: my_amp, time_sec
154 real :: cos_wt, cos_ky, sin_wt, sin_ky, omega, alpha
155 real :: x, y, jj, kk, ll
156 character(len=40) :: mdl =
"shelfwave_set_OBC_data" 157 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, n
158 integer :: IsdB, IedB, JsdB, JedB
161 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
162 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
163 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
165 if (.not.
associated(obc))
return 167 time_sec = time_type_to_real(time)
174 do n = 1, obc%number_of_segments
175 segment => obc%segment(n)
176 if (.not. segment%on_pe) cycle
177 if (segment%direction /= obc_direction_w) cycle
179 isdb = segment%HI%IsdB ; iedb = segment%HI%IedB
180 jsd = segment%HI%jsd ; jed = segment%HI%jed
181 do j=jsd,jed ;
do i=isdb,iedb
182 x = g%geoLonCu(i,j) - g%west_lon
183 y = g%geoLatCu(i,j) - g%south_lat
184 sin_wt = sin(ll*x - omega*time_sec)
185 cos_wt = cos(ll*x - omega*time_sec)
188 segment%normal_vel_bt(i,j) = my_amp * exp(- alpha * y) * cos_wt * &
189 (alpha * sin_ky + kk * cos_ky)
integer, parameter, public obc_direction_w
Indicates the boundary is an effective western boundary.
subroutine, public shelfwave_obc_end(CS)
Clean up the shelfwave OBC from registry.
Ocean grid type. See mom_grid for details.
Provides the ocean grid type.
Open boundary segment data structure.
subroutine, public register_obc(name, param_file, Reg)
register open boundary objects for boundary updates.
subroutine, public shelfwave_set_obc_data(OBC, CS, G, h, Time)
This subroutine sets the properties of flow at open boundary conditions.
The module configures the model for the idealized shelfwave test case.
Type to carry basic OBC information needed for updating values.
logical function, public is_root_pe()
logical function, public register_shelfwave_obc(param_file, CS, OBC_Reg)
Add shelfwave to OBC registry.
subroutine, public mom_mesg(message, verb, all_print)
Control structure for shelfwave open boundaries.
subroutine, public shelfwave_initialize_topography(D, G, param_file, max_depth)
Initialization of topography.
integer, parameter, public obc_none
Controls where open boundary conditions are applied.
subroutine, public mom_error(level, message, all_print)