New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#1058 (pb with ln_loglayer and minimum background coefficient) – NEMO

Opened 11 years ago

Closed 10 years ago

#1058 closed Bug (fixed)

pb with ln_loglayer and minimum background coefficient

Reported by: rbourdal Owned by: hliu
Priority: normal Milestone:
Component: OCE Version: v3.6
Severity: Keywords:
Cc: hliu

Description

Hi,

There is a problem with the ln_loglayer flag.

  • The minimum background coefficient is not applied (rn_bfri2 not present in bfrcoef2d).

Proposition: separate the ln_loglayer case with 2 loops
Example of lines implemented in 3.4 version (equations are solved at U and V point)

IF(ln_loglayer) THEN

# if defined key_vectopt_loop

DO jj = 1, 1

!CDIR NOVERRCHK

DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling)

# else
!CDIR NOVERRCHK

DO jj = 2, jpjm1

!CDIR NOVERRCHK

DO ji = 2, jpim1

# endif

ikbu = mbku(ji,jj) ! ocean bottom level at u- and v-points
ikbv = mbkv(ji,jj) ! (deepest ocean u- and v-points)
!
zvu = 0.25 * ( vn(ji,jj ,ikbu) + vn(ji+1,jj ,ikbu) &

& + vn(ji,jj-1,ikbu) + vn(ji+1,jj-1,ikbu) )

zuv = 0.25 * ( un(ji,jj ,ikbv) + un(ji-1,jj ,ikbv) &

& + un(ji,jj+1,ikbv) + un(ji-1,jj+1,ikbv) )

!
zecu = SQRT( un(ji,jj,ikbu) * un(ji,jj,ikbu) + zvu*zvu + rn_bfeb2 )
zecv = SQRT( vn(ji,jj,ikbv) * vn(ji,jj,ikbv) + zuv*zuv + rn_bfeb2 )
!
bfrua(ji,jj) = - 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji+1,jj ) ) * zecu
bfrva(ji,jj) = - 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji ,jj+1) ) * zecv

zbfrcoefua = 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji+1,jj ) )
zbfrcoefva = 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji ,jj+1) )

ztmp = max(0.5_wp * fse3u(ji,jj,ikbu), rn_bfrz0)
zcdu = ( vkarmn / LOG( ztmp / rn_bfrz0 ) )2._wp
ztmp = max(0.5_wp * fse3v(ji,jj,ikbv), rn_bfrz0)
zcdv = ( vkarmn / LOG( ztmp / rn_bfrz0 ) )
2._wp


zcdu = MAX( zbfrcoefua, zcdu )
zcdv = MAX( zbfrcoefva, zcdv )

bfrua(ji,jj) = - zcdu * zecu
bfrva(ji,jj) = - zcdv * zecv

END DO

END DO

ELSE

# if defined key_vectopt_loop

DO jj = 1, 1

!CDIR NOVERRCHK

DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling)

# else
!CDIR NOVERRCHK

DO jj = 2, jpjm1

!CDIR NOVERRCHK

DO ji = 2, jpim1

# endif

ikbu = mbku(ji,jj) ! ocean bottom level at u- and v-points
ikbv = mbkv(ji,jj) ! (deepest ocean u- and v-points)
!
zvu = 0.25 * ( vn(ji,jj ,ikbu) + vn(ji+1,jj ,ikbu) &

& + vn(ji,jj-1,ikbu) + vn(ji+1,jj-1,ikbu) )

zuv = 0.25 * ( un(ji,jj ,ikbv) + un(ji-1,jj ,ikbv) &

& + un(ji,jj+1,ikbv) + un(ji-1,jj+1,ikbv) )

!
zecu = SQRT( un(ji,jj,ikbu) * un(ji,jj,ikbu) + zvu*zvu + rn_bfeb2 )
zecv = SQRT( vn(ji,jj,ikbv) * vn(ji,jj,ikbv) + zuv*zuv + rn_bfeb2 )
!
bfrua(ji,jj) = - 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji+1,jj ) ) * zecu
bfrva(ji,jj) = - 0.5_wp * ( bfrcoef2d(ji,jj) + bfrcoef2d(ji ,jj+1) ) * zecv

END DO

END DO

