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 6448 – NEMO

Changeset 6448


Ignore:
Timestamp:
2016-04-07T18:21:30+02:00 (8 years ago)
Author:
dancopsey
Message:

Merged in changeset 5239 of dev_r5021_nn_etau_revision

Location:
branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO
Files:
3 edited
6 copied

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90

    r6440 r6448  
    3939   USE zdfmxl          ! mixed layer 
    4040   USE dianam          ! build name of file (routine) 
     41   USE zdftke          ! vertical physics: one-equation scheme  
    4142   USE zdfddm          ! vertical  physics: double diffusion 
    4243   USE diahth          ! thermocline diagnostics 
     
    228229         CALL iom_put( "sbv", z2d )                ! bottom j-current 
    229230      ENDIF 
     231      CALL iom_put(    "avt"  , avt                        )    ! T vert. eddy diff. coef. 
     232      CALL iom_put(    "avm"  , avmu                       )    ! T vert. eddy visc. coef. 
     233      IF( lk_zdftke ) THEN   
     234         CALL iom_put( "tke"      , en                               )    ! TKE budget: Turbulent Kinetic Energy   
     235         CALL iom_put( "tke_niw"  , e_niw                            )    ! TKE budget: Near-inertial waves   
     236      ENDIF 
     237      IF( lk_zdfddm ) THEN 
     238         CALL iom_put( "avs" , fsavs(:,:,:)                          )    ! S vert. eddy diff. coef. 
    230239#if defined key_dynspg_ts 
    231240      CALL iom_put(  "vbar", vn_adv(:,:)      )    ! barotropic j-current 
  • branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfmxl.F90

    r6444 r6448  
    104104      CALL wrk_alloc( jpi,jpj, imld ) 
    105105 
    106       IF( kt == nit000 ) THEN 
     106      IF( kt <= nit000 ) THEN 
    107107         IF(lwp) WRITE(numout,*) 
    108108         IF(lwp) WRITE(numout,*) 'zdf_mxl : mixed layer depth' 
     
    147147      ! no need to output in offline mode 
    148148      IF( .NOT.lk_offline ) THEN    
     149      IF( kt >= nit000 ) THEN               ! workaround for calls before SOMETHING reads the XIOS namelist 
    149150         IF ( iom_use("mldr10_1") ) THEN 
    150151            IF( ln_isfcav ) THEN 
     
    161162            END IF 
    162163         END IF 
     164      ENDIF 
    163165      ENDIF 
    164166       
  • branches/UKMO/dev_r5518_GC3p0_package/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90

    r6440 r6448  
    8383   INTEGER  ::   nn_htau   ! type of tke profile of penetration (=0/1) 
    8484   REAL(wp) ::   rn_efr    ! fraction of TKE surface value which penetrates in the ocean 
     85   REAL(wp) ::   rn_c      ! fraction of TKE added within the mixed layer by nn_etau 
    8586   LOGICAL  ::   ln_lc     ! Langmuir cells (LC) as a source term of TKE or not 
    8687   REAL(wp) ::   rn_lc     ! coef to compute vertical velocity of Langmuir cells 
     
    8889   REAL(wp) ::   ri_cri    ! critic Richardson number (deduced from rn_ediff and rn_ediss values) 
    8990   REAL(wp) ::   rmxl_min  ! minimum mixing length value (deduced from rn_ediff and rn_emin values)  [m] 
     91   REAL(wp) ::   rhtau                     ! coefficient to relate MLD to htau when nn_htau == 2 
    9092   REAL(wp) ::   rhftau_add = 1.e-3_wp     ! add offset   applied to HF part of taum  (nn_etau=3) 
    9193   REAL(wp) ::   rhftau_scl = 1.0_wp       ! scale factor applied to HF part of taum  (nn_etau=3) 
    9294 
     95   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   e_niw          !: TKE budget- near-inertial waves term 
    9396   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   htau           ! depth of tke penetration (nn_htau) 
     97   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   efr            ! surface boundary condition for nn_etau = 4 
    9498   REAL(wp)        , ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dissl          ! now mixing lenght of dissipation 
    9599#if defined key_c1d 
     
    118122         &      e_pdl(jpi,jpj,jpk) , e_ric(jpi,jpj,jpk) ,                          & 
    119123#endif 
    120          &      htau  (jpi,jpj)    , dissl(jpi,jpj,jpk) , STAT= zdf_tke_alloc      ) 
     124         &      htau  (jpi,jpj)    , dissl(jpi,jpj,jpk) ,                          & 
     125         &      efr  (jpi,jpj)     , e_niw(jpi,jpj,jpk) ,                          & 
     126         &      STAT= zdf_tke_alloc      ) 
    121127         ! 
    122128      IF( lk_mpp             )   CALL mpp_sum ( zdf_tke_alloc ) 
     
    428434      END DO 
    429435 
     436      !                                 ! Save TKE prior to nn_etau addition   
     437      e_niw(:,:,:) = en(:,:,:)   
     438      !   
    430439      !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    431440      !                            !  TKE due to surface and internal wave breaking 
    432441      !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     442      IF( nn_htau == 2 ) THEN           !* mixed-layer depth dependant length scale 
     443         DO jj = 2, jpjm1 
     444            DO ji = fs_2, fs_jpim1   ! vector opt. 
     445               htau(ji,jj) = rhtau * hmlp(ji,jj) 
     446            END DO 
     447         END DO 
     448      ENDIF 
     449#if defined key_iomput 
     450      ! 
     451      CALL iom_put( "htau", htau(:,:) )  ! Check htau (even if constant in time) 
     452#endif 
     453      ! 
    433454      IF( nn_etau == 1 ) THEN           !* penetration below the mixed layer (rn_efr fraction) 
    434455         DO jk = 2, jpkm1 
     
    465486            END DO 
    466487         END DO 
     488      ELSEIF( nn_etau == 4 ) THEN       !* column integral independant of htau (rn_efr must be scaled up) 
     489         IF( nn_htau == 2 ) THEN        ! efr dependant on time-varying htau  
     490            DO jj = 2, jpjm1 
     491               DO ji = fs_2, fs_jpim1   ! vector opt. 
     492                  efr(ji,jj) = rn_efr / ( htau(ji,jj) * ( 1._wp - EXP( -bathy(ji,jj) / htau(ji,jj) ) ) ) 
     493               END DO 
     494            END DO 
     495         ENDIF 
     496         DO jk = 2, jpkm1 
     497            DO jj = 2, jpjm1 
     498               DO ji = fs_2, fs_jpim1   ! vector opt. 
     499                  en(ji,jj,jk) = en(ji,jj,jk) + efr(ji,jj) * en(ji,jj,1) * EXP( -fsdepw(ji,jj,jk) / htau(ji,jj) )   & 
     500                     &                                                   * ( 1._wp - fr_i(ji,jj) )  * tmask(ji,jj,jk) 
     501               END DO 
     502            END DO 
     503         END DO 
    467504      ENDIF 
    468505      CALL lbc_lnk( en, 'W', 1. )      ! Lateral boundary conditions (sign unchanged) 
     506      ! 
     507      DO jk = 2, jpkm1                             ! TKE budget: near-inertial waves term   
     508         DO jj = 2, jpjm1   
     509            DO ji = fs_2, fs_jpim1   ! vector opt.   
     510               e_niw(ji,jj,jk) = en(ji,jj,jk) - e_niw(ji,jj,jk)   
     511            END DO   
     512         END DO   
     513      END DO   
     514      !   
     515      CALL lbc_lnk( e_niw, 'W', 1. )   
    469516      ! 
    470517      CALL wrk_dealloc( jpi,jpj, imlc )    ! integer 
     
    730777         &                 rn_emin0, rn_bshear, nn_mxl , ln_mxl0  ,   & 
    731778         &                 rn_mxl0 , nn_pdl   , ln_lc  , rn_lc    ,   & 
    732          &                 nn_etau , nn_htau  , rn_efr    
    733       !!---------------------------------------------------------------------- 
    734       ! 
     779         &                 nn_etau , nn_htau  , rn_efr , rn_c    
     780      !!---------------------------------------------------------------------- 
     781      ! 
     782      ! NB. Default values of namelist parameters should be set in the reference namelist 
     783      !     but setting this one here because we aren't set up to use the reference namelist 
     784      !     properly yet.  
     785      rn_c = 0.8_wp 
     786 
    735787      REWIND( numnam_ref )              ! Namelist namzdf_tke in reference namelist : Turbulent Kinetic Energy 
    736788      READ  ( numnam_ref, namzdf_tke, IOSTAT = ios, ERR = 901) 
     
    776828         WRITE(numout,*) '      flag for computation of exp. tke profile    nn_htau   = ', nn_htau 
    777829         WRITE(numout,*) '      fraction of en which pene. the thermocline  rn_efr    = ', rn_efr 
     830         WRITE(numout,*) '      fraction of TKE added within the mixed layer by nn_etau rn_c    = ', rn_c 
    778831         WRITE(numout,*) 
    779832         WRITE(numout,*) '      critical Richardson nb with your parameters  ri_cri = ', ri_cri 
     
    786839      IF( nn_mxl  < 0   .OR.  nn_mxl  > 3 )   CALL ctl_stop( 'bad flag: nn_mxl is  0, 1 or 2 ' ) 
    787840      IF( nn_pdl  < 0   .OR.  nn_pdl  > 1 )   CALL ctl_stop( 'bad flag: nn_pdl is  0 or 1    ' ) 
    788       IF( nn_htau < 0   .OR.  nn_htau > 1 )   CALL ctl_stop( 'bad flag: nn_htau is 0, 1 or 2 ' ) 
     841      IF( nn_htau < 0  .OR.  nn_htau > 5 )   CALL ctl_stop( 'bad flag: nn_htau is 0 to 5    ' ) 
    789842      IF( nn_etau == 3 .AND. .NOT. ln_cpl )   CALL ctl_stop( 'nn_etau == 3 : HF taum only known in coupled mode' ) 
    790843 
     
    794847      ENDIF 
    795848       
    796       IF( nn_etau == 2  ) THEN 
    797           ierr = zdf_mxl_alloc() 
    798           nmln(:,:) = nlb10           ! Initialization of nmln 
    799       ENDIF 
     849      IF( nn_etau == 2  .OR. ( nn_etau /= 0 .AND. nn_htau == 2 ) )   CALL zdf_mxl( nit000 - 1 )      ! Initialization of nmln and hmlp 
    800850 
    801851      !                               !* depth of penetration of surface tke 
    802852      IF( nn_etau /= 0 ) THEN       
     853         htau(:,:) = 0._wp 
    803854         SELECT CASE( nn_htau )             ! Choice of the depth of penetration 
    804855         CASE( 0 )                                 ! constant depth penetration (here 10 meters) 
     
    806857         CASE( 1 )                                 ! F(latitude) : 0.5m to 30m poleward of 40 degrees 
    807858            htau(:,:) = MAX(  0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) )   )             
     859         CASE( 2 )                                 ! fraction of depth-integrated TKE within mixed-layer 
     860            rhtau = -1._wp / LOG( 1._wp - rn_c ) 
     861         CASE( 3 )                                 ! F(latitude) : 0.5m to 15m poleward of 20 degrees 
     862            htau(:,:) = MAX(  0.5_wp, MIN( 15._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(:,:) ) ) )   ) 
     863         CASE( 4 )                                 ! F(latitude) : 0.5m to 10m/30m poleward of 13/40 degrees north/south 
     864            DO jj = 2, jpjm1 
     865               DO ji = fs_2, fs_jpim1   ! vector opt. 
     866                  IF( gphit(ji,jj) <= 0._wp ) THEN 
     867                     htau(ji,jj) = MAX(  0.5_wp, MIN( 30._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) )   ) 
     868                  ELSE 
     869                     htau(ji,jj) = MAX(  0.5_wp, MIN( 10._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) )   ) 
     870                  ENDIF 
     871               END DO 
     872            END DO 
     873         CASE ( 5 )                                ! F(latitude) : 0.5m to 10m poleward of 13 degrees north/south, 
     874            DO jj = 2, jpjm1                       !               10m to 30m between 30/45 degrees south 
     875               DO ji = fs_2, fs_jpim1   ! vector opt. 
     876                  IF( gphit(ji,jj) <= -30._wp ) THEN 
     877                     htau(ji,jj) = MAX(  10._wp, MIN( 30._wp, 55._wp* ABS( SIN( rpi/120._wp * ( gphit(ji,jj) + 23._wp ) ) ) )   ) 
     878                  ELSE 
     879                     htau(ji,jj) = MAX(  0.5_wp, MIN( 10._wp, 45._wp* ABS( SIN( rpi/180._wp * gphit(ji,jj) ) ) )   ) 
     880                  ENDIF 
     881               END DO 
     882            END DO 
    808883         END SELECT 
     884         ! 
     885         IF( nn_etau == 4 .AND. nn_htau /= 2 ) THEN            ! efr dependant on constant htau 
     886            DO jj = 2, jpjm1 
     887               DO ji = fs_2, fs_jpim1   ! vector opt. 
     888                  efr(ji,jj) = rn_efr / ( htau(ji,jj) * ( 1._wp - EXP( -bathy(ji,jj) / htau(ji,jj) ) ) ) 
     889               END DO 
     890            END DO 
     891         ENDIF 
    809892      ENDIF 
    810893      !                               !* set vertical eddy coef. to the background value 
Note: See TracChangeset for help on using the changeset viewer.