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 13851 for NEMO/branches/2020 – NEMO

Changeset 13851 for NEMO/branches/2020


Ignore:
Timestamp:
2020-11-23T15:24:10+01:00 (3 years ago)
Author:
emanuelaclementi
Message:

corrections for zdftke Neumann BC plus loop alignement - ticket #2155 #2339

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12702_ASINTER-02_emanuelaclementi_Waves/src/OCE/ZDF/zdftke.F90

    r13759 r13851  
    239239      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    240240      ! 
    241       DO_2D( 0, 0, 0, 0 )         ! en(1)   = rn_ebb taum / rau0  (min value rn_emin0) 
    242 !! clem: this should be the right formulation but it makes the model unstable unless drags are calculated implicitly 
    243 !!       one way around would be to increase zbbirau  
    244 !!          en(ji,jj,1) = MAX( rn_emin0, ( ( 1._wp - fr_i(ji,jj) ) * zbbrau + & 
    245 !!             &                                     fr_i(ji,jj)   * zbbirau ) * taum(ji,jj) ) * tmask(ji,jj,1) 
    246          en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1) 
    247       END_2D 
     241      zd_up(ji,jj,1) = 0._wp 
     242      zd_lw(ji,jj,1) = 1._wp 
     243 
     244      IF ( cpl_phioc .and. ln_phioc )  THEN 
     245         SELECT CASE (nn_bc_surf) ! Boundary Condition using surface TKE flux from waves 
     246 
     247         CASE ( 0 ) ! Dirichlet BC 
     248 
     249            DO_2D( 0, 0, 0, 0 )    ! en(1)   = rn_ebb taum / rho0  (min value rn_emin0) 
     250               IF ( phioc(ji,jj) < 0 )  phioc(ji,jj) = 0._wp 
     251               en(ji,jj,1) = MAX( rn_emin0, .5 * ( 15.8 * phioc(ji,jj) / rho0 )**(2./3.) )  * tmask(ji,jj,1) 
     252               zdiag(ji,jj,1) = 1._wp/en(ji,jj,1)  ! choose to keep coherence with former estimation of 
     253                                                   ! zd_lw(ji,jj,2) = en(ji,jj,2) - zd_lw(ji,jj,2) * en(ji,jj,1) 
     254            END_2D 
     255 
     256         CASE ( 1 ) ! Neumann BC 
     257            DO_2D( 0, 0, 0, 0 ) 
     258               IF ( phioc(ji,jj) < 0 )  phioc(ji,jj) = 0._wp 
     259               en(ji,jj,2)    = en(ji,jj,2) + ( rn_Dt * phioc(ji,jj) / rho0 )/e3w(ji,jj,2,Kmm) 
     260               en(ji,jj,1)    = en(ji,jj,2) + (2 * e3t(ji,jj,1,Kmm) * phioc(ji,jj)/rho0) / ( p_avm(ji,jj,1) + p_avm(ji,jj,2) ) 
     261               zdiag(ji,jj,2) = zdiag(ji,jj,2) + zd_lw(ji,jj,2) 
     262               zd_lw(ji,jj,2) = 0._wp 
     263               zdiag(ji,jj,1) = 1._wp 
     264            END_2D 
     265          
     266         END SELECT 
     267 
     268      ELSE  ! TKE Dirichlet boundary condition (without wave coupling) 
     269 
     270         DO_2D( 0, 0, 0, 0 )       ! en(1)   = rn_ebb taum / rho0  (min value rn_emin0) 
     271            en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1) 
     272            zdiag(ji,jj,1) = 1._wp/en(ji,jj,1) ! choose to keep coherence with former estimation of 
     273                                               ! zd_lw(ji,jj,2) = en(ji,jj,2) - zd_lw(ji,jj,2) * en(ji,jj,1) 
     274         END_2D 
     275 
     276      ENDIF 
    248277      ! 
    249278      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     
    400429      !                            !  Surface boundary condition on tke 
    401430      !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    402       ! [EC] Should we keep this?? 
     431      ![EC] should it be removed? 
    403432      IF ( ln_isfcav ) THEN 
    404433         DO_2D( 1, 1, 1, 1 )       ! en(mikt(ji,jj))   = rn_emin 
     
    406435         END_2D 
    407436      END IF 
    408  
    409       IF ( cpl_phioc .and. ln_phioc )  THEN 
    410          SELECT CASE (nn_bc_surf)  ! Boundary Condition using surface TKE flux from waves 
    411  
    412          CASE ( 0 ) ! Dirichlet BC 
    413  
    414             DO_2D( 0, 0, 0, 0 )    ! en(1)   = rn_ebb taum / rho0  (min value rn_emin0) 
    415                IF ( phioc(ji,jj) < 0 )  phioc(ji,jj) = 0._wp 
    416                en(ji,jj,1) = MAX( rn_emin0, .5 * ( 15.8 * phioc(ji,jj) / rho0 )**(2./3.) )  * tmask(ji,jj,1) 
    417                zdiag(ji,jj,1) = 1._wp/en(ji,jj,1)  ! choose to keep coherence with former estimation of 
    418                zd_lw(ji,jj,1) = 1._wp              ! zd_lw(ji,jj,2) = en(ji,jj,2) - zd_lw(ji,jj,2) * en(ji,jj,1) 
    419                zd_up(ji,jj,1) = 0._wp 
    420             END_2D 
    421  
    422          CASE ( 1 ) ! Neumann BC 
    423             DO_2D( 0, 0, 0, 0 ) 
    424                IF ( phioc(ji,jj) < 0 )  phioc(ji,jj) = 0._wp 
    425                en(ji,jj,2)    = en(ji,jj,2) + ( rn_Dt * phioc(ji,jj) / rho0 ) /e3w(ji,jj,2,Kmm) 
    426                en(ji,jj,1)    = en(ji,jj,2) + (2 * e3t(ji,jj,1,Kmm) * phioc(ji,jj)) / ( p_avm(ji,jj,1) + p_avm(ji,jj,2) ) 
    427                zdiag(ji,jj,2) = zdiag(ji,jj,2) + zd_lw(ji,jj,2) 
    428                zd_lw(ji,jj,2) = 0._wp 
    429                zd_up(ji,jj,1) = 0._wp 
    430             END_2D 
    431 ! 
    432          END SELECT 
    433  
    434       ELSE  ! TKE Dirichlet boundary condition (without wave coupling) 
    435  
    436          DO_2D( 0, 0, 0, 0 )       ! en(1)   = rn_ebb taum / rho0  (min value rn_emin0) 
    437             en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1) 
    438             zdiag(ji,jj,1) = 1._wp/en(ji,jj,1) ! choose to keep coherence with former estimation of 
    439             zd_lw(ji,jj,1) = 1._wp             ! zd_lw(ji,jj,2) = en(ji,jj,2) - zd_lw(ji,jj,2) * en(ji,jj,1) 
    440             zd_up(ji,jj,1) = 0._wp 
    441          END_2D 
    442  
    443       ENDIF 
    444437      ! 
    445438      !                          !* Matrix inversion from level 2 (tke prescribed at level 1) 
     
    771764         IF ( cpl_phioc .and. ln_phioc )  THEN 
    772765            SELECT CASE( nn_bc_surf)             ! Type of scaling under sea-ice 
    773             CASE( 0 )   ;   WRITE(numout,*) '  nn_bc_surf=0  ==>>>   DIRICHLET Surface Boundary Condition using surface TKE flux from waves' 
    774             CASE( 1 )   ;   WRITE(numout,*) '  nn_bc_surf=1  ==>>>   NEUMANN Surface Boundary Condition using surface TKE flux from waves' 
     766            CASE( 0 )   ;   WRITE(numout,*) '  nn_bc_surf=0 ==>>> DIRICHLET SBC using surface TKE flux from waves' 
     767            CASE( 1 )   ;   WRITE(numout,*) '  nn_bc_surf=1 ==>>> NEUMANN SBC using surface TKE flux from waves' 
    775768            END SELECT 
    776          ENDIF  
     769         ENDIF 
    777770         WRITE(numout,*) '      test param. to add tke induced by wind      nn_etau   = ', nn_etau 
    778771         WRITE(numout,*) '          type of tke penetration profile            nn_htau   = ', nn_htau 
Note: See TracChangeset for help on using the changeset viewer.