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.
#69 (bug in calculating the Richardson number in zdfkpp.F90) – NEMO

Opened 16 years ago

Closed 16 years ago

Last modified 8 years ago

#69 closed Bug (fixed)

bug in calculating the Richardson number in zdfkpp.F90

Reported by: pmyers Owned by: gm
Priority: normal Milestone:
Component: OCE Version: v2
Severity: Keywords: ZDF
Cc: pmyers

Description

Dear NEMO team: I was looking at how the Richardson number is computed, and noticed it is done differently in two routines, zdftke.F90 and zdfkpp.F90. After examining the two, I think there may be a bug in the version of zdfkpp.F90 - In zdfkpp, the averaging factor of 0.5 is multiplied in after the shear is squared, and so I don't believe in gets correctly squared. Additionally, when the actual Richardson number is computed, epsilon is not added to the square of the shear term, so it would be possible to get division by zero errors when the shear is zero (first time step when starting model from rest, for exampe). I also note that the two computations are based on different velocities (ub,vb) and (un,vn).

Paul

Commit History (2)

ChangesetAuthorTimeChangeLog
5797dancopsey2015-10-15T13:04:41+02:00

[CICE#69]: Fix non-restartability of salinity-dependent freezing code

1082rblod2008-06-05T16:04:42+02:00

Bugs correction in KPP, see tickets #69 and #101

Change History (3)

comment:1 in reply to: ↑ description Changed 16 years ago by gm

  • Cc pmyers added
  • Keywords zdfkpp added
  • Owner changed from NEMO team to gm
  • Status changed from new to assigned
  • Summary changed from possible bug in calculating the Richardson number in zdfkpp.F90 to bug in calculating the Richardson number in zdfkpp.F90

Replying to pmyers@ualberta.ca:

Dear Paul:

I discover with you that the Richardson number is compyted differently in zdfkpp and zdftke. The former choose to averaged the square of the velocity shear, while the latter compute the square of the averaged shear. In other word the shear is larger in KPP than in TKE. I don't know for KPP, but for TKE, the choice was first made a long time ago for zdfric (Pacanoski & Philander formulation) and just apply in TKE. I completely agree on the error in zdfkpp (there is an additional factor of 0.5 which is wrong).

For the epsilon, on line 352 of zdfkpp and on line 369 of zdftke you have a 1.e-20 added so non division by zero (N.B. if not on all land points you must have a floating point exception!).

Last point: the time used on velocity. KPP is a diagnostic computation, un or ub can be used (I guess). TKE is a prognostic equation using a forward time stepping: ub have to be used ! Note that with energetic consideration it can be shown that the used of dz(ub)*dz(un) instead of dz( ub2) is better (in this case, the KE dissipated by vertical momentum mixing is used to create TKE). This should be change in forthcoming issue.

Gurvan

Dear NEMO team: I was looking at how the Richardson number is computed, and noticed it is done differently in two routines, zdftke.F90 and zdfkpp.F90. After examining the two, I think there may be a bug in the version of zdfkpp.F90 - In zdfkpp, the averaging factor of 0.5 is multiplied in after the shear is squared, and so I don't believe in gets correctly squared. Additionally, when the actual Richardson number is computed, epsilon is not added to the square of the shear term, so it would be possible to get division by zero errors when the shear is zero (first time step when starting model from rest, for exampe). I also note that the two computations are based on different velocities (ub,vb) and (un,vn).

Paul

comment:2 Changed 16 years ago by rblod

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

The additional factor 0.5 has been removed.

Thanks a lot for your comments

Rachid

comment:3 Changed 8 years ago by nicolasmartin

  • Keywords ZDF added; zdfkpp removed
Note: See TracTickets for help on using tickets.