Skip to content

no stress bottom #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions src/meanflow/friction.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ subroutine friction(nlev,kappa,avmolu,tx,ty,plume_type)
use meanflow, only: h,z0b,h0b,MaxItz0b,z0s,za
use meanflow, only: u,v,gravity
use meanflow, only: u_taub,u_taubo,u_taus,drag,taub
use meanflow, only: calc_bottom_stress
use meanflow, only: charnock,charnock_val,z0s_min
!
IMPLICIT NONE
Expand All @@ -83,6 +84,8 @@ subroutine friction(nlev,kappa,avmolu,tx,ty,plume_type)
!BOC

drag = _ZERO_
rr_s = _ZERO_
rr_b = _ZERO_

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

if (first) then
u_taub = u_taubo
first = .false.
else
u_taubo = u_taub
end if
! iterate bottom roughness length MaxItz0b times
do i=1,MaxItz0b

if (avmolu.le.0) then
z0b=0.03*h0b + za
if (calc_bottom_stress) then
if (first) then
u_taub = u_taubo
first = .false.
else
z0b=0.1*avmolu/max(avmolu,u_taub)+0.03*h0b + za
u_taubo = u_taub
end if
! iterate bottom roughness length MaxItz0b times
do i=1,MaxItz0b

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

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

! compute the friction velocity at the bottom
u_taub = rr_b*sqrt( u(1)*u(1) + v(1)*v(1) )
! compute the factor r (version 2, with meanvalue log-law)
! frac=(z0b+h(1))/z0b
! rr=kappa/((z0b+h(1))/h(1)*log(frac)-1.)

! compute the friction velocity at the bottom
u_taub = rr_b*sqrt( u(1)*u(1) + v(1)*v(1) )

end do
end if

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

Expand Down
6 changes: 5 additions & 1 deletion src/meanflow/meanflow.F90
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ module meanflow

! the 'meanflow' configuration
REALTYPE, public :: h0b
logical, public :: calc_bottom_stress
REALTYPE, public :: z0s_min
logical, public :: charnock
REALTYPE, public :: charnock_val
Expand Down Expand Up @@ -168,6 +169,8 @@ subroutine init_meanflow_yaml()
LEVEL1 'init_meanflow_yaml'

branch => settings_store%get_typed_child('bottom')
call branch%get(calc_bottom_stress, 'calc_bottom_stress', 'compute bottom stress (default: true)', &
default=.true.)
call branch%get(h0b, 'h0b', 'physical bottom roughness', 'm', &
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.')
call branch%get(MaxItz0b, 'max_it_z0b', 'number of iterations for hydrodynamic bottom roughness', &
Expand Down Expand Up @@ -238,6 +241,7 @@ subroutine post_init_meanflow(nlev,latitude)
! Initialize bottom and surface stress to zero
! They will be set in friction, but also used as input in the same routine.
u_taub = _ZERO_
u_taubo = _ZERO_
u_taus = _ZERO_
taub = _ZERO_

Expand Down Expand Up @@ -551,7 +555,7 @@ subroutine print_state_meanflow()
grid_method,c1ad,c2ad,c3ad,c4ad,Tgrid,NNnorm, &
SSnorm,dsurf,dtgrid,grid_file,gravity, &
rotation_period,rho_0,avmolu,avmolT, avmolS, &
MaxItz0b,no_shear
MaxItz0b,no_shear,calc_bottom_stress

LEVEL2 'z0b,z0s,za',z0b,z0s,za
LEVEL2 'cori',cori
Expand Down