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.
#2560 (GLS Neumann Boundary Condition not Set and Velocity average to T point requires 0.5 factor) – NEMO

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#2560 closed Bug (fixed)

GLS Neumann Boundary Condition not Set and Velocity average to T point requires 0.5 factor

Reported by: deazer Owned by: jchanut
Priority: low Milestone: Unscheduled
Component: ZDF Version: v4.0
Severity: major Keywords: GLS bed condition neumann v4.0
Cc:

Description

Context

2 related bugs in GLS
en not set at the bed for Neumann bdy condition

velocity points not correctly scales by 0.5 to give mean at t point

Bugs came in at
https://forge.ipsl.jussieu.fr/nemo/changeset?sfp_email=&sfph_mail=&reponame=&new=8882%40branches%2F2017%2Fdev_CNRS_2017%2FNEMOGCM%2FNEMO%2FOPA_SRC%2FZDF%2Fzdfgls.F90&old=8873%40branches%2F2017%2Fdev_CNRS_2017%2FNEMOGCM%2FNEMO%2FOPA_SRC%2FZDF%2Fzdfgls.F90

https://forge.ipsl.jussieu.fr/nemo/browser/branches/2017/dev_CNRS_2017/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90?rev=8882

Previously en in Neumann Bed Condition set directly at the bed:

390                     en(ji,jj,ibot) = MAX( rc02r * ustarb2(ji,jj), rn_emin ) 

After this change only a local variable is set but it is never used

407                     z_en = MAX( rc02r * ustar2_top(ji,jj), rn_emin ) * ( 1._wp - tmask(ji,jj,1) ) 

Is this on purpose. It seems it is just an unintended omission?

2nd bug is about meaning of velocity points to t points:

Uses zmasku/v:

187                  zmsku = ( 2. - umask(ji-1,jj,mikt(ji,jj)) * umask(ji,jj,mikt(ji,jj)) )

will be 2 if any point sea or 1 if both sea

then means the velocity points:

189                  ustar2_top(ji,jj) = - rCdU_top(ji,jj) * SQRT(  ( zmsku*( ub(ji,jj,mikt(ji,jj))+ub(ji-1,jj,mikt(ji,jj)) ) )**2  & 
   190                     &                                         + ( zmskv*( vb(ji,jj,mikt(ji,jj))+vb(ji,jj-1,mikt(ji,jj)) ) )**2  )

but appears to miss a factor of 0.5??

e.g, 2,1 ought to be 1,0.5? Or have a missed a factor of 0.5 elsewhere?

Analysis

Tides and vertical mixing considerably affected

Intriguingly both bugs at the same time give reasonable tides but individually give poor tides.

Fix

Fixes are easy just set en at bed as before

Multiply zmsku/v by 0.5

Commit History (2)

ChangesetAuthorTimeChangeLog
14157jchanut2020-12-11T11:36:52+01:00

#2560, correct bottom Neumann boundary conditions and bottom friction velocities

14156jchanut2020-12-11T11:36:17+01:00

#2560, correct bottom Neumann boundary conditions and bottom friction velocities

Change History (6)

comment:1 Changed 3 years ago by jchanut

  • Owner changed from systeam to jchanut
  • Status changed from new to assigned

Congrats and many thanks, these are indeed 2 big bugs !

  • zmsku/zmskv should indeed be multiplied by 0.5
  • The bottom kinetic energy should be set, even with Neumann boundary condition. Indeed, although this value does not interfere with the implicit calculation of the kinetic energy (en) in that case, it is latter used to set the bottom flux of the "psi" equation. For stability reasons, instead of using the analytical bc and the friction velocity, I found it much better to use model variables and a mid-cell interpolation of en above the bottom. The use of avm at previous time step in the flux expression is also motivated by this. If I remember well, GOTM uses a similar trick, this part being more trickier than it looks to maintain stability and a reasonable (say smooth) bottom stress in places where bottom log layers may be explicitly resolved (i.e. certainly on the shelves presumably in your case). The compensation takes place there.

This said, changing the bottom friction (masks) alone should not change anything as it is. Could you confirm ?

Jérôme

comment:2 Changed 3 years ago by deazer

Thanks Jérôme for your detailed reply,

You are right without en set at the bottom the mask should have no effect, I have ran a quick test to confirm that, and that is the case.(though the error would still stand in the Dirichlet case).

If your happy with this I can put back into 4.0.head as bug fix.. need to replicate in recent merge?

Thanks!
Enda

comment:3 Changed 3 years ago by jchanut

In 14156:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:4 Changed 3 years ago by jchanut

In 14157:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

comment:5 Changed 3 years ago by jchanut

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

comment:6 Changed 2 years ago by nemo

  • Keywords v4.0 added
Note: See TracTickets for help on using tickets.