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.
#767 (BUG: in zdfbrf.F90 and dynbfr.F90 (also impact dynspg_ts.F90)) – NEMO

Opened 14 years ago

Closed 14 years ago

Last modified 2 years ago

#767 closed Bug (fixed)

BUG: in zdfbrf.F90 and dynbfr.F90 (also impact dynspg_ts.F90)

Reported by: gm Owned by: nemo
Priority: low Milestone:
Component: OCE Version: v3.2
Severity: Keywords: 2010 OPA v3.2
Cc:

Description (last modified by cetlod)

the scale factor used in zdfbrf.F90 and dynbfr.F90 (also impact dynhpg_ts.F90) is sometimes the wrong one, i.e. at level mbathy (mbkt + 1) instead of level mbathy - 1 (mbkt)

indeed, the bottom friction tendancy is bfrua * ub / e3u with e3u at the deepest OCEAN level (mbathy - 1 at velocity point), as stated in the documentation, not the mbathy at velocity point

This is a small bug since the vertical scale factory are only slowly varying with the vertical (e3(k+1)/e3(k) < 1.2).

The proposed changes are given below for both v3.2 and v3.3beta

Gurvan


zdfbfr.F90 (zdf_bfr_init) :

             ikbu = MIN( mbathy(ji+1,jj  ), mbathy(ji,jj) )
             ikbv = MIN( mbathy(ji  ,jj+1), mbathy(ji,jj) )
             zfru = 0.5 * fse3u(ji,jj,ikbu) / rdt
             zfrv = 0.5 * fse3v(ji,jj,ikbv) / rdt

should becomes in the consolidation of v3.2 :

             ikbu = MIN( mbathy(ji+1,jj  ), mbathy(ji,jj) )
             ikbv = MIN( mbathy(ji  ,jj+1), mbathy(ji,jj) )
             ikbum1 = MAX( ikbu-1, 1 )
             ikbvm1 = MAX( ikbv-1, 1 )
             zfru = 0.5 * fse3u(ji,jj,ikbum1) / rdt
             zfrv = 0.5 * fse3v(ji,jj,ikbvm1) / rdt

and should becomes in v3.3beta (use of mbku mbkv arrays):

             zfru = 0.5 * fse3u(ji,jj,mbku(ji,jj)) / rdt
             zfrv = 0.5 * fse3v(ji,jj,mbkv(ji,jj)) / rdt

dynbfr.F90 (dyn_bfr) :

            ikbu = MIN( mbathy(ji+1,jj), mbathy(ji,jj) )
            ikbv = MIN( mbathy(ji,jj+1), mbathy(ji,jj) )
            ikbum1 = MAX( ikbu-1, 1 )
            ikbvm1 = MAX( ikbv-1, 1 )
            !
            ! Apply stability criteria on absolute value  : Min abs(bfr) => Max (bfr)
            zbfru = MAX( bfrua(ji,jj), fse3u(ji,jj,ikbu)*zinv )
            zbfrv = MAX( bfrva(ji,jj), fse3v(ji,jj,ikbv)*zinv )
            !
            ua(ji,jj,ikbum1) = ua(ji,jj,ikbum1) + zbfru * ub(ji,jj,ikbum1) / fse3u(ji,jj,ikbu)
            va(ji,jj,ikbvm1) = va(ji,jj,ikbvm1) + zbfrv * vb(ji,jj,ikbvm1) / fse3v(ji,jj,ikbv)

should becomes in the consolidation of v3.2 :

            ikbu = MIN( mbathy(ji+1,jj), mbathy(ji,jj) )
            ikbv = MIN( mbathy(ji,jj+1), mbathy(ji,jj) )
            ikbum1 = MAX( ikbu-1, 1 )
            ikbvm1 = MAX( ikbv-1, 1 )
            !
            ! Apply stability criteria on absolute value  : Min abs(bfr) => Max (bfr)
            zbfru = MAX( bfrua(ji,jj), fse3u(ji,jj,ikbum1)*zinv )
            zbfrv = MAX( bfrva(ji,jj), fse3v(ji,jj,ikbvm1)*zinv )
            !
            ua(ji,jj,ikbum1) = ua(ji,jj,ikbum1) + zbfru * ub(ji,jj,ikbum1) / fse3u(ji,jj,ikbum1)
            va(ji,jj,ikbvm1) = va(ji,jj,ikbvm1) + zbfrv * vb(ji,jj,ikbvm1) / fse3v(ji,jj,ikbvm1)

