id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 2406,Bugs in tke with ice shelves,mathiot,mathiot,"{{{#!comment BE CAREFUL !!! Due to dynamic behaviour of this ticket creation page, it is highly recommend to set first all other fields before writing the ticket description below. If you have lost your draft after an unwanted reload, you can click on the link 'Restore Form' in the contextual menu upper right to recover it. Remove these lines after reading. }}} ==== 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): {{{#!diff @@ -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. {{{#!diff @@ -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. {{{#!diff @@ -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 ().",Bug,closed,high,,ZDF,v4.0.*,critical,fixed,"ISF, TKE",