This subroutine sets the properties of flow at open boundary conditions.
129 type(ocean_OBC_type),
pointer :: OBC
132 type(shelfwave_OBC_CS),
pointer :: CS
133 type(ocean_grid_type),
intent(in) :: G
134 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)),
intent(in) :: h
135 type(time_type),
intent(in) :: Time
138 real :: my_amp, time_sec
139 real :: cos_wt, cos_ky, sin_wt, sin_ky, omega, alpha
140 real :: x, y, jj, kk, ll
141 character(len=40) :: mdl =
"shelfwave_set_OBC_data"
142 integer :: i, j, k, is, ie, js, je, isd, ied, jsd, jed, n
143 integer :: IsdB, IedB, JsdB, JedB
144 type(OBC_segment_type),
pointer :: segment => null()
146 is = g%isc ; ie = g%iec ; js = g%jsc ; je = g%jec
147 isd = g%isd ; ied = g%ied ; jsd = g%jsd ; jed = g%jed
148 isdb = g%IsdB ; iedb = g%IedB ; jsdb = g%JsdB ; jedb = g%JedB
150 if (.not.
associated(obc))
return
152 time_sec = time_type_to_real(time)
159 do n = 1, obc%number_of_segments
160 segment => obc%segment(n)
161 if (.not. segment%on_pe) cycle
162 if (segment%direction /= obc_direction_w) cycle
164 isdb = segment%HI%IsdB ; iedb = segment%HI%IedB
165 jsd = segment%HI%jsd ; jed = segment%HI%jed
166 do j=jsd,jed ;
do i=isdb,iedb
167 x = g%geoLonCu(i,j) - g%west_lon
168 y = g%geoLatCu(i,j) - g%south_lat
169 sin_wt = sin(ll*x - omega*time_sec)
170 cos_wt = cos(ll*x - omega*time_sec)
173 segment%normal_vel_bt(i,j) = my_amp * exp(- alpha * y) * cos_wt * &
174 (alpha * sin_ky + kk * cos_ky)