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 4644 for branches/2014/dev_r4642_WavesWG/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90 – NEMO

Ignore:
Timestamp:
2014-05-15T15:56:53+02:00 (10 years ago)
Author:
acc
Message:

Branch 2014/dev_r4642_WavesWG #1323. Import of surface wave components from the 2013/dev_ECMWF_waves branch + a few compatability changes and some mislaid documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4642_WavesWG/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90

    r4624 r4644  
    2626   !!                 !                                + cleaning of the parameters + bugs correction 
    2727   !!            3.3  !  2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
     28   !!                 !  2012-12  (oyvind.breivik@ecwmf.int) Changed to wave breaking source term 
    2829   !!---------------------------------------------------------------------- 
    2930#if defined key_zdftke   ||   defined key_esopa 
     
    4243   USE domvvl         ! domain: variable volume layer 
    4344   USE sbc_oce        ! surface boundary condition: ocean 
     45   USE sbcwave        ! wave parameters 
     46   USE sbcwave_ecmwf  ! ECMWF wave parameters 
    4447   USE zdf_oce        ! vertical physics: ocean variables 
    4548   USE zdfmxl         ! vertical physics: mixed layer 
     
    7881   LOGICAL  ::   ln_lc     ! Langmuir cells (LC) as a source term of TKE or not 
    7982   REAL(wp) ::   rn_lc     ! coef to compute vertical velocity of Langmuir cells 
     83   REAL(wp) ::   rn_alpavg = 100.0_wp      ! Average alpha (normalized, water-side energy flux, only used in 
     84                                           ! case we use the source term formulation with no wave model information 
     85                                           ! NB! The option of running with source term and no wave model has 
     86                                           ! not been properly tested yet but is included for consistency (Oyvind Breivik, 2013-07-16) 
     87   REAL(wp) ::   rn_deptmaxtkew = 50.0_wp   ! maximum depth [m] to be affected by TKE from breaking waves  
    8088 
    8189   REAL(wp) ::   ri_cri    ! critic Richardson number (deduced from rn_ediff and rn_ediss values) 
     
    8593 
    8694   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   en             !: now turbulent kinetic energy   [m2/s2] 
     95   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   e0             !: top level turbulent kinetic energy   [m2/s2] from waves 
     96   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   dfac           !: wave depth scaling factor    
    8797   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   htau           ! depth of tke penetration (nn_htau) 
    8898   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dissl          ! now mixing lenght of dissipation 
     
    109119      !!                ***  FUNCTION zdf_tke_alloc  *** 
    110120      !!---------------------------------------------------------------------- 
     121      INTEGER :: iexalloc 
    111122      ALLOCATE(                                                                    & 
    112123#if defined key_c1d 
     
    118129         &      avmu_k(jpi,jpj,jpk) , avmv_k(jpi,jpj,jpk), STAT= zdf_tke_alloc      ) 
    119130         ! 
     131      IF ( ln_wavetke ) THEN 
     132         ALLOCATE( e0(jpi,jpj) , dfac(jpi,jpj), STAT= iexalloc ) 
     133         ! Setting arrays to zero initially. 
     134         e0(:,:) = 0.0_wp 
     135         dfac(:,:) = 0.0_wp 
     136         ! 
     137         zdf_tke_alloc = zdf_tke_alloc + iexalloc 
     138      ENDIF 
    120139      IF( lk_mpp             )   CALL mpp_sum ( zdf_tke_alloc ) 
    121140      IF( zdf_tke_alloc /= 0 )   CALL ctl_warn('zdf_tke_alloc: failed to allocate arrays') 
     
    219238      REAL(wp) ::   zus   , zwlc  , zind            !    -         - 
    220239      REAL(wp) ::   zzd_up, zzd_lw                  !    -         - 
     240      REAL(wp) ::   lambda !    -         - 
     241      REAL(wp) ::   zphio_flux              !    -         - 
     242      REAL(wp) ::   sbr, z0, fb                     !    -         - 
     243 
    221244!!bfr      REAL(wp) ::   zebot                           !    -         - 
    222245      INTEGER , POINTER, DIMENSION(:,:  ) :: imlc 
     
    239262      !                     !  Surface boundary condition on tke 
    240263      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    241       DO jj = 2, jpjm1            ! en(1)   = rn_ebb taum / rau0  (min value rn_emin0) 
    242          DO ji = fs_2, fs_jpim1   ! vector opt. 
    243             en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1) 
    244          END DO 
    245       END DO 
    246        
     264      ! Wave parameters read? 
     265      IF ( ln_wavetke ) THEN 
     266         ! Breaking-wave TKE injection as flux 
     267         DO jj = 2, jpjm1            ! en(1)   = rn_ebb taum / rau0  (min value rn_emin0) 
     268            DO ji = fs_2, fs_jpim1   ! vector opt. 
     269               ! Roughness length proportional to wave height, capped at Hs = 0.1 m 
     270               z0 = 0.5_wp*MAX(swh_wavepar(ji,jj), 0.1_wp) 
     271               lambda = 2.38_wp/z0 
     272               ! The energy flux from the wave model in physical units 
     273               zphio_flux = MAX(phioc_wavepar(ji,jj), 0.0_wp) 
     274               ! TKE at surface (Mellor and Blumberg, 2004) 
     275               e0(ji,jj) = 0.5_wp*( 15.8_wp*zphio_flux/rau0 )**0.67_wp 
     276               ! Reducing the surface TKE by scaling with T-depth of first vertical level 
     277               dfac(ji,jj) = MAX( (2.0_wp*lambda*fsdept(ji,jj,1) )/3.0_wp, 0.00001_wp ) 
     278               ! TKE surface boundary condition weighted by the thickness of the first level 
     279               en(ji,jj,1) = MAX( rn_emin0, e0(ji,jj) * ( 1.0_wp - EXP(-dfac(ji,jj)) ) / dfac(ji,jj) ) * tmask(ji,jj,1) 
     280            ENDDO 
     281         ENDDO 
     282         ! If wave parameters are not read, use rn_ebb, corresponding to alpha = 100.0 
     283      ELSE 
     284         DO jj = 2, jpjm1            ! en(1)   = rn_ebb taum / rau0  (min value rn_emin0) 
     285            DO ji = fs_2, fs_jpim1   ! vector opt. 
     286               ! Estimate average energy flux from std value found in rn_ebb (corresponds to alpha=100.0) 
     287               en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1) 
     288            ENDDO 
     289         ENDDO 
     290      ENDIF 
     291  
    247292!!bfr   - start commented area 
    248293      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     
    443488      ENDIF 
    444489      CALL lbc_lnk( en, 'W', 1. )      ! Lateral boundary conditions (sign unchanged) 
     490      IF ( ln_wavetke ) THEN 
     491         CALL lbc_lnk( e0,     'W', 1. ) ! Lateral boundary conditions (sign unchanged) 
     492         CALL lbc_lnk( dfac,   'W', 1. ) ! Lateral boundary conditions (sign unchanged) 
     493      ENDIF 
    445494      ! 
    446495      CALL wrk_dealloc( jpi,jpj, imlc )    ! integer 
Note: See TracChangeset for help on using the changeset viewer.