Opened 3 months ago

Closed 5 weeks 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: release-4.0
Severity: major Keywords: GLS neumann bed condition
Cc: Branch review: failed
MP ready?: no Task progress: Unspecified



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

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?


Tides and vertical mixing considerably affected

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


Fixes are easy just set en at bed as before

Multiply zmsku/v by 0.5

Commit History (2)


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


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

Change History (5)

comment:1 Changed 5 weeks 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 ?


comment:2 Changed 5 weeks 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?


comment:3 Changed 5 weeks ago by jchanut

In 14156:

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

comment:4 Changed 5 weeks ago by jchanut

In 14157:

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

comment:5 Changed 5 weeks ago by jchanut

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