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 13497 for NEMO/trunk/src/OCE/ZDF/zdftke.F90 – NEMO

Ignore:
Timestamp:
2020-09-21T14:37:46+02:00 (4 years ago)
Author:
techene
Message:

re-introduce comments that have been erased by loops transformation see #2525

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/ZDF/zdftke.F90

    r13472 r13497  
    238238      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    239239      ! 
    240       DO_2D( 0, 0, 0, 0 ) 
     240      DO_2D( 0, 0, 0, 0 )         ! en(1)   = rn_ebb taum / rau0  (min value rn_emin0) 
    241241!! clem: this should be the right formulation but it makes the model unstable unless drags are calculated implicitly 
    242242!!       one way around would be to increase zbbirau  
     
    325325      !                     ! zdiag : diagonal zd_up : upper diagonal zd_lw : lower diagonal 
    326326      ! 
    327       IF( nn_pdl == 1 ) THEN      !* Prandtl number = F( Ri ) 
     327      IF( nn_pdl == 1 ) THEN          !* Prandtl number = F( Ri ) 
    328328         DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
    329329            !                             ! local Richardson number 
     
    338338      ENDIF 
    339339      !          
    340       DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
     340      DO_3D( 0, 0, 0, 0, 2, jpkm1 )   !* Matrix and right hand side in en 
    341341         zcof   = zfact1 * tmask(ji,jj,jk) 
    342342         !                                   ! A minimum of 2.e-5 m2/s is imposed on TKE vertical 
     
    358358      END_3D 
    359359      !                          !* Matrix inversion from level 2 (tke prescribed at level 1) 
    360       DO_3D( 0, 0, 0, 0, 3, jpkm1 ) 
     360      DO_3D( 0, 0, 0, 0, 3, jpkm1 )                ! First recurrence : Dk = Dk - Lk * Uk-1 / Dk-1 
    361361         zdiag(ji,jj,jk) = zdiag(ji,jj,jk) - zd_lw(ji,jj,jk) * zd_up(ji,jj,jk-1) / zdiag(ji,jj,jk-1) 
    362362      END_3D 
    363       DO_2D( 0, 0, 0, 0 ) 
     363      DO_2D( 0, 0, 0, 0 )                          ! Second recurrence : Lk = RHSk - Lk / Dk-1 * Lk-1 
    364364         zd_lw(ji,jj,2) = en(ji,jj,2) - zd_lw(ji,jj,2) * en(ji,jj,1)    ! Surface boudary conditions on tke 
    365365      END_2D 
     
    367367         zd_lw(ji,jj,jk) = en(ji,jj,jk) - zd_lw(ji,jj,jk) / zdiag(ji,jj,jk-1) *zd_lw(ji,jj,jk-1) 
    368368      END_3D 
    369       DO_2D( 0, 0, 0, 0 ) 
     369      DO_2D( 0, 0, 0, 0 )                          ! thrid recurrence : Ek = ( Lk - Uk * Ek+1 ) / Dk 
    370370         en(ji,jj,jpkm1) = zd_lw(ji,jj,jpkm1) / zdiag(ji,jj,jpkm1) 
    371371      END_2D 
     
    373373         en(ji,jj,jk) = ( zd_lw(ji,jj,jk) - zd_up(ji,jj,jk) * en(ji,jj,jk+1) ) / zdiag(ji,jj,jk) 
    374374      END_3D 
    375       DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
     375      DO_3D( 0, 0, 0, 0, 2, jpkm1 )                ! set the minimum value of tke 
    376376         en(ji,jj,jk) = MAX( en(ji,jj,jk), rn_emin ) * wmask(ji,jj,jk) 
    377377      END_3D 
     
    396396         END_2D 
    397397      ELSEIF( nn_etau == 3 ) THEN       !* penetration belox the mixed layer (HF variability) 
    398          DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
     398         DO_3D( 0, 0, 0, 0, 2, jpkm1 )         ! nn_eice=0 : ON below sea-ice ; nn_eice>0 : partly OFF 
    399399            ztx2 = utau(ji-1,jj  ) + utau(ji,jj) 
    400400            zty2 = vtau(ji  ,jj-1) + vtau(ji,jj) 
     
    470470         zraug = vkarmn * 2.e5_wp / ( rho0 * grav ) 
    471471#if ! defined key_si3 && ! defined key_cice 
    472          DO_2D( 0, 0, 0, 0 ) 
     472         DO_2D( 0, 0, 0, 0 )                  ! No sea-ice 
    473473            zmxlm(ji,jj,1) =  zraug * taum(ji,jj) * tmask(ji,jj,1) 
    474474         END_2D 
     
    481481            END_2D 
    482482            ! 
    483          CASE( 1 )                           ! scaling with constant sea-ice thickness 
     483         CASE( 1 )                      ! scaling with constant sea-ice thickness 
    484484            DO_2D( 0, 0, 0, 0 ) 
    485485               zmxlm(ji,jj,1) =  ( ( 1._wp - fr_i(ji,jj) ) * zraug * taum(ji,jj) + & 
     
    487487            END_2D 
    488488            ! 
    489          CASE( 2 )                                 ! scaling with mean sea-ice thickness 
     489         CASE( 2 )                      ! scaling with mean sea-ice thickness 
    490490            DO_2D( 0, 0, 0, 0 ) 
    491491#if defined key_si3 
     
    499499            END_2D 
    500500            ! 
    501          CASE( 3 )                                 ! scaling with max sea-ice thickness 
     501         CASE( 3 )                      ! scaling with max sea-ice thickness 
    502502            DO_2D( 0, 0, 0, 0 ) 
    503503               zmaxice = MAXVAL( h_i(ji,jj,:) ) 
     
    551551         ! 
    552552      CASE ( 2 )           ! |dk[xml]| bounded by e3t : 
    553          DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
     553         DO_3D( 0, 0, 0, 0, 2, jpkm1 )        ! from the surface to the bottom : 
    554554            zmxlm(ji,jj,jk) =   & 
    555555               &    MIN( zmxlm(ji,jj,jk-1) + e3t(ji,jj,jk-1,Kmm), zmxlm(ji,jj,jk) ) 
    556556         END_3D 
    557          DO_3DS( 0, 0, 0, 0, jpkm1, 2, -1 ) 
     557         DO_3DS( 0, 0, 0, 0, jpkm1, 2, -1 )   ! from the bottom to the surface : 
    558558            zemxl = MIN( zmxlm(ji,jj,jk+1) + e3t(ji,jj,jk+1,Kmm), zmxlm(ji,jj,jk) ) 
    559559            zmxlm(ji,jj,jk) = zemxl 
     
    562562         ! 
    563563      CASE ( 3 )           ! lup and ldown, |dk[xml]| bounded by e3t : 
    564          DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
     564         DO_3D( 0, 0, 0, 0, 2, jpkm1 )        ! from the surface to the bottom : lup 
    565565            zmxld(ji,jj,jk) =    & 
    566566               &    MIN( zmxld(ji,jj,jk-1) + e3t(ji,jj,jk-1,Kmm), zmxlm(ji,jj,jk) ) 
    567567         END_3D 
    568          DO_3DS( 0, 0, 0, 0, jpkm1, 2, -1 ) 
     568         DO_3DS( 0, 0, 0, 0, jpkm1, 2, -1 )   ! from the bottom to the surface : ldown 
    569569            zmxlm(ji,jj,jk) =   & 
    570570               &    MIN( zmxlm(ji,jj,jk+1) + e3t(ji,jj,jk+1,Kmm), zmxlm(ji,jj,jk) ) 
     
    582582      !                     !  Vertical eddy viscosity and diffusivity  (avm and avt) 
    583583      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    584       DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     584      DO_3D( 0, 0, 0, 0, 1, jpkm1 )   !* vertical eddy viscosity & diffivity at w-points 
    585585         zsqen = SQRT( en(ji,jj,jk) ) 
    586586         zav   = rn_ediff * zmxlm(ji,jj,jk) * zsqen 
     
    591591      ! 
    592592      ! 
    593       IF( nn_pdl == 1 ) THEN      !* Prandtl number case: update avt 
     593      IF( nn_pdl == 1 ) THEN          !* Prandtl number case: update avt 
    594594         DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
    595595            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) 
Note: See TracChangeset for help on using the changeset viewer.