Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#1935 closed Bug (fixed)

Kinetic Energy calculation is wrong

Reported by: Tim Graham Owned by: nemo
Priority: low Milestone:
Component: OPA Version: release-3.6
Keywords: eken DIA diagnostics Cc:
Severity: Workplan status:
Comments:

Description (last modified by Nicolas MARTIN)

Context


The calculation of KE in diawri.F90 is not correct. Also note that using the short name "eken" is misleading as this is not the Kinetic Energy and not the Eddy Kinetic Energy

Analysis


In the code at line 302 we have

         zztmp   = 1._wp / ( e1e2t(ji,jj) * e3t_n(ji,jj,jk) )
         zztmpx  = 0.5 * (  un(ji-1,jj,jk) * un(ji-1,jj,jk) * e2u(ji-1,jj) * e3u_n(ji-1,jj,jk)    &
            &             + un(ji  ,jj,jk) * un(ji  ,jj,jk) * e2u(ji  ,jj) * e3u_n(ji  ,jj,jk) )  &
            &          *  zztmp 
         !
         zztmpy  = 0.5 * (  vn(ji,jj-1,jk) * vn(ji,jj-1,jk) * e1v(ji,jj-1) * e3v_n(ji,jj-1,jk)    &
            &             + vn(ji,jj  ,jk) * vn(ji,jj  ,jk) * e1v(ji,jj  ) * e3v_n(ji,jj  ,jk) )  &
            &          *  zztmp 
         !
         rke(ji,jj,jk) = 0.5_wp * ( zztmpx + zztmpy )

i.e. velocity * velocity * length * thickness / (area * thickness) giving units of m/s2 rather than m2/s2 as we would expect.


Fix


         zztmp   = r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) )
         zztmpx  = 0.5 * (  un(ji-1,jj,jk) * un(ji-1,jj,jk) * e1e2u(ji-1,jj) * e3u_n(ji-1,jj,jk)    &
            &             + un(ji  ,jj,jk) * un(ji  ,jj,jk) * e1e2u(ji  ,jj) * e3u_n(ji  ,jj,jk) )  &
            &          *  zztmp 
         !
         zztmpy  = 0.5 * (  vn(ji,jj-1,jk) * vn(ji,jj-1,jk) * e1e2v(ji,jj-1) * e3v_n(ji,jj-1,jk)    &
            &             + vn(ji,jj  ,jk) * vn(ji,jj  ,jk) * e1e2v(ji,jj  ) * e3v_n(ji,jj  ,jk) )  &
            &          *  zztmp 
         !
         rke(ji,jj,jk) = 0.5_wp * ( zztmpx + zztmpy )

Commit History (3)

ChangesetAuthorTimeChangeLog
8473timgraham2017-08-30T11:38:39+02:00

Corrected fix for #1935 (not using variables that don't exist in nemo_v3_6_stable)

8465timgraham2017-08-25T10:34:47+02:00

#1934 and #1935 - correct calculation of KE in diawri.F90

8464timgraham2017-08-25T10:31:40+02:00

#1934 and #1935 - correct KE calculation in diawri.F90

Change History (4)

comment:1 Changed 3 months ago by Tim Graham

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

Fixed at r8464 of nemo_v3_6_stable and r8465 in the trunk

comment:2 Changed 3 months ago by arsouze

  • Resolution fixed deleted
  • Status changed from closed to reopened

It looks like variables r1_e1e2t, e1e2u, e1e2v are not defined in NEMO_v3_6_STABLE.

comment:3 Changed 3 months ago by Tim Graham

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

Sorry about that. Now fixed at r8473

comment:4 Changed 3 months ago by Nicolas MARTIN

  • Description modified (diff)
Note: See TracTickets for help on using tickets.