@@ -416,6 +416,7 @@ subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, US, CS, pbv)
416
416
417
417
if (.not. use_BBL_EOS) Rml_vel(:,:) = 0.0
418
418
419
+ ! Resetting Ray_[uv] is required by body force drag.
419
420
if (allocated (visc% Ray_u)) visc% Ray_u(:,:,:) = 0.0
420
421
if (allocated (visc% Ray_v)) visc% Ray_v(:,:,:) = 0.0
421
422
@@ -582,6 +583,21 @@ subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, US, CS, pbv)
582
583
endif
583
584
endif ; endif
584
585
586
+ ! Set the "back ground" friction velocity scale to either the tidal amplitude or place-holder constant
587
+ if (CS% BBL_use_tidal_bg) then
588
+ do i= is,ie ; if (do_i(i)) then ; if (m== 1 ) then
589
+ u2_bg(I) = 0.5 * ( G% mask2dT(i,j)* (CS% tideamp(i,j)* CS% tideamp(i,j))+ &
590
+ G% mask2dT(i+1 ,j)* (CS% tideamp(i+1 ,j)* CS% tideamp(i+1 ,j)) )
591
+ else
592
+ u2_bg(i) = 0.5 * ( G% mask2dT(i,j)* (CS% tideamp(i,j)* CS% tideamp(i,j))+ &
593
+ G% mask2dT(i,j+1 )* (CS% tideamp(i,j+1 )* CS% tideamp(i,j+1 )) )
594
+ endif ; endif ; enddo
595
+ else
596
+ do i= is,ie ; if (do_i(i)) then
597
+ u2_bg(i) = CS% drag_bg_vel * CS% drag_bg_vel
598
+ endif ; enddo
599
+ endif
600
+
585
601
if (use_BBL_EOS .or. CS% body_force_drag .or. .not. CS% linear_drag) then
586
602
! Calculate the mean velocity magnitude over the bottommost CS%Hbbl of
587
603
! the water column for determining the quadratic bottom drag.
@@ -591,18 +607,6 @@ subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, US, CS, pbv)
591
607
dztot_vel = 0.0 ; dzwtot = 0.0
592
608
Thtot = 0.0 ; Shtot = 0.0 ; SpV_htot = 0.0
593
609
594
- ! Set the "back ground" friction velocity scale to either the tidal amplitude or place-holder constant
595
- if (CS% BBL_use_tidal_bg) then
596
- if (m== 1 ) then
597
- u2_bg(I) = 0.5 * ( G% mask2dT(i,j)* (CS% tideamp(i,j)* CS% tideamp(i,j))+ &
598
- G% mask2dT(i+1 ,j)* (CS% tideamp(i+1 ,j)* CS% tideamp(i+1 ,j)) )
599
- else
600
- u2_bg(i) = 0.5 * ( G% mask2dT(i,j)* (CS% tideamp(i,j)* CS% tideamp(i,j))+ &
601
- G% mask2dT(i,j+1 )* (CS% tideamp(i,j+1 )* CS% tideamp(i,j+1 )) )
602
- endif
603
- else
604
- u2_bg(i) = CS% drag_bg_vel * CS% drag_bg_vel
605
- endif
606
610
do k= nz,1 ,- 1
607
611
608
612
if (htot_vel>= CS% Hbbl) exit ! terminate the k loop
@@ -802,19 +806,6 @@ subroutine set_viscous_BBL(u, v, h, tv, visc, G, GV, US, CS, pbv)
802
806
if (m== 1 ) then ; C2f = G% CoriolisBu(I,J-1 ) + G% CoriolisBu(I,J)
803
807
else ; C2f = G% CoriolisBu(I-1 ,J) + G% CoriolisBu(I,J) ; endif
804
808
805
- ! Set the "back ground" friction velocity scale to either the tidal amplitude or place-holder constant
806
- if (CS% BBL_use_tidal_bg) then
807
- if (m== 1 ) then
808
- u2_bg(I) = 0.5 * ( G% mask2dT(i,j)* (CS% tideamp(i,j)* CS% tideamp(i,j))+ &
809
- G% mask2dT(i+1 ,j)* (CS% tideamp(i+1 ,j)* CS% tideamp(i+1 ,j)) )
810
- else
811
- u2_bg(i) = 0.5 * ( G% mask2dT(i,j)* (CS% tideamp(i,j)* CS% tideamp(i,j))+ &
812
- G% mask2dT(i,j+1 )* (CS% tideamp(i,j+1 )* CS% tideamp(i,j+1 )) )
813
- endif
814
- else
815
- u2_bg(i) = CS% drag_bg_vel * CS% drag_bg_vel
816
- endif
817
-
818
809
! The thickness of a rotation limited BBL ignoring stratification is
819
810
! h_f ~ Cn u* / f (limit of KW99 eq. 2.20 for N->0).
820
811
! The buoyancy limit of BBL thickness (h_N) is already in the variable htot from above.
0 commit comments