ENDIF
!
CALL lbc_lnk( bfrua, 'U', 1. ) ; CALL lbc_lnk( bfrva, 'V', 1. ) ! Lateral boundary condition
!
IF(ln_ctl) CALL prt_ctl( tab2d_1=bfrua, clinfo1=' bfr - u: ', mask1=umask, &

& tab2d_2=bfrva, clinfo2= ' v: ', mask2=vmask,ovlap=1 )

ENDIF

Commit History (0)

(No commits)

Change History (7)

comment:1 follow-up: Changed 11 years ago by hliu

  • Cc hliu added
  • Owner changed from NEMO team to hliu
  • Status changed from new to assigned
  1. The background coefficient (rn_bf3b2) has already been applied there. This ticket actually concerns about the 2D enhancement of bottom friction which hasn't been implemented when ln_loglayer == .true..
  2. I am a little bit worried about the solution proposed here: If "the 2D enhancement" is designed for enhancement of constant  bottom friction (bfr) coefficient, it shouldn't be mixed with the log layer bfr coefficient; If "the 2D enhancement" data can be applied to enhance the log layer bfr coefficient, we should apply them directly directly (zcdu = MAX( zbfrcoefua, zcdu) is a mixing of them).
  3. I don't know if  "the 2D enhancement" can be applied to enhance loglayer bfr coefficient. (anybody knows please offer your answer).
  4. If the answer to 3 is yes, I can implement it. 

comment:2 in reply to: ↑ 1 Changed 11 years ago by dupontf

Would it make more sense to use the "2D enhancement" for reading up a spatially variable map of bottom roughness, such as in Wu et al (2011)?

Yongsheng Wu, Jason Chaffey, David A. Greenberg, Keir Colbo, Peter C. Smith, Tidally-induced sediment transport patterns in the upper Bay of Fundy: A numerical study, Continental Shelf Research, Volume 31, Issues 19–20, December 2011, Pages 2041-2053, 10.1016/j.csr.2011.10.009.
(http://www.sciencedirect.com/science/article/pii/S0278434311003293)

Fred.

comment:3 Changed 11 years ago by hliu

Regarding to Fred's comments:

If people know the distribution of bottom roughness and the vertical grid resolution is fine enough (to resolve the bottom boundary layer), it will be ideal to use it together with the loglayer. It sound sensible to me that at least we should add an option for this in the code although the above two requirements can rarely be satisfied in most real cases.

Regarding to the "2D enhancement":

For Z-coordinate, I don't think the loglayer is necessary. The constant (with or without 2D enhancement) bfr coefficient should be good enough. For sigma-coordinate in coast ocean (which is the loglayer options was originally added for), "2D bottom roughness" will be more proper than "2D enhancement" if it is needed.

Hedong

comment:4 Changed 11 years ago by hliu

  • Resolution set to fixed
  • Status changed from assigned to closed

The 2D-enhancement for log layer bfr coefficient has been added in Branch dev_MERGE_2012, revision 3820

comment:5 Changed 10 years ago by jchanut

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:6 Changed 10 years ago by jchanut

There was (still) an error in the computation of the logarithmic bottom friction (zdfbfr.F90).
Let's clarify what is done if nn_bfr=2 and ln_loglayer=.true in the namelist:

The bottom friction coefficient (zbfrt(:,:) below) is now computed according to:

DO ji=1,jpi
   DO jj=1,jpj
      ikbt = mbkt(ji,jj)
      ztmp = tmask(ji,jj,ikbt) * ( vkarmn / LOG( 0.5_wp * fse3t_n(ji,jj,ikbt) / rn_bfrz0 ))**2._wp
      zbfrt(ji,jj) = MAX(bfrcoef2d(ji,jj), ztmp)
      zbfrt(ji,jj) = MIN(zbfrt(ji,jj), rn_bfri2_max)
   END DO
END DO

Where bfrcoef2d is minimum background bottom friction coefficient which is set to rn_bfri2 or eventually spatially varying (if ln_bfr2d=T). That's what is already done if ln_loglayer=F
rn_bfri2_max, is a user defined maximum coefficient to avoid large values when bottom thicknesses get thin.

namelist_ref has been updated accordingly.

comment:7 Changed 10 years ago by jchanut

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.