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

Changeset 13873


Ignore:
Timestamp:
2020-11-25T14:27:03+01:00 (3 years ago)
Author:
emanuelaclementi
Message:

corrections from previous commit in zdftke.F90 - ticket #2155 #2339

File:
1 edited

Legend:

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

    r13851 r13873  
    239239      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    240240      ! 
    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 
     241      DO_2D( 0, 0, 0, 0 ) 
     242         en(ji,jj,1) = MAX( rn_emin0, zbbrau * taum(ji,jj) ) * tmask(ji,jj,1) 
     243         zdiag(ji,jj,1) = 1._wp/en(ji,jj,1) 
     244         zd_lw(ji,jj,1) = 1._wp   
     245         zd_up(ji,jj,1) = 0._wp 
     246      END_2D 
    277247      ! 
    278248      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     
    425395      END_3D 
    426396      ! 
    427       !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    428       !                            ! choose to keep coherence with previous estimation of 
    429       !                            !  Surface boundary condition on tke 
    430       !                            !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    431       ![EC] should it be removed? 
    432       IF ( ln_isfcav ) THEN 
    433          DO_2D( 1, 1, 1, 1 )       ! en(mikt(ji,jj))   = rn_emin 
    434             en(ji,jj,mikt(ji,jj))=rn_emin * tmask(ji,jj,1) 
    435          END_2D 
    436       END IF 
     397      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     398      !                     !  Surface boundary condition on tke if 
     399      !                     !  coupleing with waves 
     400      !                     !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     401      ! 
     402      IF ( cpl_phioc .and. ln_phioc )  THEN 
     403         SELECT CASE (nn_bc_surf) ! Boundary Condition using surface TKE flux from waves  
     404 
     405         CASE ( 0 ) ! Dirichlet BC 
     406            DO_2D( 0, 0, 0, 0 )    ! en(1)   = rn_ebb taum / rho0  (min value rn_emin0) 
     407               IF ( phioc(ji,jj) < 0 )  phioc(ji,jj) = 0._wp 
     408               en(ji,jj,1) = MAX( rn_emin0, .5 * ( 15.8 * phioc(ji,jj) / rho0 )**(2./3.) )  * tmask(ji,jj,1) 
     409               zdiag(ji,jj,1) = 1._wp/en(ji,jj,1)  ! choose to keep coherence with former estimation of 
     410            END_2D 
     411 
     412         CASE ( 1 ) ! Neumann BC 
     413            DO_2D( 0, 0, 0, 0 ) 
     414               IF ( phioc(ji,jj) < 0 )  phioc(ji,jj) = 0._wp 
     415               en(ji,jj,2)    = en(ji,jj,2) + ( rn_Dt * phioc(ji,jj) / rho0 ) /e3w(ji,jj,2,Kmm) 
     416               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) ) 
     417               zdiag(ji,jj,2) = zdiag(ji,jj,2) + zd_lw(ji,jj,2) 
     418               zdiag(ji,jj,1) = 1._wp 
     419               zd_lw(ji,jj,2) = 0._wp 
     420            END_2D 
     421 
     422         END SELECT 
     423 
     424      ENDIF 
    437425      ! 
    438426      !                          !* Matrix inversion from level 2 (tke prescribed at level 1) 
Note: See TracChangeset for help on using the changeset viewer.