Opened 4 weeks ago

Closed 3 days ago

Last modified 3 days ago

#2406 closed Bug (fixed)

Bugs in tke with ice shelves

Reported by: mathiot Owned by: mathiot
Priority: high Milestone:
Component: ZDF Version: 4.0-HEAD
Severity: critical Keywords: ISF, TKE
Cc:

Description

Context

  • If tke switch on, nn_pdl == 1 and ice shelf cavities opened, cells at the ocean/ice shelf interface are warming and freshening over time to reach unrealistic temperature and salinity even without any melting/freezing at the ice shelf/ocean interface.

Analysis

  • avt is wrongly masked in the top cells. tmask is used instead of wmask in tke.
  • In the mean time, I found some bugs in the computation of en(:,:,1):
    • en(jk=1) overwritten to different value when top and bottom drag contribution included (only if ice shelf cavities opened)
    • case \ln_drg = .false. and ln_OFF = .true. in namdrg\ gives a different result (ORCA2) than \ln_drg = .true. and ln_OFF = .true. in namdrg\.

This is affecting NEMO v4 and the trunk.

Fix


Avt masking (zdftke):

@@ -517,7 +517,7 @@
       !
       IF( nn_pdl == 1 ) THEN      !* Prandtl number case: update avt
          DO_3D_00_00( 2, jpkm1 )
-            p_avt(ji,jj,jk)   = MAX( apdlr(ji,jj,jk) * p_avt(ji,jj,jk), avtb_2d(ji,jj) * avtb(jk) ) * tmask(ji,jj,jk)
+            p_avt(ji,jj,jk)   = MAX( apdlr(ji,jj,jk) * p_avt(ji,jj,jk), avtb_2d(ji,jj) * avtb(jk) ) * wmask(ji,jj,jk)
          END_3D
       ENDIF

en surface value:
We should first set up the value at surface (level 1). If ln_drg = .fasle., en(ji,jj,mikt(ji,jj)) is initialised to 0 as en(ji,jj,mbkt(ji,jj)+1) is.

@@ -213,15 +213,10 @@
       !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       !                     !  Surface/top/bottom boundary condition on tke
       !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-      
+      !      
       DO_2D_00_00
          en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1)
       END_2D
-      IF ( ln_isfcav ) THEN
-         DO_2D_00_00
-            en(ji,jj,mikt(ji,jj)) = rn_emin * tmask(ji,jj,1)
-         END_2D
-      ENDIF
       !
       !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       !                     !  Bottom boundary condition on tke

If ln_drag, en(ji,jj,mikt(ji,jj)) should be modified only beneath the ice shelves otherwise it will overwrite the ocean surface (jk=1) value. So we need to use tmask(ji,jj,1) and (1._wp - tmask(ji,jj,1)) * ssmask(ji,jj) to separate case under ice shelf and in open ocean.

@@ -248,7 +248,7 @@
                !                             ! where 0.001875 = (rn_ebb0/rho0) * 0.5 = 3.75*0.5/1000.  (CAUTION CdU<0)
                zetop = - 0.001875_wp * rCdU_top(ji,jj) * SQRT(  ( zmsku*( uu(ji,jj,mikt(ji,jj),Kbb)+uu(ji-1,jj,mikt(ji,jj),Kbb) ) )**2  &
                   &                                           + ( zmskv*( vv(ji,jj,mikt(ji,jj),Kbb)+vv(ji,jj-1,mikt(ji,jj),Kbb) ) )**2  )
-               en(ji,jj,mikt(ji,jj)) = MAX( zetop, rn_emin ) * (1._wp - tmask(ji,jj,1))   ! masked at ocean surface
+               en(ji,jj,mikt(ji,jj)) = en(ji,jj,1) * tmask(ji,jj,1) + MAX( zetop, rn_emin ) * (1._wp - tmask(ji,jj,1)) * ssmask(ji,jj)   ! masked at ocean surface
             END_2D
          ENDIF

