diff --git a/schemas/getm-2.0_getm-2.1.converter b/schemas/getm-2.0_getm-2.1.converter index 3e4012f979716ba53a68d5890cb6b2dc09286fb0..94336f563d0709c81b0f9cf2c7e2769e37d61528 100644 --- a/schemas/getm-2.0_getm-2.1.converter +++ b/schemas/getm-2.0_getm-2.1.converter @@ -8,7 +8,7 @@ -1 - - -1.0 - - - 1 - + + 2 + + + 0.0004 + 0.001 0 + + -1.0 + diff --git a/schemas/getm-2.1.schema b/schemas/getm-2.1.schema index 20cb1b3430e2177bfcee15371bb9e37ea1a0bbea..311a3dfc982d40cf6d7b3991358b395d5ce7987f 100644 --- a/schemas/getm-2.1.schema +++ b/schemas/getm-2.1.schema @@ -81,19 +81,34 @@ - - + - + + + - + + + + - - + + + + + + + + + + + diff --git a/src/2d/m2d.F90 b/src/2d/m2d.F90 index c5e937371c7c17d92506fbb547456533316d2aed..e23d47702f4bc1463a68a543b8754de3ca69105d 100644 --- a/src/2d/m2d.F90 +++ b/src/2d/m2d.F90 @@ -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 diff --git a/src/2d/variables_2d.F90 b/src/2d/variables_2d.F90 index 2f264b3c9fde7e1172ffb5895a10cc15fcd10c1b..f1d727deb7f75f9b0c8192fb48ee304863bf5c81 100644 --- a/src/2d/variables_2d.F90 +++ b/src/2d/variables_2d.F90 @@ -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_ diff --git a/src/3d/m3d.F90 b/src/3d/m3d.F90 index 61ee70f790b3e332aeb346b83a9db140c0c5cfa9..6a29cb4da1f84edfecff780784d7a6d12639f9cf 100644 --- a/src/3d/m3d.F90 +++ b/src/3d/m3d.F90 @@ -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) diff --git a/src/3d/slow_terms.F90 b/src/3d/slow_terms.F90 index 06e7abd55257697775fe3df8e9c1f9a37916f218..7731430b23b83548ec4d941c7882be883da25cf9 100644 --- a/src/3d/slow_terms.F90 +++ b/src/3d/slow_terms.F90 @@ -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) diff --git a/src/3d/variables_3d.F90 b/src/3d/variables_3d.F90 index 7deee68e7e22f4fd632a5a42d4dc558473f1ee60..cfc59658d28ac44abf104e401c55f930003d1fcc 100644 --- a/src/3d/variables_3d.F90 +++ b/src/3d/variables_3d.F90 @@ -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 diff --git a/src/domain/domain.F90 b/src/domain/domain.F90 index e6a50b168845024351313d761189017a1fa49f2d..81db64e2df071aaf187f2f9f10140c95147e9f1a 100644 --- a/src/domain/domain.F90 +++ b/src/domain/domain.F90 @@ -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 diff --git a/src/ncdf/ncdf_topo.F90 b/src/ncdf/ncdf_topo.F90 index f16a4d623fa4b3256d145e58e48d91a408361f1a..476119fa54b84da8abd50e1d3dfcf96c2de2221c 100644 --- a/src/ncdf/ncdf_topo.F90 +++ b/src/ncdf/ncdf_topo.F90 @@ -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()", &