116
117
121
122
123
124
125 integer, intent(in) :: ng, tile
126 integer, intent(in) :: LBi, UBi, LBj, UBj
127 integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
128 integer, intent(in) :: nstp, nnew
129
130# ifdef ASSUMED_SHAPE
131 real(r8), intent(in) :: Hz(LBi:,LBj:,:)
132# ifdef WET_DRY
133 real(r8), intent(in) :: rmask_wet(LBi:,LBj:)
134# endif
135# ifdef BBL_MODEL
136 real(r8), intent(in) :: bustrc(LBi:,LBj:)
137 real(r8), intent(in) :: bvstrc(LBi:,LBj:)
138 real(r8), intent(in) :: bustrw(LBi:,LBj:)
139 real(r8), intent(in) :: bvstrw(LBi:,LBj:)
140 real(r8), intent(in) :: bustrcwmax(LBi:,LBj:)
141 real(r8), intent(in) :: bvstrcwmax(LBi:,LBj:)
142# endif
143 real(r8), intent(in) :: bustr(LBi:,LBj:)
144 real(r8), intent(in) :: bvstr(LBi:,LBj:)
145# if defined SED_MORPH
146 real(r8), intent(inout):: bed_thick(LBi:,LBj:,:)
147# endif
148 real(r8), intent(inout) :: t(LBi:,LBj:,:,:,:)
149 real(r8), intent(inout) :: ero_flux(LBi:,LBj:,:)
150 real(r8), intent(inout) :: settling_flux(LBi:,LBj:,:)
151 real(r8), intent(inout) :: bed(LBi:,LBj:,:,:)
152 real(r8), intent(inout) :: bed_frac(LBi:,LBj:,:,:)
153 real(r8), intent(inout) :: bed_mass(LBi:,LBj:,:,:,:)
154 real(r8), intent(inout) :: bottom(LBi:,LBj:,:)
155# else
156 real(r8), intent(in) :: Hz(LBi:UBi,LBj:UBj,N(ng))
157# ifdef WET_DRY
158 real(r8), intent(in) :: rmask_wet(LBi:UBi,LBj:UBj)
159# endif
160# ifdef BBL_MODEL
161 real(r8), intent(in) :: bustrc(LBi:UBi,LBj:UBj)
162 real(r8), intent(in) :: bvstrc(LBi:UBi,LBj:UBj)
163 real(r8), intent(in) :: bustrw(LBi:UBi,LBj:UBj)
164 real(r8), intent(in) :: bvstrw(LBi:UBi,LBj:UBj)
165 real(r8), intent(in) :: bustrcwmax(LBi:UBi,LBj:UBj)
166 real(r8), intent(in) :: bvstrcwmax(LBi:UBi,LBj:UBj)
167# endif
168 real(r8), intent(in) :: bustr(LBi:UBi,LBj:UBj)
169 real(r8), intent(in) :: bvstr(LBi:UBi,LBj:UBj)
170# if defined SED_MORPH
171 real(r8), intent(inout):: bed_thick(LBi:UBi,LBj:UBj,3)
172# endif
173 real(r8), intent(inout) :: t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
174 real(r8), intent(inout) :: ero_flux(LBi:UBi,LBj:UBj,NST)
175 real(r8), intent(inout) :: settling_flux(LBi:UBi,LBj:UBj,NST)
176 real(r8), intent(inout) :: bed(LBi:UBi,LBj:UBj,Nbed,MBEDP)
177 real(r8), intent(inout) :: bed_frac(LBi:UBi,LBj:UBj,Nbed,NST)
178 real(r8), intent(inout) :: bed_mass(LBi:UBi,LBj:UBj,Nbed,1:2,NST)
179 real(r8), intent(inout) :: bottom(LBi:UBi,LBj:UBj,MBOTP)
180# endif
181
182
183
184 integer :: Ksed, i, indx, ised, j, k, ks
185 integer :: bnew
186
187 real(r8) :: cff, cff1, cff2, cff3, cff4
188
189 real(r8), dimension(IminS:ImaxS,N(ng)) :: Hz_inv
190
191 real(r8), dimension(IminS:ImaxS,JminS:JmaxS) :: tau_w
192
193# include "set_bounds.h"
194
195# ifdef BEDLOAD
196 bnew=nnew
197# else
198 bnew=nstp
199# endif
200
201
202
203
204
205# if defined BEDLOAD_MPM || defined SUSPLOAD
206# ifdef BBL_MODEL
207 DO j=jstr-1,jend+1
208 DO i=istr-1,iend+1
209 tau_w(i,j)=sqrt(bustrcwmax(i,j)*bustrcwmax(i,j)+ &
210 & bvstrcwmax(i,j)*bvstrcwmax(i,j))
211# ifdef WET_DRY
212 tau_w(i,j)=tau_w(i,j)*rmask_wet(i,j)
213# endif
214 END DO
215 END DO
216# else
217 DO j=jstrm1,jendp1
218 DO i=istrm1,iendp1
219 tau_w(i,j)=0.5_r8*sqrt((bustr(i,j)+bustr(i+1,j))* &
220 & (bustr(i,j)+bustr(i+1,j))+ &
221 & (bvstr(i,j)+bvstr(i,j+1))* &
222 & (bvstr(i,j)+bvstr(i,j+1)))
223# ifdef WET_DRY
224 tau_w(i,j)=tau_w(i,j)*rmask_wet(i,j)
225# endif
226 END DO
227 END DO
228# endif
229# endif
230
231
232
233
234
235
236
237
238
239
240
241
242 j_loop : DO j=jstr,jend
244 DO i=istr,iend
245 hz_inv(i,k)=1.0_r8/hz(i,j,k)
246 END DO
247 END DO
248
249 sed_loop:
DO ised=1,
nst
251 DO i=istr,iend
252
253
254
255# if defined COHESIVE_BED
257# elif defined MIXED_BED
261 cff=1.0_r8/cff
262# else
263 cff=1.0_r8/
tau_ce(ised,ng)
264# endif
265
266
267
268 cff1=(1.0_r8-bed(i,j,1,
iporo))*bed_frac(i,j,1,ised)
269 cff2=
dt(ng)*
erate(ised,ng)*cff1
270 cff3=
srho(ised,ng)*cff1
271 cff4=bed_mass(i,j,1,bnew,ised)
272 ero_flux(i,j,ised)= &
273 & min(max(0.0_r8,cff2*(cff*tau_w(i,j)-1.0_r8)), &
274 & min(cff3*bottom(i,j,
iactv),cff4)+ &
275 & settling_flux(i,j,ised))
276
277
278
279
280 t(i,j,1,nnew,indx)=t(i,j,1,nnew,indx)+ero_flux(i,j,ised)
281 END DO
282 END DO sed_loop
283 END DO j_loop
284
285 RETURN
integer, dimension(:), allocatable n
real(dp), dimension(:), allocatable dt
real(r8), dimension(:,:), allocatable erate
real(r8), dimension(:,:), allocatable srho
integer, dimension(:), allocatable idsed
real(r8), dimension(:,:), allocatable tau_ce