The MAX( zebot, rn_emin ) used to compute the bottom and top boundary condition due to drag (case ln_drg = .true. in tke namelist) leads to different result between the case:

  • ln_drg = .false. and ln_OFF = .true. in namdrg ⇒ bottom boundary is 0.0 (initialisation)
  • ln_drg = .true. and ln_OFF = .true. in namdrg ⇒ zebot = 0 ⇒ bottom boundary is rn_emin

I think both cases should give the same answer. I changed MAX( zebot, rn_emin ) by zebot (ie initialised bottom boundary condition to 0.0) and in this case both simulations gave the same results ().

Commit History (10)

ChangesetAuthorTimeChangeLog
12703mathiot2020-04-07T11:18:07+02:00

ticket #2406: too long line (> 132 cols)

12702mathiot2020-04-07T11:16:52+02:00

ticket #2406: too long line (> 132 cols)

12700mathiot2020-04-06T21:17:55+02:00

ticket #2406: delete temporary branch (ticket2406_r4.0-HEAD)

12699mathiot2020-04-06T21:15:07+02:00

ticket #2406: delete temporary branch

12698mathiot2020-04-06T21:10:53+02:00

ticket #2406: fix ticket #2406 for trunk

12697mathiot2020-04-06T20:14:06+02:00

ticket #2406: fix ticket #2406 for r4.0-HEAD

12696mathiot2020-04-06T20:09:58+02:00

ticket #2406: implement changes (r4.0-HEAD version of the ticket branch)

12694mathiot2020-04-06T20:03:23+02:00

ticket #2406: implement changes (no changes in results as isf and tke not tested by SETTE)

12693mathiot2020-04-06T18:35:37+02:00

ticket #2406: branch for correction in r4.0-HEAD

12543mathiot2020-03-12T18:19:00+01:00

create branch for ticket #2406 (tke and isf)

Change History (16)

comment:1 Changed 4 weeks ago by mathiot

In 12543:

create branch for ticket #2406 (tke and isf)

comment:2 Changed 13 days ago by clevy

  • Version changed from release-4.0 to 4.0-HEAD

comment:3 Changed 4 days ago by davestorkey

Review: I agree with the proposed changes apart from I'm not sure we need ssmask in this line:

en(ji,jj,mikt(ji,jj)) = en(ji,jj,1) * tmask(ji,jj,1) + MAX( zetop, rn_emin ) * (1._wp - tmask(ji,jj,1)) * ssmask(ji,jj) ! masked at ocean surface

Agreed with Pierre that the last point he raises can be left open in a new ticket.

comment:4 Changed 4 days ago by davestorkey

Review: I agree with the proposed changes apart from I'm not sure we need ssmask in this line:

en(ji,jj,mikt(ji,jj)) = en(ji,jj,1) * tmask(ji,jj,1) + MAX( zetop, rn_emin ) * (1._wp - tmask(ji,jj,1)) * ssmask(ji,jj) ! masked at ocean surface

Agreed with Pierre that the last point he raises can be left open in a new ticket.

comment:5 Changed 3 days ago by mathiot

ssmask is needed to be sure 'en' at the top interface is 0 where there is no ocean.

comment:6 Changed 3 days ago by mathiot

In 12693:

ticket #2406: branch for correction in r4.0-HEAD

comment:7 Changed 3 days ago by mathiot

Sette results (same results for the fix in the r4.0-HEAD):

Current code is : NEMO/branches/2020/ticket2406_trunk @ r12692  ( last change @ r12692 )

SETTE validation report generated for : 

       NEMO/branches/2020/ticket2406_trunk @ r12692+ (last changed revision)

       on XC40_METO_IFORT arch file


!!---------------1st pass------------------!!

   !----restart----!   
