Commit 2d0e8e71 authored by Knut's avatar Knut

z0_method => bottfric_method

parent e7c6ee2a
......@@ -8,7 +8,7 @@
<forward>
<![CDATA[
z0_method = source['getm/domain/z0_method'].getValue(usedefault=True)
target['getm/domain/z0_method'].setValue(z0_method+1)
target['getm/domain/bottfric_method'].setValue(z0_method+2)
nmls = ('getm/m3d/vel_','getm/temp/temp_','getm/salt/salt_')
for nml in nmls:
......@@ -28,8 +28,8 @@ for nml in nmls:
</forward>
<backward>
<![CDATA[
z0_method = source['getm/domain/z0_method'].getValue(usedefault=True)
target['getm/domain/z0_method'].setValue(z0_method-1)
bottfric_method = source['getm/domain/bottfric_method'].getValue(usedefault=True)
target['getm/domain/z0_method'].setValue(bottfric_method-2)
nmls = ('getm/m3d/vel_','getm/temp/temp_','getm/salt/salt_')
for nml in nmls:
......
......@@ -105,18 +105,21 @@
<jh>
-1
</jh>
<cd_min>
-1.0
</cd_min>
<z0_method>
1
</z0_method>
<bottfric_method>
2
</bottfric_method>
<rdrag>
0.0004
</rdrag>
<z0_const>
0.001
</z0_const>
<z0d_iters>
0
</z0d_iters>
<cd_min>
-1.0
</cd_min>
</domain>
<meteo>
<metforcing>
......
......@@ -81,19 +81,34 @@
<element name="ih" type="int" label="???"/>
<element name="jl" type="int" label="???"/>
<element name="jh" type="int" label="???"/>
<element name="cd_min" type="float" unit="m/s" label="min. drag coefficient"/>
<element name="z0_method" type="int" label="bottom roughness specification">
<element name="bottfric_method" type="int" label="bottom friction specification">
<options>
<option value="0" label="disable quadratic bottom friction"/>
<option value="1" label="constant - using z0_const"/>
<option value="2" label="space varying - read from bathymetry file (variable name MUST be z0)"/>
<option value="0" label="disable bottom friction"/>
<option value="1" label="linear with rdrag"/>
<option value="2" label="quadratic with z0_const, z0d_iters and cd_min"/>
<option value="3" label="quadratic with z0 from topofile, z0d_iters and cd_min"/>
</options>
</element>
<element name="rdrag" type="float" label="linear bottom friction parameter" unit="m/s">
<condition type="eq" variable="./bottfric_method" value="1"/>
</element>
<element name="z0_const" type="float" label="constant bottom roughness" unit="m">
<condition type="eq" variable="./z0_method" value="1"/>
<condition type="or">
<condition type="eq" variable="./bottfric_method" value="2"/>
<condition type="eq" variable="./bottfric_method" value="3"/>
</condition>
</element>
<element name="z0d_iters" type="int" label="iterations for dynamic bottom roughness" minInclusive="0">
<condition type="or">
<condition type="eq" variable="./bottfric_method" value="2"/>
<condition type="eq" variable="./bottfric_method" value="3"/>
</condition>
</element>
<element name="z0d_iters" type="int" label="iterations for dynamic z0" minInclusive="0">
<condition type="ne" variable="./z0_method" value="0"/>
<element name="cd_min" type="float" label="minimum drag coefficient">
<condition type="or">
<condition type="eq" variable="./bottfric_method" value="2"/>
<condition type="eq" variable="./bottfric_method" value="3"/>
</condition>
</element>
</element>
......
......@@ -21,7 +21,8 @@
use exceptions
use time, only: julianday,secondsofday
use parameters, only: avmmol
use domain, only: imin,imax,jmin,jmax,az,au,av,ax,H,HU,HV,min_depth,z0_method
use domain, only: imin,imax,jmin,jmax,az,au,av,ax,H,HU,HV,min_depth
use domain, only: bottfric_method
use domain, only: ilg,ihg,jlg,jhg
use domain, only: ill,ihl,jll,jhl
use domain, only: openbdy
......@@ -411,7 +412,7 @@
call tic(TIM_INTEGR2D)
if (mod(loop-1,MM) .eq. 0) then ! MacroMicro time step
if (z0_method .ne. 0) then
if (bottfric_method.eq.2 .or. bottfric_method.eq.3) then
call bottom_friction(U,V,DU,DV,ru,rv)
end if
end if
......
......@@ -17,7 +17,8 @@
! {\tt PUBLIC DATA MEMBERS}.
!
! !USES:
use domain, only: imin,imax,jmin,jmax,H,HU,HV,min_depth,cd_min
use domain, only: imin,imax,jmin,jmax,H,HU,HV,min_depth
use domain, only: bottfric_method,rdrag
IMPLICIT NONE
!
! !PUBLIC DATA MEMBERS:
......@@ -118,7 +119,13 @@
U = _ZERO_; fU = _ZERO_; Uint = _ZERO_; UEx = _ZERO_
V = _ZERO_; fV = _ZERO_; Vint = _ZERO_; VEx = _ZERO_
ru = cd_min ; rv = cd_min
if (bottfric_method .eq. 1) then
ru = rdrag
rv = rdrag
else
ru = _ZERO_
rv = _ZERO_
end if
res_du = _ZERO_; res_u = _ZERO_
res_dv = _ZERO_; res_v = _ZERO_
......
......@@ -25,7 +25,7 @@
! !USES:
use exceptions
use parameters, only: avmmol
use domain, only: openbdy,maxdepth,vert_cord,az,z0_method
use domain, only: openbdy,maxdepth,vert_cord,az,bottfric_method
use m2d_general, only: bottom_friction
use m2d, only: Am
use variables_2d, only: z
......@@ -334,7 +334,7 @@
call coordinates(hotstart)
if (z0_method .ne. 0) then
if (bottfric_method.eq.2 .or. bottfric_method.eq.3) then
call bottom_friction(uu(:,:,1),vv(:,:,1),hun(:,:,1),hvn(:,:,1),rru,rrv)
end if
......@@ -495,7 +495,7 @@
call uv_advect_3d()
if (Am .gt. _ZERO_) call uv_diffusion_3d() ! Must be called after uv_advect_3d
if (z0_method .ne. 0) then
if (bottfric_method.eq.2 .or. bottfric_method.eq.3) then
call tic(TIM_INTEGR3D)
call bottom_friction(uu(:,:,1),vv(:,:,1),hun(:,:,1),hvn(:,:,1),rru,rrv,zub,zvb)
call toc(TIM_INTEGR3D)
......
......@@ -19,7 +19,7 @@
! {\tt slow\_diffusion}.
!
! !USES:
use domain, only: imin,imax,jmin,jmax,kmax,au,av,z0_method
use domain, only: imin,imax,jmin,jmax,kmax,au,av,bottfric_method
use variables_2d, only: Uint,Vint,UEx,VEx,Slru,Slrv,SlUx,SlVx,ru,rv
use variables_3d, only: kumin,kvmin,uu,vv,hun,hvn,Dn,Dun,Dvn
use variables_3d, only: uuEx,vvEx,rru,rrv
......@@ -55,7 +55,7 @@
if (kmax .gt. 1) then
if (z0_method .ne. 0) then
if (bottfric_method.eq.2 .or. bottfric_method.eq.3) then
call bottom_friction(Uint,Vint,Dun,Dvn,ru,rv)
end if
call calc_uvex(0,Uint,Vint,Dn,Dun,Dvn)
......
......@@ -111,7 +111,7 @@
! {\tt init\_variables\_3d}) and cleanup (see {\tt clean\_variables\_3d}).
!
! !USES:
use domain, only: imin,imax,jmin,jmax,kmax,cd_min
use domain, only: imin,imax,jmin,jmax,kmax,bottfric_method,rdrag
IMPLICIT NONE
!
! !PUBLIC DATA MEMBERS:
......@@ -194,7 +194,15 @@
#endif
ssen = _ZERO_ ; ssun = _ZERO_ ; ssvn = _ZERO_
Dn = SMALL ; Dun = SMALL ; Dvn = SMALL
rru= cd_min ; rrv= cd_min
if (bottfric_method .eq. 1) then
rru = rdrag
rrv = rdrag
else
rru = _ZERO_
rrv = _ZERO_
end if
uuEx= _ZERO_ ; vvEx= _ZERO_
tke=1.e-10 ; eps=1.e-10
preadapt=0
......
......@@ -84,11 +84,11 @@
REALTYPE :: cori= _ZERO_
REALTYPE :: cd_min=_ZERO_
! method for specifying bottom roughness (0=disable, 1=const, 2=from topo.nc)
integer :: z0_method=1
integer :: bottfric_method=2
REALTYPE :: rdrag=0.0004d0
REALTYPE :: z0_const=0.001d0
integer :: z0d_iters=0
REALTYPE :: cd_min=_ZERO_
! !DEFINED PARAMETERS:
integer, parameter :: INNER = 1
......@@ -162,7 +162,7 @@
longitude,latitude,f_plane,openbdy,bdyinfofile, &
crit_depth,min_depth,kdum,ddu,ddl, &
d_gamma,gamma_surf,il,ih,jl,jh, &
cd_min,z0_method,z0_const,z0d_iters
bottfric_method,z0_const,z0d_iters,cd_min
!EOP
!-------------------------------------------------------------------------
!BOC
......@@ -373,38 +373,34 @@
LEVEL2 'bottom friction specification'
#ifdef NO_BOTTFRIC
if (cd_min.gt._ZERO_ .or. z0_method.ne.0) then
LEVEL3 'Reset cd_min=0.0 and z0_method=0 due to obsolete -DNO_BOTTFRIC.'
if (bottfric_method .ne. 0) then
LEVEL3 'Reset bottfric_method=0 due to obsolete -DNO_BOTTFRIC.'
LEVEL3 'Note that this behaviour will be removed in the future!'
cd_min = _ZERO_
z0_method = 0
bottfric_method=0
end if
#endif
if (cd_min .lt. _ZERO_) then
cd_min = _ZERO_
if (bottfric_method.eq.1 .and. rdrag.le._ZERO_) then
bottfric_method = 0
end if
select case (z0_method)
select case (bottfric_method)
case(0)
if (cd_min .gt. _ZERO_) then
LEVEL3 'linear bottom friction with drag coefficient cd = ',real(cd_min)
else
LEVEL3 'disabled bottom friction'
end if
LEVEL3 'no bottom friction'
case(1)
LEVEL3 'quadratic bottom friction with constant z0 = ',real(z0_const)
LEVEL3 'linear bottom friction with rdrag = ',real(rdrag)
case(2)
LEVEL3 'quadratic bottom friction with z0_const = ',real(z0_const)
if (z0_const .le. _ZERO_) then
call getm_error("init_domain()", &
"non-positive bottom roughness");
end if
zub0 = z0_const
zvb0 = z0_const
case(2)
LEVEL3 'quadratic bottom friction with z0 field read from topo file'
case(3)
LEVEL3 'quadratic bottom friction with z0 read from topo file'
if (MINVAL(z0(imin:imax,jmin:jmax),mask=(az(imin:imax,jmin:jmax).ge.1)) .le. _ZERO_) then
call getm_error("init_domain()", &
"non-positive bottom roughness in z0 field");
end if
! Note (KK): we need halo update only for periodic domains
call update_2d_halo(z0,z0,az,imin,jmin,imax,jmax,H_TAG)
call wait_halo(H_TAG)
......@@ -426,9 +422,11 @@
call getm_error("init_domain()", &
"A non valid z0 method has been chosen");
end select
if (z0_method .ne. 0) then
if (bottfric_method.eq.2 .or. bottfric_method.eq.3) then
if (cd_min .gt. _ZERO_) then
LEVEL3 'min. drag coefficient: ',real(cd_min)
LEVEL3 'min. drag coefficient cd_min = ',real(cd_min)
else
cd_min = _ZERO_
end if
if (z0d_iters .gt. 0) then
LEVEL3 'iterations for dynamic bottom roughness: ',z0d_iters
......
......@@ -33,7 +33,7 @@
use domain, only : latc,lonc
use domain, only : latx,lonx
use domain, only : convx,convc
use domain, only : z0_method,z0
use domain, only : bottfric_method,z0
IMPLICIT NONE
!
! !PUBLIC MEMBER FUNCTIONS:
......@@ -630,7 +630,7 @@ stop
end select
! read bottom roughness
if (z0_method .eq. 2) then
if (bottfric_method .eq. 3) then
status = nf90_inq_varid(ncid,"z0",id)
if (status .ne. NF90_NOERR) then
call netcdf_error(status,"ncdf_check_grid()", &
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment