Skip to content

Commit 8e4ec4e

Browse files
authored
no stress bottom (#60)
* no stress bottom * change name for calc_bottom_stress
1 parent 8ca79b2 commit 8e4ec4e

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed

src/meanflow/friction.F90

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ subroutine friction(nlev,kappa,avmolu,tx,ty,plume_type)
5858
use meanflow, only: h,z0b,h0b,MaxItz0b,z0s,za
5959
use meanflow, only: u,v,gravity
6060
use meanflow, only: u_taub,u_taubo,u_taus,drag,taub
61+
use meanflow, only: calc_bottom_stress
6162
use meanflow, only: charnock,charnock_val,z0s_min
6263
!
6364
IMPLICIT NONE
@@ -83,6 +84,8 @@ subroutine friction(nlev,kappa,avmolu,tx,ty,plume_type)
8384
!BOC
8485

8586
drag = _ZERO_
87+
rr_s = _ZERO_
88+
rr_b = _ZERO_
8689

8790
! use the Charnock formula to compute the surface roughness
8891
if (charnock) then
@@ -92,32 +95,35 @@ subroutine friction(nlev,kappa,avmolu,tx,ty,plume_type)
9295
z0s=z0s_min
9396
end if
9497

95-
if (first) then
96-
u_taub = u_taubo
97-
first = .false.
98-
else
99-
u_taubo = u_taub
100-
end if
101-
! iterate bottom roughness length MaxItz0b times
102-
do i=1,MaxItz0b
103-
104-
if (avmolu.le.0) then
105-
z0b=0.03*h0b + za
98+
if (calc_bottom_stress) then
99+
if (first) then
100+
u_taub = u_taubo
101+
first = .false.
106102
else
107-
z0b=0.1*avmolu/max(avmolu,u_taub)+0.03*h0b + za
103+
u_taubo = u_taub
108104
end if
105+
! iterate bottom roughness length MaxItz0b times
106+
do i=1,MaxItz0b
109107

110-
! compute the factor r (version 1, with log-law)
111-
rr_b=kappa/(log((z0b+h(1)/2)/z0b))
108+
if (avmolu.le.0) then
109+
z0b=0.03*h0b + za
110+
else
111+
z0b=0.1*avmolu/max(avmolu,u_taub)+0.03*h0b + za
112+
end if
112113

113-
! compute the factor r (version 2, with meanvalue log-law)
114-
! frac=(z0b+h(1))/z0b
115-
! rr=kappa/((z0b+h(1))/h(1)*log(frac)-1.)
114+
! compute the factor r (version 1, with log-law)
115+
rr_b=kappa/(log((z0b+h(1)/2)/z0b))
116116

117-
! compute the friction velocity at the bottom
118-
u_taub = rr_b*sqrt( u(1)*u(1) + v(1)*v(1) )
117+
! compute the factor r (version 2, with meanvalue log-law)
118+
! frac=(z0b+h(1))/z0b
119+
! rr=kappa/((z0b+h(1))/h(1)*log(frac)-1.)
120+
121+
! compute the friction velocity at the bottom
122+
u_taub = rr_b*sqrt( u(1)*u(1) + v(1)*v(1) )
123+
124+
end do
125+
end if
119126

120-
end do
121127
! compute the factor r (version 1, with log-law)
122128
if (plume_type .eq. 1) rr_s=kappa/(log((z0s+h(nlev)/2)/z0s))
123129

src/meanflow/meanflow.F90

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ module meanflow
9090

9191
! the 'meanflow' configuration
9292
REALTYPE, public :: h0b
93+
logical, public :: calc_bottom_stress
9394
REALTYPE, public :: z0s_min
9495
logical, public :: charnock
9596
REALTYPE, public :: charnock_val
@@ -168,6 +169,8 @@ subroutine init_meanflow_yaml()
168169
LEVEL1 'init_meanflow_yaml'
169170

170171
branch => settings_store%get_typed_child('bottom')
172+
call branch%get(calc_bottom_stress, 'calc_bottom_stress', 'compute bottom stress (default: true)', &
173+
default=.true.)
171174
call branch%get(h0b, 'h0b', 'physical bottom roughness', 'm', &
172175
minimum=0._rk,default=0.05_rk, description='physical bottom roughness or bed roughness. This variable, h0b, relates to the hydrodynamic bottom roughness z0b as z0b = 0.03*h0b + 0.1*nu/ustar.')
173176
call branch%get(MaxItz0b, 'max_it_z0b', 'number of iterations for hydrodynamic bottom roughness', &
@@ -238,6 +241,7 @@ subroutine post_init_meanflow(nlev,latitude)
238241
! Initialize bottom and surface stress to zero
239242
! They will be set in friction, but also used as input in the same routine.
240243
u_taub = _ZERO_
244+
u_taubo = _ZERO_
241245
u_taus = _ZERO_
242246
taub = _ZERO_
243247

@@ -551,7 +555,7 @@ subroutine print_state_meanflow()
551555
grid_method,c1ad,c2ad,c3ad,c4ad,Tgrid,NNnorm, &
552556
SSnorm,dsurf,dtgrid,grid_file,gravity, &
553557
rotation_period,rho_0,avmolu,avmolT, avmolS, &
554-
MaxItz0b,no_shear
558+
MaxItz0b,no_shear,calc_bottom_stress
555559

556560
LEVEL2 'z0b,z0s,za',z0b,z0s,za
557561
LEVEL2 'cori',cori

0 commit comments

Comments
 (0)