WGYRE_PISCES_ST              run.stat    restartability  passed :  12692+
WGYRE_PISCES_ST              tracer.stat restartability  passed :  12692+
WORCA2_ICE_PISCES_ST         run.stat    restartability  passed :  12692+
WORCA2_ICE_PISCES_ST         tracer.stat restartability  passed :  12692+
WORCA2_OFF_PISCES_ST         tracer.stat restartability  passed :  12692+
WAMM12_ST                    run.stat    restartability  passed :  12692+
WORCA2_SAS_ICE_ST            run.stat    restartability  passed :  12692+
WAGRIF_DEMO_ST               run.stat    restartability  passed :  12692+
WSPITZ12_ST                  run.stat    restartability  passed :  12692+
WISOMIP_ST                   run.stat    restartability  passed :  12692+
WOVERFLOW_ST                 run.stat    restartability  passed :  12692+
WLOCK_EXCHANGE_ST            run.stat    restartability  passed :  12692+
WVORTEX_ST                   run.stat    restartability  passed :  12692+
WICE_AGRIF_ST                run.stat    restartability  passed :  12692+

   !----repro----!   
WGYRE_PISCES_ST              run.stat    reproducibility passed :  12692+
WGYRE_PISCES_ST              tracer.stat reproducibility passed :  12692+
WORCA2_ICE_PISCES_ST         run.stat    reproducibility passed :  12692+
WORCA2_ICE_PISCES_ST         tracer.stat reproducibility passed :  12692+
WORCA2_OFF_PISCES_ST         tracer.stat reproducibility passed :  12692+
WAMM12_ST                    run.stat    reproducibility passed :  12692+
WORCA2_SAS_ICE_ST            run.stat    reproducibility passed :  12692+
WORCA2_ICE_OBS_ST            run.stat    reproducibility passed :  12692+
WAGRIF_DEMO_ST               run.stat    reproducibility passed :  12692+
WSPITZ12_ST                  run.stat    reproducibility passed :  12692+
WISOMIP_ST                   run.stat    reproducibility passed :  12692+
WVORTEX_ST                   run.stat    reproducibility passed :  12692+
WICE_AGRIF_ST                run.stat    reproducibility passed :  12692+

   !----agrif check----!   
ORCA2 AGRIF vs ORCA2 NOAGRIF run.stat    unchanged  -    passed :  12692+ 12692+

   !----result comparison check----!   

check result differences between :
VALID directory : /projects/jmmp/pmathiot/NEMO/NEMO_dev/NEMO/branches/2020/ticket2406_trunk/NEMO_VALIDATION at rev 12692+
and
REFERENCE directory : /projects/jmmp/pmathiot/NEMO/NEMO_dev/NEMO/trunk/NEMO_VALIDATION at rev 12530

WGYRE_PISCES_ST       run.stat    files are identical  
WGYRE_PISCES_ST       tracer.stat files are identical  
WORCA2_ICE_PISCES_ST  run.stat    files are identical  
WORCA2_OFF_PISCES_ST  tracer.stat files are identical  
WAMM12_ST             run.stat    files are identical  
WISOMIP_ST            run.stat    files are identical  
WORCA2_SAS_ICE_ST     run.stat    files are identical  
WAGRIF_DEMO_ST        run.stat    files are identical  
WSPITZ12_ST           run.stat    files are identical  
WISOMIP_ST            run.stat    files are identical  
WVORTEX_ST            run.stat    files are identical  
WICE_AGRIF_ST         run.stat    files are identical  

comment:8 Changed 3 days ago by mathiot

In 12694:

ticket #2406: implement changes (no changes in results as isf and tke not tested by SETTE)

comment:9 Changed 3 days ago by mathiot

In 12696:

ticket #2406: implement changes (r4.0-HEAD version of the ticket branch)

comment:10 Changed 3 days ago by mathiot

In 12697:

ticket #2406: fix ticket #2406 for r4.0-HEAD

comment:11 Changed 3 days ago by mathiot

In 12698:

ticket #2406: fix ticket #2406 for trunk

comment:12 Changed 3 days ago by mathiot

In 12699:

ticket #2406: delete temporary branch

comment:13 Changed 3 days ago by mathiot

In 12700:

ticket #2406: delete temporary branch (ticket2406_r4.0-HEAD)

comment:14 Changed 3 days ago by mathiot

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

comment:15 Changed 3 days ago by mathiot

In 12702:

ticket #2406: too long line (> 132 cols)

comment:16 Changed 3 days ago by mathiot

In 12703:

ticket #2406: too long line (> 132 cols)

Note: See TracTickets for help on using tickets.