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.
Changeset 8970 for branches/2017/dev_CNRS_2017/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90 – NEMO

Ignore:
Timestamp:
2017-12-11T10:01:56+01:00 (6 years ago)
Author:
gm
Message:

dev_CNRS_2017: bug correction in GLS + minor updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_CNRS_2017/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90

    r8882 r8970  
    4343   USE domvvl         ! domain: variable volume layer 
    4444   USE sbc_oce        ! surface boundary condition: ocean 
    45    USE zdf_oce        ! vertical physics: ocean variables 
    4645   USE zdfdrg         ! vertical physics: top/bottom drag coef. 
    4746   USE zdfmxl         ! vertical physics: mixed layer 
     
    185184      !! ** Action  : - en : now turbulent kinetic energy) 
    186185      !! --------------------------------------------------------------------- 
     186      USE zdf_oce , ONLY : en   ! ocean vertical physics 
     187      !! 
    187188      REAL(wp), DIMENSION(:,:,:) , INTENT(in   ) ::   pdepw          ! depth of w-points 
    188189      REAL(wp), DIMENSION(:,:,:) , INTENT(in   ) ::   p_e3t, p_e3w   ! level thickness (t- & w-points) 
     
    469470      !! ** Action  : - avt, avm : now vertical eddy diffusivity and viscosity (w-point) 
    470471      !!---------------------------------------------------------------------- 
     472      USE zdf_oce , ONLY : en, avtb, avmb, avtb_2d   ! ocean vertical physics 
     473      !! 
    471474      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pdepw          ! depth (w-points) 
    472475      REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   p_e3t, p_e3w   ! level thickness (t- & w-points) 
     
    618621      ! 
    619622      IF(ln_ctl) THEN 
    620          CALL prt_ctl( tab3d_1=en , clinfo1=' tke  - e: ', tab3d_2=avt, clinfo2=' t: ', ovlap=1, kdim=jpk) 
    621          CALL prt_ctl( tab3d_1=avm, clinfo1=' tke  - m: ', ovlap=1, kdim=jpk ) 
     623         CALL prt_ctl( tab3d_1=en   , clinfo1=' tke  - e: ', tab3d_2=p_avt, clinfo2=' t: ', ovlap=1, kdim=jpk) 
     624         CALL prt_ctl( tab3d_1=p_avm, clinfo1=' tke  - m: ', ovlap=1, kdim=jpk ) 
    622625      ENDIF 
    623626      ! 
     
    641644      !! ** Action  :   Increase by 1 the nstop flag is setting problem encounter 
    642645      !!---------------------------------------------------------------------- 
     646      USE zdf_oce , ONLY : ln_zdfiwm   ! Internal Wave Mixing flag 
     647      !! 
    643648      INTEGER ::   ji, jj, jk   ! dummy loop indices 
    644649      INTEGER ::   ios 
    645650      !! 
    646       NAMELIST/namzdf_tke/ rn_ediff, rn_ediss , rn_ebb , rn_emin  ,   & 
    647          &                 rn_emin0, rn_bshear, nn_mxl , ln_mxl0  ,   & 
    648          &                 rn_mxl0 , nn_pdl   , ln_drg , ln_lc    , rn_lc    ,   & 
     651      NAMELIST/namzdf_tke/ rn_ediff, rn_ediss , rn_ebb , rn_emin  ,          & 
     652         &                 rn_emin0, rn_bshear, nn_mxl , ln_mxl0  ,          & 
     653         &                 rn_mxl0 , nn_pdl   , ln_drg , ln_lc    , rn_lc,   & 
    649654         &                 nn_etau , nn_htau  , rn_efr    
    650655      !!---------------------------------------------------------------------- 
     
    711716      IF( nn_htau < 0   .OR.  nn_htau > 1 )   CALL ctl_stop( 'bad flag: nn_htau is 0, 1 or 2 ' ) 
    712717      IF( nn_etau == 3 .AND. .NOT. ln_cpl )   CALL ctl_stop( 'nn_etau == 3 : HF taum only known in coupled mode' ) 
    713  
     718      ! 
    714719      IF( ln_mxl0 ) THEN 
    715720         IF(lwp) WRITE(numout,*) '   use a surface mixing length = F(stress) :   set rn_mxl0 = rmxl_min' 
     
    728733         END SELECT 
    729734      ENDIF 
    730       !                               !* set vertical eddy coef. to the background value 
    731       DO jk = 1, jpk 
    732          avt(:,:,jk) = avtb(jk) * wmask(:,:,jk) 
    733          avm(:,:,jk) = avmb(jk) * wmask(:,:,jk) 
    734       END DO 
    735       dissl(:,:,:) = 1.e-12_wp 
    736       !                               
    737       CALL tke_rst( nit000, 'READ' )  !* read or initialize all required files 
     735      !                                !* read or initialize all required files 
     736      CALL tke_rst( nit000, 'READ' )      ! (en, avt_k, avm_k, dissl)  
    738737      ! 
    739738   END SUBROUTINE zdf_tke_init 
     
    750749      !!                set to rn_emin or recomputed  
    751750      !!---------------------------------------------------------------------- 
     751      USE zdf_oce , ONLY : en, avt_k, avm_k   ! ocean vertical physics 
     752      !! 
    752753      INTEGER         , INTENT(in) ::   kt     ! ocean time-step 
    753754      CHARACTER(len=*), INTENT(in) ::   cdrw   ! "READ"/"WRITE" flag 
     
    772773            ELSE                                          ! start TKE from rest 
    773774               IF(lwp) WRITE(numout,*) '   ==>>   previous run without TKE scheme, set en to background values' 
    774                en(:,:,:) = rn_emin * wmask(:,:,:) 
     775               en   (:,:,:) = rn_emin * wmask(:,:,:) 
     776               dissl(:,:,:) = 1.e-12_wp 
    775777               ! avt_k, avm_k already set to the background value in zdf_phy_init 
    776778            ENDIF 
    777779         ELSE                                   !* Start from rest 
    778780            IF(lwp) WRITE(numout,*) '   ==>>   start from rest: set en to the background value' 
    779             en(:,:,:) = rn_emin * wmask(:,:,:) 
     781            en   (:,:,:) = rn_emin * wmask(:,:,:) 
     782            dissl(:,:,:) = 1.e-12_wp 
    780783            ! avt_k, avm_k already set to the background value in zdf_phy_init 
    781784         ENDIF 
Note: See TracChangeset for help on using the changeset viewer.