and should becomes in v3.3beta (use of mbku mbkv arrays) :

            ikbu = mbku(ji,jj)          ! ocean bottom u- & v-levels
            ikbv = mbkv(ji,jj)
            !
            ! Apply stability criteria on absolute value  : Min abs(bfr) => Max (bfr)
            zbfru = MAX( bfrua(ji,jj), fse3u(ji,jj,ikbu)*zinv )
            zbfrv = MAX( bfrva(ji,jj), fse3v(ji,jj,ikbv)*zinv )
            !
            ua(ji,jj,ikbu) = ua(ji,jj,ikbu) + zbfru * ub(ji,jj,ikbu) / fse3u(ji,jj,ikbu)
            va(ji,jj,ikbv) = va(ji,jj,ikbv) + zbfrv * vb(ji,jj,ikbv) / fse3v(ji,jj,ikbv)

or even in a simplier way :

            ikbu = mbku(ji,jj)          ! ocean bottom u- & v-levels
            ikbv = mbkv(ji,jj)
            !
            ! Apply stability criteria on absolute value  : abs(bfr/e3) < 1/(2dt) => bfr/e3 > -1/(2dt)
            ua(ji,jj,ikbu) = ua(ji,jj,ikbu) + MAX(  bfrua(ji,jj) / fse3u(ji,jj,ikbu) , zm1_2dt  ) * ub(ji,jj,ikbu)
            va(ji,jj,ikbv) = va(ji,jj,ikbv) + MAX(  bfrua(ji,jj) / fse3v(ji,jj,ikbu) , zm1_2dt  ) * vb(ji,jj,ikbv)

in dynspg_ts.F90 (dyn_spg_ts):

            ikbu = MIN( mbathy(ji+1,jj), mbathy(ji,jj) )
            ikbv = MIN( mbathy(ji,jj+1), mbathy(ji,jj) )
            !
            ! Apply stability criteria for bottom friction
            !RBbug for vvl and external mode we may need to
            ! use varying fse3
            zbfru  (ji,jj) = MAX( bfrua(ji,jj), fse3u(ji,jj,ikbu)*zcoef )
            zbfrv  (ji,jj) = MAX( bfrva(ji,jj), fse3v(ji,jj,ikbv)*zcoef )

should becomes in the consolidation of v3.2 :

            ikbu = MIN( mbathy(ji+1,jj), mbathy(ji,jj) )
            ikbv = MIN( mbathy(ji,jj+1), mbathy(ji,jj) )
            ikbum1 = MAX( ikbu-1, 1 )
            ikbvm1 = MAX( ikbv-1, 1 )
            !
            ! Apply stability criteria for bottom friction
            !RBbug for vvl and external mode we may need to
            ! use varying fse3
            zbfru  (ji,jj) = MAX( bfrua(ji,jj), fse3u(ji,jj,ikbum1)*zcoef )
            zbfrv  (ji,jj) = MAX( bfrva(ji,jj), fse3v(ji,jj,ikbvm1)*zcoef )

and should becomes in v3.3beta (use of mbku mbkv arrays) :

            ! Apply stability criteria for bottom friction
            !RBbug for vvl and external mode we may need to use varying fse3
            !!gm  Rq: the bottom e3 present the smallest variation, the use of e3u_0 is not a big approx.
            zbfru(ji,jj) = MAX(  bfrua(ji,jj) , fse3u(ji,jj,mbku(ji,jj)) * zcoef  )
            zbfrv(ji,jj) = MAX(  bfrva(ji,jj) , fse3v(ji,jj,mbkv(ji,jj)) * zcoef  )

Commit History (2)

ChangesetAuthorTimeChangeLog
2470cetlod2010-12-08T16:08:16+01:00

v3.2 : bug correction in zdfbrf.F90, dynbfr.F90 & dynspg_ts.F90 see ticket #767

2460gm2010-12-07T17:22:05+01:00

v3.3beta: #766 share the deepest ocean level indices (end) & #767 bug in dynbrf

Change History (11)

comment:1 Changed 14 years ago by gm

done in v3.3beta together with the use of mbk arrays (see changeset:2460)

comment:2 Changed 14 years ago by cetlod

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from new to closed

Done in v3.2 for consolidation, see changeset:2470

comment:3 Changed 8 years ago by nicolasmartin

  • Keywords 2010 Coastal Stream ocean ready added

comment:4 Changed 8 years ago by nicolasmartin

  • Keywords nemo_v3_2* added

comment:5 Changed 8 years ago by nicolasmartin

  • Milestone 2010 Stream 0: Coastal ocean ready deleted

Milestone 2010 Stream 0: Coastal ocean ready deleted

comment:6 Changed 8 years ago by nicolasmartin

  • Keywords Stream ocean ready added; CSor removed

comment:7 Changed 8 years ago by nicolasmartin

  • Keywords Stream removed

comment:8 Changed 8 years ago by nicolasmartin

  • Keywords ocean removed

comment:9 Changed 8 years ago by nicolasmartin

  • Keywords ready removed

comment:10 Changed 7 years ago by nemo

  • Keywords nemo_v3_2* removed

comment:11 Changed 2 years ago by nemo

  • Keywords OPA v3.2 added
Note: See TracTickets for help on using tickets.