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 15084 for NEMO/trunk/src/OCE/ISF/isfcavgam.F90 – NEMO

Ignore:
Timestamp:
2021-07-05T21:48:42+02:00 (3 years ago)
Author:
clem
Message:

trunk ISF: correct option cn_gammablk=vel_stab as much as I understand it and remove some useless lbc_lnk. Ref ticket is #2706

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/ISF/isfcavgam.F90

    r15082 r15084  
    1414   USE isftbl  , ONLY: isf_tbl 
    1515 
    16    USE oce     , ONLY: uu, vv, rn2         ! ocean dynamics and tracers 
     16   USE oce     , ONLY: uu, vv              ! ocean dynamics 
    1717   USE phycst  , ONLY: grav, vkarmn        ! physical constant 
    1818   USE eosbn2  , ONLY: eos_rab             ! equation of state 
     
    4444   !!----------------------------------------------------------------------------------------------------- 
    4545   ! 
    46    SUBROUTINE isfcav_gammats( Kmm, pttbl, pstbl, pqoce, pqfwf, pgt, pgs ) 
     46   SUBROUTINE isfcav_gammats( Kmm, pttbl, pstbl, pqoce, pqfwf, pRc, pgt, pgs ) 
    4747      !!---------------------------------------------------------------------- 
    4848      !! ** Purpose    : compute the coefficient echange for heat and fwf flux 
     
    5757      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pqoce, pqfwf    ! isf heat and fwf 
    5858      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl    ! top boundary layer tracer 
     59      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pRc             ! Richardson number 
    5960      !!--------------------------------------------------------------------- 
    6061      REAL(wp), DIMENSION(jpi,jpj)                :: zutbl, zvtbl    ! top boundary layer velocity 
     
    9495         pgs(:,:) = rn_gammas0 
    9596      CASE ( 'vel' ) ! gamma is proportional to u* 
    96          CALL gammats_vel      (                   zutbl, zvtbl, rCd0_top, r_ke0_top,               pgt, pgs ) 
     97         CALL gammats_vel      (                   zutbl, zvtbl, rCd0_top, r_ke0_top,                    pgt, pgs ) 
    9798      CASE ( 'vel_stab' ) ! gamma depends of stability of boundary layer and u* 
    98          CALL gammats_vel_stab (Kmm, pttbl, pstbl, zutbl, zvtbl, rCd0_top, r_ke0_top, pqoce, pqfwf, pgt, pgs ) 
     99         CALL gammats_vel_stab (Kmm, pttbl, pstbl, zutbl, zvtbl, rCd0_top, r_ke0_top, pqoce, pqfwf, pRc, pgt, pgs ) 
    99100      CASE DEFAULT 
    100101         CALL ctl_stop('STOP','method to compute gamma (cn_gammablk) is unknown (should not see this)') 
     
    153154   END SUBROUTINE gammats_vel 
    154155 
    155    SUBROUTINE gammats_vel_stab( Kmm, pttbl, pstbl, putbl, pvtbl, pCd, pke2, pqoce, pqfwf, &  ! <<== in 
    156       &                                                                     pgt  , pgs    )  ! ==>> out gammats [m/s] 
     156   SUBROUTINE gammats_vel_stab( Kmm, pttbl, pstbl, putbl, pvtbl, pCd, pke2, pqoce, pqfwf, pRc, &  ! <<== in 
     157      &                                                                     pgt  , pgs         )  ! ==>> out gammats [m/s] 
    157158      !!---------------------------------------------------------------------- 
    158159      !! ** Purpose    : compute the coefficient echange coefficient  
     
    171172      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: putbl, pvtbl   ! velocity in the losch top boundary layer 
    172173      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pttbl, pstbl   ! tracer   in the losch top boundary layer 
     174      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) :: pRc            ! Richardson number 
    173175      !!--------------------------------------------------------------------- 
    174176      INTEGER  :: ji, jj                     ! loop index 
    175177      INTEGER  :: ikt                        ! local integer 
    176178      REAL(wp) :: zdku, zdkv                 ! U, V shear  
    177       REAL(wp) :: zPr, zSc, zRc              ! Prandtl, Scmidth and Richardson number  
     179      REAL(wp) :: zPr, zSc                   ! Prandtl and Scmidth number  
    178180      REAL(wp) :: zmob, zmols                ! Monin Obukov length, coriolis factor at T point 
    179181      REAL(wp) :: zbuofdep, zhnu             ! Bouyancy length scale, sublayer tickness 
     
    190192      !!--------------------------------------------------------------------- 
    191193      ! 
    192       ! compute ustar 
    193       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    194          zustar(ji,jj) = SQRT( pCd(ji,jj) * ( putbl(ji,jj) * putbl(ji,jj) + pvtbl(ji,jj) * pvtbl(ji,jj) + pke2 ) ) 
    195       END_2D 
    196       ! 
    197       ! output ustar 
    198       CALL iom_put('isfustar',zustar(:,:)) 
    199       ! 
    200194      ! compute Pr and Sc number (eq ??) 
    201195      zPr =   13.8_wp 
     
    207201      ! 
    208202      ! compute gamma 
    209       DO_2D( nn_hls-1, nn_hls, nn_hls-1, nn_hls ) 
     203      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
     204 
    210205         ikt = mikt(ji,jj) 
     206 
     207         ! compute ustar 
     208         zustar(ji,jj) = SQRT( pCd(ji,jj) * ( putbl(ji,jj) * putbl(ji,jj) + pvtbl(ji,jj) * pvtbl(ji,jj) + pke2 ) ) 
    211209 
    212210         IF( zustar(ji,jj) == 0._wp ) THEN           ! only for kt = 1 I think 
     
    214212            pgs(ji,jj) = rn_gammas0 
    215213         ELSE 
    216             ! compute Rc number (as done in zdfric.F90) 
    217 !!gm better to do it like in the new zdfric.F90   i.e. avm weighted Ri computation 
    218             zcoef = 0.5_wp / e3w(ji,jj,ikt+1,Kmm) 
    219             !                                            ! shear of horizontal velocity 
    220             zdku = zcoef * (  uu(ji-1,jj  ,ikt  ,Kmm) + uu(ji,jj,ikt  ,Kmm)  & 
    221                &             -uu(ji-1,jj  ,ikt+1,Kmm) - uu(ji,jj,ikt+1,Kmm)  ) 
    222             zdkv = zcoef * (  vv(ji  ,jj-1,ikt  ,Kmm) + vv(ji,jj,ikt  ,Kmm)  & 
    223                &             -vv(ji  ,jj-1,ikt+1,Kmm) - vv(ji,jj,ikt+1,Kmm)  ) 
    224             !                                            ! richardson number (minimum value set to zero) 
    225             zRc = MAX(rn2(ji,jj,ikt+1), 0._wp) / MAX( zdku*zdku + zdkv*zdkv, zeps ) 
    226              
    227214            ! compute bouyancy  
    228215            zts(jp_tem) = pttbl(ji,jj) 
     
    244231            ! 
    245232            ! compute eta* (stability parameter) (Eq ??) 
    246             zetastar = 1._wp / ( SQRT(1._wp + MAX(zxsiN * zustar(ji,jj) / ( ABS(ff_f(ji,jj)) * zmols * zRc ), 0._wp))) 
     233            zetastar = 1._wp / ( SQRT(1._wp + MAX( 0._wp, zxsiN * zustar(ji,jj) & 
     234               &                                        / MAX( 1.e-20, ABS(ff_t(ji,jj)) * zmols * pRc(ji,jj) ) ))) 
    247235            ! 
    248236            ! compute the sublayer thickness (Eq ??) 
    249             zhnu = 5 * znu / zustar(ji,jj) 
     237            zhnu = 5 * znu / MAX( 1.e-20, zustar(ji,jj) ) 
    250238            ! 
    251239            ! compute gamma turb (Eq ??) 
    252             zgturb = 1._wp / vkarmn * LOG(zustar(ji,jj) * zxsiN * zetastar * zetastar / ( ABS(ff_f(ji,jj)) * zhnu )) & 
     240            zgturb = 1._wp / vkarmn * LOG(zustar(ji,jj) * zxsiN * zetastar * zetastar / MAX( 1.e-10, ABS(ff_t(ji,jj)) * zhnu )) & 
    253241               &      + 1._wp / ( 2 * zxsiN * zetastar ) - 1._wp / vkarmn 
    254242            ! 
     
    258246         END IF 
    259247      END_2D 
     248      ! output ustar 
     249      CALL iom_put('isfustar',zustar(:,:)) 
    260250 
    261251   END SUBROUTINE gammats_vel_stab 
Note: See TracChangeset for help on using the changeset viewer.