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 8627 for branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90 – NEMO

Ignore:
Timestamp:
2017-10-16T16:19:11+02:00 (7 years ago)
Author:
gm
Message:

#1963 : Correct implementation of CMIP6 KE dissipation + move EKE<=>PE diag in traadv_eiv (in both cases, no more need of ln_trd_KE=T)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90

    r6751 r8627  
    2020   USE zdf_oce         ! ocean vertical physics 
    2121   USE phycst          ! physical constants 
     22   USE dynadv          ! dynamics: vector invariant versus flux form 
     23   USE dynspg_oce, ONLY: lk_dynspg_ts 
     24   USE zdfbfr          ! Bottom friction setup 
     25   ! 
    2226   USE in_out_manager  ! I/O manager 
     27   USE iom             ! I/O library 
    2328   USE lib_mpp         ! MPP library 
    24    USE zdfbfr          ! Bottom friction setup 
    2529   USE wrk_nemo        ! Memory Allocation 
    2630   USE timing          ! Timing 
    27    USE dynadv          ! dynamics: vector invariant versus flux form 
    28    USE dynspg_oce, ONLY: lk_dynspg_ts 
    2931 
    3032   IMPLICIT NONE 
     
    6971      INTEGER  ::   ikbu, ikbv   ! local integers 
    7072      REAL(wp) ::   z1_p2dt, zcoef, zzwi, zzws, zrhs   ! local scalars 
    71       REAL(wp) ::   ze3ua, ze3va 
     73      REAL(wp) ::   ze3ua, ze3va, zzz 
     74      REAL(wp), POINTER, DIMENSION(:,:)   ::  z2d 
    7275      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zwi, zwd, zws 
    7376      !!---------------------------------------------------------------------- 
     
    257260      END DO 
    258261 
    259 #if ! defined key_dynspg_ts 
    260       ! Normalization to obtain the general momentum trend ua 
    261       DO jk = 1, jpkm1 
    262          DO jj = 2, jpjm1    
    263             DO ji = fs_2, fs_jpim1   ! vector opt. 
    264                ua(ji,jj,jk) = ( ua(ji,jj,jk) - ub(ji,jj,jk) ) * z1_p2dt 
    265             END DO 
    266          END DO 
    267       END DO 
    268 #endif 
    269  
    270262      ! 3. Vertical diffusion on v 
    271263      ! --------------------------- 
     
    357349      END DO 
    358350 
    359       ! Normalization to obtain the general momentum trend va 
     351      IF( iom_use( 'dispkevfo' ) ) THEN   ! ocean kinetic energy dissipation per unit area 
     352         !                                ! due to v friction (v=vertical)  
     353         !                                ! see NEMO_book appendix C, §C.8 (N.B. here averaged at t-points) 
     354         !                                ! Note that formally, in a Leap-Frog environment, the shear**2 should be the product of  
     355         !                                ! now by before shears, i.e. the source term of TKE (local positivity is not ensured). 
     356         CALL wrk_alloc(jpi,jpj,   z2d ) 
     357         z2d(:,:) = 0._wp 
     358         DO jk = 1, jpkm1 
     359            DO jj = 2, jpjm1 
     360               DO ji = 2, jpim1 
     361                  z2d(ji,jj) = z2d(ji,jj)  +  (                                                                                  & 
     362                     &   avmu(ji  ,jj,jk) * ( ua(ji  ,jj,jk-1) - ua(ji  ,jj,jk) )**2 / fse3uw(ji  ,jj,jk) * wumask(ji  ,jj,jk)   & 
     363                     & + avmu(ji-1,jj,jk) * ( ua(ji-1,jj,jk-1) - ua(ji-1,jj,jk) )**2 / fse3uw(ji-1,jj,jk) * wumask(ji-1,jj,jk)   & 
     364                     & + avmv(ji,jj  ,jk) * ( va(ji,jj  ,jk-1) - va(ji,jj  ,jk) )**2 / fse3vw(ji,jj  ,jk) * wvmask(ji,jj  ,jk)   & 
     365                     & + avmv(ji,jj-1,jk) * ( va(ji,jj-1,jk-1) - va(ji,jj-1,jk) )**2 / fse3vw(ji,jj-1,jk) * wvmask(ji,jj-1,jk)   & 
     366                     &                        ) 
     367               END DO 
     368            END DO 
     369         END DO 
     370         zzz= - 0.5_wp* rau0           ! caution sign minus here 
     371         z2d(:,:) = zzz * z2d(:,:)  
     372         CALL lbc_lnk( z2d,'T', 1. ) 
     373         CALL iom_put( 'dispkevfo', z2d ) 
     374         CALL wrk_dealloc(jpi,jpj,   z2d ) 
     375      ENDIF 
     376 
    360377#if ! defined key_dynspg_ts 
     378!!gm this can be removed if tranxt is changed like in the trunk so that implicit outcome with  
     379!!gm the after velocity, not a trend 
     380      ! Normalization to obtain the general momentum trend ua 
    361381      DO jk = 1, jpkm1 
    362382         DO jj = 2, jpjm1    
    363383            DO ji = fs_2, fs_jpim1   ! vector opt. 
     384               ua(ji,jj,jk) = ( ua(ji,jj,jk) - ub(ji,jj,jk) ) * z1_p2dt 
    364385               va(ji,jj,jk) = ( va(ji,jj,jk) - vb(ji,jj,jk) ) * z1_p2dt 
    365386            END DO 
     
    393414      CALL wrk_dealloc( jpi,jpj,jpk, zwi, zwd, zws)  
    394415      ! 
     416      ! 
    395417      IF( nn_timing == 1 )  CALL timing_stop('dyn_zdf_imp') 
    396418      ! 
Note: See TracChangeset for help on using the changeset viewer.