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) = g%US%m_s_to_L_T*my_amp * exp(- alpha * y) * cos_wt * &
174 (alpha * sin_ky + kk * cos_ky)